コード例 #1
0
ファイル: ContentFolder.cs プロジェクト: yf885188/FlaxEngine
 /// <summary>
 /// Initializes a new instance of the <see cref="ContentFolder"/> class.
 /// </summary>
 /// <param name="type">The folder type.</param>
 /// <param name="path">The path to the item.</param>
 /// <param name="node">The folder parent node.</param>
 internal ContentFolder(ContentFolderType type, string path, ContentTreeNode node)
     : base(path)
 {
     FolderType = type;
     Node       = node;
     ShortName  = System.IO.Path.GetFileName(path);
 }
コード例 #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ContentTreeNode"/> class.
 /// </summary>
 /// <param name="parent">The parent node.</param>
 /// <param name="type">The folder type.</param>
 /// <param name="path">The folder path.</param>
 protected ContentTreeNode(ContentTreeNode parent, ContentFolderType type, string path)
     : base(false, Editor.Instance.Icons.FolderClosed12, Editor.Instance.Icons.FolderOpened12)
 {
     _folder = new ContentFolder(type, path, this);
     Text    = _folder.ShortName;
     if (parent != null)
     {
         Folder.ParentFolder = parent.Folder;
         Parent = parent;
     }
 }
コード例 #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MainContentTreeNode"/> class.
 /// </summary>
 /// <param name="type">The folder type.</param>
 /// <param name="path">The folder path.</param>
 public MainContentTreeNode(ContentFolderType type, string path)
     : base(type, path)
 {
     _watcher = new FileSystemWatcher(path)
     {
         IncludeSubdirectories = true,
         EnableRaisingEvents   = true
     };
     _watcher.Changed += onEvent;
     _watcher.Created += onEvent;
     _watcher.Deleted += onEvent;
     _watcher.Renamed += onEvent;
 }
コード例 #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ContentTreeNode"/> class.
 /// </summary>
 /// <param name="type">The folder type.</param>
 /// <param name="path">The folder path.</param>
 protected ContentTreeNode(ContentFolderType type, string path)
     : base(false, Editor.Instance.Icons.FolderClosed12, Editor.Instance.Icons.FolderOpened12)
 {
     _folder = new ContentFolder(type, path, this);
     Text    = _folder.ShortName;
 }
コード例 #5
0
ファイル: ContentFolder.cs プロジェクト: stefnotch/FlaxAPI
 /// <summary>
 /// Initializes a new instance of the <see cref="ContentFolder"/> class.
 /// </summary>
 /// <param name="type">The folder type.</param>
 /// <param name="path">The path to the item.</param>
 /// <param name="node">The folder parent node.</param>
 internal ContentFolder(ContentFolderType type, string path, ContentTreeNode node)
     : base(path)
 {
     FolderType = type;
     Node       = node;
 }