示例#1
0
        /// <summary>
        /// Returns an array of NodeInfo entries that exist beneath the specified NodeInfo.
        /// </summary>
        public override NodeInfo[] GetChildNodes(NodeInfo info)
        {
            ProjectNodeSource source   = (ProjectNodeSource)ParentSource;
            List <NodeInfo>   children = new List <NodeInfo>();

            // Get a list of essential tags from the game definition.
            foreach (TemplateTag tag in source.ProjectManager.Project.Template.TagSet)
            {
                string element = tag.Name;
                if (source.TemplateTags.ContainsTemplateElement(element))
                {
                    NodeInfo childInfo = new NodeInfo(source.GetNodeType <ProjectTemplateTagNodeType>(),
                                                      source.TemplateTags[element].Path);
                    childInfo.Tag = element;
                    children.Add(childInfo);
                }
                else
                {
                    NodeInfo childInfo = new NodeInfo(source.GetNodeType <GlobalTemplateTagNodeType>(),
                                                      tag.DefaultFile + "." + tag.FileType);
                    childInfo.Tag = element;
                    children.Add(childInfo);
                }
            }
            return(children.ToArray());
        }
示例#2
0
        /// <summary>
        /// Returns an array of NodeInfo entries that exist beneath the specified NodeInfo.
        /// </summary>
        public override NodeInfo[] GetChildNodes(NodeInfo info)
        {
            ProjectNodeSource source   = (ProjectNodeSource)ParentSource;
            List <NodeInfo>   children = new List <NodeInfo>();

            // Referenced files/folders
            foreach (string folder in source.ProjectReferences.GetFolderList(info.Identifier))
            {
                children.Add(new NodeInfo(source.GetNodeType <FolderNodeType>(), folder));
            }
            foreach (string file in source.ProjectReferences.GetFileList(info.Identifier))
            {
                NodeType nodeType = source.GetNodeType(file);
                children.Add(new NodeInfo(nodeType, file));
            }

            foreach (string folder in source.ProjectFolder.GetFolderList(info.Identifier))
            {
                children.Add(new NodeInfo(source.GetNodeType <FolderNodeType>(), folder));
            }
            foreach (string file in source.ProjectFolder.GetFileList(info.Identifier))
            {
                NodeType nodeType = source.GetNodeType(file);
                children.Add(new NodeInfo(nodeType, file));
            }
            return(children.ToArray());
        }
示例#3
0
        public override SuperTooltipInfo GetTooltip(NodeInfo info)
        {
            // Get the modified date for the specified file.
            ProjectNodeSource source = (ProjectNodeSource)ParentSource;

            string filename      = Path.GetFileName(info.Identifier);
            string baseFilename  = Path.GetFileNameWithoutExtension(info.Identifier);
            string fileExtension = Path.GetExtension(info.Identifier).TrimStart('.');

            string nodeName = GetNodeName(info.Identifier);

            StringBuilder sb = new StringBuilder();

            sb.Append("<span padding=\"0,4,2,0\"><b>Source:</b></span><img src=\"global::Prometheus.Properties.Resources.joystick16\" /><span padding=\"4,0,2,0\">");
            sb.Append(source.GameDefinition.Name + " " + source.GameDefinition.Platform);
            sb.Append("</span><br/>");

            sb.Append("<b>Name: </b>");
            sb.Append(baseFilename);
            sb.Append("<br/>");

            sb.Append("<b>Type: </b>");
            sb.Append(fileExtension);

            return(new SuperTooltipInfo(
                       nodeName, "", sb.ToString(), null, null, eTooltipColor.System, true,
                       false, new Size(0, 0)));
        }
 public ValidReferencedState(ProjectNodeSource projectSource,
                             string name, Bitmap expandedIcon, Bitmap collapsedIcon, Color foregroundColor,
                             Color backgroundColor)
     : base(name, expandedIcon, collapsedIcon,
            foregroundColor, backgroundColor)
 {
     this.projectSource = projectSource;
     projectSource.ProjectReferences.FileAdded   += SourceChanged;
     projectSource.ProjectReferences.FileRemoved += SourceChanged;
     projectSource.ProjectFolder.FileAdded       += SourceChanged;
     projectSource.ProjectFolder.FileRemoved     += SourceChanged;
 }
