CSSScript.SEItem.GetLogicalFileName C# (CSharp) Метод

GetLogicalFileName() публичный Метод

public GetLogicalFileName ( ) : string
Результат string
        public string GetLogicalFileName()
        {
            string retval = this.ToString();
            if (!isSeparator)
            {
                if (!isDir)
                {
                    if (isConsole)
                        retval += ".c";
                    retval += ".cmd";
                }
            }
            else
            {
                retval = "separator";
            }
            if (!enabled)
                retval += ".disabled";
            return retval;
        }
        public bool isDir;

Usage Example

Пример #1
0
        void ProcessFileNode(TreeNode node)
        {
            SEItem shellEx = (SEItem)node.Tag;

            //reconstruct full (File not treeView) path
            string newPath = (node.Index * spaceBetweenItems).ToString("D2") + "." + shellEx.GetLogicalFileName();

            TreeNode child = node;
            TreeNode parent;

            while ((parent = child.Parent) != null)
            {
                newPath = Path.Combine((parent.Index * spaceBetweenItems).ToString("D2") + "." + (parent.Tag as SEItem).GetLogicalFileName(), newPath);
                child   = parent;
            }
            newPath = Path.Combine(baseDirectory, newPath);
            //Trace.WriteLine(newPath);
            if (newPath != shellEx.location)
            {
                if (!Directory.Exists(Path.GetDirectoryName(newPath)))
                {
                    Directory.CreateDirectory(Path.GetDirectoryName(newPath));
                }
                File.Move(shellEx.location, newPath);
            }
        }