コード例 #1
0
ファイル: AssemblyList.cs プロジェクト: pavkr/testcentric-gui
 public IEnumerator <string> GetEnumerator()
 {
     foreach (XmlNode node in AssemblyNodes)
     {
         yield return(XmlHelper.GetAttribute(node, "path"));
     }
 }
コード例 #2
0
        public string GetSettingsAttribute(string name)
        {
            if (SettingsNode == null)
            {
                return(null);
            }

            return(XmlHelper.GetAttribute(SettingsNode, name));
        }
コード例 #3
0
        private int IndexOf(string name)
        {
            for (int index = 0; index < project.ConfigNodes.Count; index++)
            {
                if (XmlHelper.GetAttribute(project.ConfigNodes[index], "name") == name)
                {
                    return(index);
                }
            }

            return(-1);
        }
コード例 #4
0
ファイル: AssemblyList.cs プロジェクト: pavkr/testcentric-gui
 public void Remove(string assemblyPath)
 {
     foreach (XmlNode node in configNode.SelectNodes("assembly"))
     {
         string path = XmlHelper.GetAttribute(node, "path");
         if (path == assemblyPath)
         {
             configNode.RemoveChild(node);
             break;
         }
     }
 }
コード例 #5
0
ファイル: XmlHelper.cs プロジェクト: stantoxt/nunitv2
        public static T GetAttributeAsEnum <T>(XmlNode node, string name, T defaultValue)
        {
            string attrVal = XmlHelper.GetAttribute(node, name);

            if (attrVal == null)
            {
                return(defaultValue);
            }

            if (typeof(T).IsEnum)
            {
                foreach (string s in Enum.GetNames(typeof(T)))
                {
                    if (s.Equals(attrVal, StringComparison.OrdinalIgnoreCase))
                    {
                        return((T)Enum.Parse(typeof(T), attrVal, true));
                    }
                }
            }

            throw new XmlException(
                      string.Format("Invalid attribute value: {0}", node.Attributes[name].OuterXml));
        }
コード例 #6
0
ファイル: ProjectConfig.cs プロジェクト: jnm2/testcentric-gui
 private string GetAttribute(string name)
 {
     return(XmlHelper.GetAttribute(configNode, name));
 }
コード例 #7
0
ファイル: AssemblyList.cs プロジェクト: pavkr/testcentric-gui
 public string this[int index]
 {
     get { return(XmlHelper.GetAttribute(AssemblyNodes[index], "path")); }
     set { XmlHelper.SetAttribute(AssemblyNodes[index], "path", value); }
 }