/// <summary>
 /// Gets the description for the given IntelliMergeType enum value.
 /// </summary>
 /// <param name="type"></param>
 /// <returns></returns>
 public static string GetIntelliMergeTypeDescription(IntelliMergeType type)
 {
     if (!intellimergeToDescription.ContainsKey(type))
     {
         intellimergeToDescription[type] = Utility.GetDescription(type);
         descriptionToIntellimerge[intellimergeToDescription[type]] = type;
     }
     return(intellimergeToDescription[type]);
 }
 private void SetIntelliMerge(IntelliMergeType intellimerge)
 {
     if (DesignMode)
         return;
     if (output == null)
         return;
     selectedItem = intellimerge;
     output.SetIntelliMergeOnAllSelectedNodes(this, selectedItem);
 }
 private void SetIntelliMerge(IntelliMergeType intellimerge)
 {
     if (DesignMode)
     {
         return;
     }
     if (output == null)
     {
         return;
     }
     selectedItem = intellimerge;
     output.SetIntelliMergeOnAllSelectedNodes(this, selectedItem);
 }
 /// <summary>
 /// Returns the IntelliMergeType with the given description. Throws an exception if the description does not exist.
 /// </summary>
 /// <param name="description"></param>
 /// <returns></returns>
 public static IntelliMergeType GetIntelliMergeType(string description)
 {
     if (!descriptionToIntellimerge.ContainsKey(description))
     {
         // If the enum is not already cached, we need to cache it. Unfortunately there is no good
         // way of doing this, so just cache the whole lot if this happens.
         foreach (string name in Enum.GetNames(typeof(IntelliMergeType)))
         {
             IntelliMergeType type = ((IntelliMergeType)Enum.Parse(typeof(IntelliMergeType), name, true));
             GetIntelliMergeTypeDescription(type);
         }
     }
     return(descriptionToIntellimerge[description]);
 }
Exemple #5
0
        protected void SetIntelliMergeOnSelfAndAllChildrenInternal(IntelliMergeType detect)
        {
            if (AssociatedFile != null)
            {
                AssociatedFile.IntelliMerge = detect;

                if (Status == ProjectFileStatusEnum.AnalysedFile)
                {
                    Status = ProjectFileStatusEnum.UnAnalysedFile;
                }
            }

            foreach (ProjectFileTreeNode child in ChildNodes)
            {
                child.SetIntelliMergeOnSelfAndAllChildrenInternal(detect);
            }
        }
        protected void SetIntelliMergeOnSelfAndAllChildrenInternal(IntelliMergeType detect)
        {
            if (AssociatedFile != null)
            {
                AssociatedFile.IntelliMerge = detect;

                if (Status == ProjectFileStatusEnum.AnalysedFile)
                {
                    Status = ProjectFileStatusEnum.UnAnalysedFile;
                }
            }

            foreach (ProjectFileTreeNode child in ChildNodes)
            {
                child.SetIntelliMergeOnSelfAndAllChildrenInternal(detect);
            }
        }
        public void SetIntelliMergeOnSelfAndAllChildren(IntelliMergeType detect)
        {
            SetIntelliMergeOnSelfAndAllChildrenInternal(detect);

            ParentTree.RaiseTreeNeedsAnalysisEvent();
        }
 public static string ShortName(IntelliMergeType type)
 {
     return _ShortNamesDic[type];
 }
 /// <summary>
 /// Gets the description for the given IntelliMergeType enum value.
 /// </summary>
 /// <param name="type"></param>
 /// <returns></returns>
 public static string GetIntelliMergeTypeDescription(IntelliMergeType type)
 {
     if (!intellimergeToDescription.ContainsKey(type))
     {
         intellimergeToDescription[type] = Utility.GetDescription(type);
         descriptionToIntellimerge[intellimergeToDescription[type]] = type;
     }
     return intellimergeToDescription[type];
 }
Exemple #10
0
        public void LoadCheckedStatusFromXml(XmlDocument xmlDocument)
        {
            XmlNodeList nodes = xmlDocument.GetElementsByTagName("Options");

            if (nodes.Count != 1)
            {
                throw new ArgumentException("The given XmlDocument is not a valid CheckedStatus file.");
            }

            XmlElement rootNode = nodes[0] as XmlElement;

            if (rootNode == null)
            {
                throw new ArgumentException("The given XmlDocument is not a valid CheckedStatus file.");
            }

            nodes = rootNode.GetElementsByTagName("CheckedFiles");
            if (nodes.Count != 1)
            {
                throw new ArgumentException("The given XmlDocument is not a valid CheckedStatus file.");
            }

            XmlElement checkedFilesNode = nodes[0] as XmlElement;

            if (checkedFilesNode == null)
            {
                throw new ArgumentException("The given XmlDocument is not a valid CheckedStatus file.");
            }

            nodes = checkedFilesNode.GetElementsByTagName("File");

            TreeRestructuring = true;

            foreach (XmlNode node in nodes)
            {
                string relativePath = node.InnerText;

                ProjectFileTreeNode treeNode = GetNodeAtPath(relativePath);
                if (treeNode == null)
                {
                    continue;
                }

                bool checkedStatus;
                try
                {
                    checkedStatus = bool.Parse(node.Attributes["checked"].Value);
                }
                catch
                {
                    checkedStatus = true;
                }
                treeNode.SetSingleNodeSelected(checkedStatus);

                if (treeNode.AssociatedFile == null)
                {
                    continue;
                }

                if (node.Attributes["intellimerge"] != null)
                {
                    if (rootNode.Attributes["version"] == null)
                    {
                        bool overwriteStatus;
                        try
                        {
                            overwriteStatus = bool.Parse(node.Attributes["intellimerge"].Value);
                        }
                        catch
                        {
                            overwriteStatus = true;
                        }

                        treeNode.AssociatedFile.IntelliMerge = overwriteStatus
                                                                                                                                ? IntelliMergeType.Overwrite
                                                                                                                                : IntelliMergeType.AutoDetect;
                    }
                    else
                    {
                        int version = int.Parse(rootNode.Attributes["version"].Value);

                        if (version == 1 && node.Attributes["intellimerge"] != null)
                        {
                            IntelliMergeType mergeType =
                                (IntelliMergeType)Enum.Parse(typeof(IntelliMergeType), node.Attributes["intellimerge"].Value, true);
                            treeNode.AssociatedFile.IntelliMerge = mergeType;
                        }
                    }
                }
            }

            TreeRestructuring = false;
        }
Exemple #11
0
        public void SetIntelliMergeOnSelfAndAllChildren(IntelliMergeType detect)
        {
            SetIntelliMergeOnSelfAndAllChildrenInternal(detect);

            ParentTree.RaiseTreeNeedsAnalysisEvent();
        }
 public static string ShortName(IntelliMergeType type)
 {
     return(_ShortNamesDic[type]);
 }