示例#5
0
        public override SuperTooltipInfo GetTooltip(NodeInfo info)
        {
            // Get the modified date for the specified file.
            ProjectNodeSource source = (ProjectNodeSource)ParentSource;

            // Count the number of files unde the specified path.
            int fileCount = source.ProjectManager.Project.RecycleBin.TotalFiles;

            return(new SuperTooltipInfo(
                       "Recycle Bin", "", fileCount > 0 ? "<b>Total Files Contained:</b> " + String.Format("{0:,0}", fileCount) : "<i>Currently Empty</i>", null, null, eTooltipColor.System, true,
                       false, new Size(0, 0)));
        }
示例#6
0
        /// <summary>
        /// Returns a formatted node name based on the supplied identifier.
        /// </summary>
        public override string GetNodeName(string identifier)
        {
            ProjectNodeSource source = (ProjectNodeSource)ParentSource;

            foreach (TemplateTag tag in source.ProjectManager.Project.Template.TagSet)
            {
                if (tag.DefaultFile + "." + tag.FileType == identifier)
                {
                    return(tag.Name);
                }
            }
            return("Invalid Template element!");
        }
示例#7
0
        public override SuperTooltipInfo GetTooltip(NodeInfo info)
        {
            // Get the modified date for the specified file.
            ProjectNodeSource source = (ProjectNodeSource)ParentSource;

            string folderName = Path.GetFileNameWithoutExtension(info.Identifier + ".hack");

            // Count the number of files unde the specified path.
            int fileCount = source.ProjectFolder.GetFileList(info.Identifier, null, true).Length;

            return(new SuperTooltipInfo(
                       folderName, "", "<b>Tag Count:</b> " + String.Format("{0:,0}", fileCount), null, null, eTooltipColor.System, true,
                       false, new Size(0, 0)));
        }
        /// <summary>
        /// Returns a formatted node name based on the supplied identifier.
        /// </summary>
        public override string GetNodeName(string identifier)
        {
            ProjectNodeSource source = (ProjectNodeSource)ParentSource;

            ProjectTag[] tags = source.TemplateTags.GetTemplateList();
            for (int x = 0; x < tags.Length; x++)
            {
                if (tags[x].Path == identifier)
                {
                    return(tags[x].TemplateElement);
                }
            }
            return("Invalid Template element!");
        }
示例#9
0
        public override SuperTooltipInfo GetTooltip(NodeInfo info)
        {
            // Get the modified date for the specified file.
            ProjectNodeSource source = (ProjectNodeSource)ParentSource;

            string filename      = Path.GetFileName(info.Identifier);
            string baseFilename  = Path.GetFileNameWithoutExtension(info.Identifier);
            string fileExtension = Path.GetExtension(info.Identifier).TrimStart('.');
            int    noteCount     = 0;
            int    revisionCount = 0;

            StringBuilder sb = new StringBuilder();

            sb.Append("<b>Name: </b>");
            sb.Append(baseFilename);
            sb.Append("<br/>");

            sb.Append("<b>Type: </b>");
            sb.Append(fileExtension);
            sb.Append("<br/><br/>");

            string fileSize = "";

            if (source.ProjectManager.ProjectFolder.FileExists(info.Identifier))
            {
                sb.Append("<b>Notes: </b>");
                sb.Append(noteCount);
                sb.Append("<br/>");

                sb.Append("<b>Revisions: </b>");
                sb.Append(revisionCount);
                sb.Append("<br/>");

                DateTime modified = source.ProjectManager.ProjectFolder.GetModifiedTime(info.Identifier);
                sb.Append("<b>Modified: </b>");
                sb.Append(Helpers.ElapsedTimeString(modified));
                sb.Append("<br/>");

                fileSize = "<b>Size:</b> " + String.Format("{0:0,0}", source.ProjectManager.ProjectFolder.GetFileSize(info.Identifier)) + " bytes.";
            }
            else
            {
                sb.Append("<font color=\"red\">File does not exist.</font>");
            }

            return(new SuperTooltipInfo(
                       filename, fileSize, sb.ToString(), null, null, eTooltipColor.System, true,
                       String.IsNullOrEmpty(fileSize) ? false : true, new Size(0, 0)));
        }
 public UnreferencedState(ProjectNodeSource projectSource, string name, Bitmap expandedIcon, Bitmap collapsedIcon, Color foregroundColor, Color backgroundColor)
     : base(projectSource, name, expandedIcon, collapsedIcon, foregroundColor, backgroundColor)
 {
     ;
 }