FileSystemEventArgs.cs source code in C# .NET

Source code for the .NET framework in C#

                        

Code:

/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / ndp / fx / src / Services / IO / System / IO / FileSystemEventArgs.cs / 1 / FileSystemEventArgs.cs

                            //------------------------------------------------------------------------------ 
// 
//     Copyright (c) Microsoft Corporation.  All rights reserved.
// 
//----------------------------------------------------------------------------- 

namespace System.IO { 
 
    using System.Diagnostics;
    using System.Security.Permissions; 

    using System;

    ///  
    /// Provides data for the directory events: , , .
    ///  
    public class FileSystemEventArgs : EventArgs { 
        private WatcherChangeTypes changeType;
        private string name; 
        private string fullPath;

        /// 
        /// Initializes a new instance of the  class. 
        /// 
        public FileSystemEventArgs(WatcherChangeTypes changeType, string directory, string name) 
        { 
            this.changeType = changeType;
            this.name = name; 

            // Ensure that the directory name ends with a "\"
            if (!directory.EndsWith("\\", StringComparison.Ordinal)) {
                directory = directory + "\\"; 
            }
 
            this.fullPath = directory + name; 
        }
 
        /// 
        ///    
        ///       Gets
        ///       one of the  
        ///       values.
        ///     
        ///  
        public WatcherChangeTypes ChangeType {
            get { 
                return changeType;
            }
        }
 
        /// 
        ///     
        ///       Gets 
        ///       the
        ///       fully qualifed path of the affected file or directory. 
        ///    
        /// 
        public string FullPath {
            get { 
                return fullPath;
            } 
        } 

 
        /// 
        ///    
        ///       Gets
        ///       the name of the affected file or directory. 
        ///    
        ///  
        public string Name { 
            get {
                return name; 
            }
        }
    }
 
}

// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
//------------------------------------------------------------------------------ 
// 
//     Copyright (c) Microsoft Corporation.  All rights reserved.
// 
//----------------------------------------------------------------------------- 

namespace System.IO { 
 
    using System.Diagnostics;
    using System.Security.Permissions; 

    using System;

    ///  
    /// Provides data for the directory events: , , .
    ///  
    public class FileSystemEventArgs : EventArgs { 
        private WatcherChangeTypes changeType;
        private string name; 
        private string fullPath;

        /// 
        /// Initializes a new instance of the  class. 
        /// 
        public FileSystemEventArgs(WatcherChangeTypes changeType, string directory, string name) 
        { 
            this.changeType = changeType;
            this.name = name; 

            // Ensure that the directory name ends with a "\"
            if (!directory.EndsWith("\\", StringComparison.Ordinal)) {
                directory = directory + "\\"; 
            }
 
            this.fullPath = directory + name; 
        }
 
        /// 
        ///    
        ///       Gets
        ///       one of the  
        ///       values.
        ///     
        ///  
        public WatcherChangeTypes ChangeType {
            get { 
                return changeType;
            }
        }
 
        /// 
        ///     
        ///       Gets 
        ///       the
        ///       fully qualifed path of the affected file or directory. 
        ///    
        /// 
        public string FullPath {
            get { 
                return fullPath;
            } 
        } 

 
        /// 
        ///    
        ///       Gets
        ///       the name of the affected file or directory. 
        ///    
        ///  
        public string Name { 
            get {
                return name; 
            }
        }
    }
 
}

// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
                        

Link Menu

Network programming in C#, Network Programming in VB.NET, Network Programming in .NET
This book is available now!
Buy at Amazon US or
Buy at Amazon UK