Example #1
0
        private void SetProperties(string path)
        {
            if (Directory.Exists(path))
            {
                var directoryInfo = new DirectoryInfo(path);

                FullName = directoryInfo.FullName;
                Name     = directoryInfo.Name;
                NodeType = ExplorerTreeNodeType.Directory;
            }
            else if (File.Exists(path))
            {
                var fileInfo = new FileInfo(path);

                FullName = fileInfo.FullName;
                Name     = fileInfo.Name;
                NodeType = ExplorerTreeNodeType.File;
            }
            else
            {
                FullName = string.Empty;
                Name     = path;
                NodeType = ExplorerTreeNodeType.Standard;
            }

            Text        = Name;
            ToolTipText = !string.IsNullOrEmpty(FullName) ? FullName : Name;
        }
Example #2
0
 /// <summary>
 /// ExplorerTreeNodeオブジェクトの新しいインスタンスを初期化します。
 /// </summary>
 /// <param name="nodeType"></param>
 protected ExplorerTreeNode(ExplorerTreeNodeType nodeType)
 {
     this.m_NodeType = nodeType;
 }