コード例 #1
0
        /// <summary>
        /// Initializes a file item for the given special folder.
        /// </summary>
        /// <param name="parent">Parent tree item.</param>
        /// <param name="folder">Special folder to use.</param>
        /// <param name="showFiles">True if we want to show file when expanded.</param>
        public ExplorerItem(ExplorerItem parent, Environment.SpecialFolder folder, bool showFiles)
            : base(parent, new DirectoryInfo(Environment.GetFolderPath(folder)), true)
        {
            this.m_ShowFiles = showFiles;
            switch (folder)
            {
            case Environment.SpecialFolder.Desktop:
                this.IconBrush = Brushes.DodgerBlue;
                this.Icon      = MainMenuIcon.Monitor;
                break;

            case Environment.SpecialFolder.MyDocuments:
                this.Icon = MainMenuIcon.Favoritefolder;
                break;

            case Environment.SpecialFolder.MyVideos:
                this.IconBrush = Brushes.DarkRed;
                this.Icon      = MainMenuIcon.Myvideos;
                break;

            case Environment.SpecialFolder.MyMusic:
                this.IconBrush = Brushes.DarkOrange;
                this.Icon      = MainMenuIcon.Mymusic;
                break;

            case Environment.SpecialFolder.MyPictures:
                this.IconBrush = Brushes.CornflowerBlue;
                this.Icon      = MainMenuIcon.Mypictures;
                break;

            default:
                this.Icon = MainMenuIcon.FolderClose;
                break;
            }
        }
コード例 #2
0
 /// <summary>
 /// Initializes a file item from a given path.
 /// </summary>
 /// <param name="parent">Parent tree item.</param>
 /// <param name="directory">The directory item.</param>
 /// <param name="showFiles">True if we want to show file when expanded.</param>
 public ExplorerItem(ExplorerItem parent, DirectoryInfo directory, bool showFiles)
     : base(parent, directory, true)
 {
     this.m_ShowFiles = showFiles;
     this.Icon        = MainMenuIcon.FolderClose;
 }
コード例 #3
0
 /// <summary>
 /// Initializes a file item from a given path.
 /// </summary>
 /// <param name="parent">Parent tree item.</param>
 /// <param name="file">The file item.</param>
 public ExplorerItem(ExplorerItem parent, FileInfo file)
     : base(parent, file)
 {
 }