コード例 #1
0
        /// <summary>
        /// remove 'tag' attribute from all nodes
        /// </summary>
        /// <param name="tag"></param>
        public void removetag(string tag)
        {
            System.Xml.XmlNodeList         nodes = GetNodesItem().ChildNodes;
            System.Collections.IEnumerator ie    = nodes.GetEnumerator();

            while (ie.MoveNext())
            {
                System.Xml.XmlNode node = (System.Xml.XmlNode)ie.Current;
                SetAttributeByName(node, tag, "");
            }
        }
コード例 #2
0
        static StackObject *GetEnumerator_0(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject *ptr_of_this_method;
            StackObject *__ret = ILIntepreter.Minus(__esp, 1);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            System.Xml.XmlNodeList instance_of_this_method = (System.Xml.XmlNodeList) typeof(System.Xml.XmlNodeList).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags) 0);
            __intp.Free(ptr_of_this_method);

            var result_of_this_method = instance_of_this_method.GetEnumerator();

            return(ILIntepreter.PushObject(__ret, __mStack, result_of_this_method));
        }
コード例 #3
0
        static StackObject *GetEnumerator_0(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject *ptr_of_this_method;
            StackObject *__ret = ILIntepreter.Minus(__esp, 1);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            System.Xml.XmlNodeList instance_of_this_method = (System.Xml.XmlNodeList) typeof(System.Xml.XmlNodeList).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);

            var result_of_this_method = instance_of_this_method.GetEnumerator();

            object obj_result_of_this_method = result_of_this_method;

            if (obj_result_of_this_method is CrossBindingAdaptorType)
            {
                return(ILIntepreter.PushObject(__ret, __mStack, ((CrossBindingAdaptorType)obj_result_of_this_method).ILInstance));
            }
            return(ILIntepreter.PushObject(__ret, __mStack, result_of_this_method));
        }
コード例 #4
0
ファイル: War.cs プロジェクト: Chukanof/CapeOpen
 private void AddData(String XmlData)
 {
     System.Xml.XmlDocument document = new System.Xml.XmlDocument();
     document.LoadXml(XmlData);
     System.Xml.XmlNodeList         list  = document.SelectNodes("dataroot/data");
     System.Collections.IEnumerator ienum = list.GetEnumerator();
     while (ienum.MoveNext())
     {
         System.Xml.XmlNode  current = (System.Xml.XmlNode)ienum.Current;
         System.Data.DataRow dataRow = warDataTable.NewRow();
         warDataTable.Rows.Add(dataRow);
         System.Collections.IEnumerator childEnum = current.ChildNodes.GetEnumerator();
         while (childEnum.MoveNext())
         {
             System.Xml.XmlNode currentChild = (System.Xml.XmlNode)childEnum.Current;
             if (currentChild.Name == "Mol_ID")
             {
                 String value = currentChild.InnerText;
                 while (value.StartsWith(" "))
                 {
                     value = value.Substring(1);
                 }
                 while (value.EndsWith(" "))
                 {
                     value = value.Remove(value.Length - 1);
                 }
                 dataRow["Mol Id"] = value;
             }
             if (currentChild.Name == "DIPPR ID")
             {
                 String value = currentChild.InnerText;
                 while (value.StartsWith(" "))
                 {
                     value = value.Substring(1);
                 }
                 while (value.EndsWith(" "))
                 {
                     value = value.Remove(value.Length - 1);
                 }
                 dataRow["DIPPR ID"] = value;
             }
             if (currentChild.Name == "ASPENID")
             {
                 String value = currentChild.InnerText;
                 while (value.StartsWith(" "))
                 {
                     value = value.Substring(1);
                 }
                 while (value.EndsWith(" "))
                 {
                     value = value.Remove(value.Length - 1);
                 }
                 dataRow["ASPENID"] = value;
             }
             if (currentChild.Name == "ChemicalName")
             {
                 String value = currentChild.InnerText;
                 while (value.StartsWith(" "))
                 {
                     value = value.Substring(1);
                 }
                 while (value.EndsWith(" "))
                 {
                     value = value.Remove(value.Length - 1);
                 }
                 dataRow["ChemicalName"] = value;
             }
             if (currentChild.Name == "CAS")
             {
                 String value = currentChild.InnerText;
                 while (value.StartsWith(" "))
                 {
                     value = value.Substring(1);
                 }
                 while (value.EndsWith(" "))
                 {
                     value = value.Remove(value.Length - 1);
                 }
                 dataRow["CAS"] = value;
             }
             if (currentChild.Name == "Formula")
             {
                 String value = currentChild.InnerText;
                 while (value.StartsWith(" "))
                 {
                     value = value.Substring(1);
                 }
                 while (value.EndsWith(" "))
                 {
                     value = value.Remove(value.Length - 1);
                 }
                 dataRow["Formula"] = value;
             }
             if (currentChild.Name == "CLASS")
             {
                 String value = currentChild.InnerText;
                 while (value.StartsWith(" "))
                 {
                     value = value.Substring(1);
                 }
                 while (value.EndsWith(" "))
                 {
                     value = value.Remove(value.Length - 1);
                 }
                 dataRow["class"] = value;
             }
             if (currentChild.Name == "MW")
             {
                 dataRow["molecularWeight"] = Convert.ToDouble(currentChild.InnerText);
             }
             if (currentChild.Name == "Rat_LD50_Value")
             {
                 dataRow["Rat LD50"] = Convert.ToDouble(currentChild.InnerText);
             }
             if (currentChild.Name == "Rat_LD50_Notes")
             {
                 String value = currentChild.InnerText;
                 while (value.StartsWith(" "))
                 {
                     value = value.Substring(1);
                 }
                 while (value.EndsWith(" "))
                 {
                     value = value.Remove(value.Length - 1);
                 }
                 dataRow["Rat LD50 Notes"] = value;
             }
             if (currentChild.Name == "Rat_LD50_Source")
             {
                 String value = currentChild.InnerText;
                 while (value.StartsWith(" "))
                 {
                     value = value.Substring(1);
                 }
                 while (value.EndsWith(" "))
                 {
                     value = value.Remove(value.Length - 1);
                 }
                 dataRow["Rat LD50 Source"] = value;
             }
             if (currentChild.Name == "OSHA_TWA_Value")
             {
                 dataRow["OSHA PEL"] = Convert.ToDouble(currentChild.InnerText);
             }
             if (currentChild.Name == "OSHA_TWA_Source")
             {
                 String value = currentChild.InnerText;
                 while (value.StartsWith(" "))
                 {
                     value = value.Substring(1);
                 }
                 while (value.EndsWith(" "))
                 {
                     value = value.Remove(value.Length - 1);
                 }
                 dataRow["OSHA Source"] = value;
             }
             if (currentChild.Name == "OSHA_TWA_Notes")
             {
                 String value = currentChild.InnerText;
                 while (value.StartsWith(" "))
                 {
                     value = value.Substring(1);
                 }
                 while (value.EndsWith(" "))
                 {
                     value = value.Remove(value.Length - 1);
                 }
                 dataRow["OSHA Notes"] = value;
             }
             if (currentChild.Name == "FHM_LC50_Value")
             {
                 dataRow["Fathead LC50"] = Convert.ToDouble(currentChild.InnerText);
             }
             if (currentChild.Name == "FHM_LC50_Notes")
             {
                 String value = currentChild.InnerText;
                 while (value.StartsWith(" "))
                 {
                     value = value.Substring(1);
                 }
                 while (value.EndsWith(" "))
                 {
                     value = value.Remove(value.Length - 1);
                 }
                 dataRow["Fathead LC50 Notes"] = value;
             }
             if (currentChild.Name == "FHM_LC50_Source")
             {
                 String value = currentChild.InnerText;
                 while (value.StartsWith(" "))
                 {
                     value = value.Substring(1);
                 }
                 while (value.EndsWith(" "))
                 {
                     value = value.Remove(value.Length - 1);
                 }
                 dataRow["Fathead LC50 Source"] = value;
             }
             if (currentChild.Name == "PCO_Value")
             {
                 dataRow["Photochemical Oxidation Potential"] = Convert.ToDouble(currentChild.InnerText);
             }
             if (currentChild.Name == "PCO_Source")
             {
                 String value = currentChild.InnerText;
                 while (value.StartsWith(" "))
                 {
                     value = value.Substring(1);
                 }
                 while (value.EndsWith(" "))
                 {
                     value = value.Remove(value.Length - 1);
                 }
                 dataRow["Photochemical Oxidation Potential Source"] = value;
             }
             if (currentChild.Name == "GWP_Value")
             {
                 dataRow["Global Warming Potential"] = Convert.ToDouble(currentChild.InnerText);
             }
             if (currentChild.Name == "GWP_Source")
             {
                 String value = currentChild.InnerText;
                 while (value.StartsWith(" "))
                 {
                     value = value.Substring(1);
                 }
                 while (value.EndsWith(" "))
                 {
                     value = value.Remove(value.Length - 1);
                 }
                 dataRow["Global Warming Potential Source"] = value;
             }
             if (currentChild.Name == "OD_Value")
             {
                 dataRow["Ozone Depletion Potential"] = Convert.ToDouble(currentChild.InnerText);
             }
             if (currentChild.Name == "OD_Source")
             {
                 String value = currentChild.InnerText;
                 while (value.StartsWith(" "))
                 {
                     value = value.Substring(1);
                 }
                 while (value.EndsWith(" "))
                 {
                     value = value.Remove(value.Length - 1);
                 }
                 dataRow["Ozone Depletion Potential Source"] = value;
             }
             if (currentChild.Name == "AP_Value")
             {
                 dataRow["Acidification Potential"] = Convert.ToDouble(currentChild.InnerText);
             }
             if (currentChild.Name == "AP_Source")
             {
                 String value = currentChild.InnerText;
                 while (value.StartsWith(" "))
                 {
                     value = value.Substring(1);
                 }
                 while (value.EndsWith(" "))
                 {
                     value = value.Remove(value.Length - 1);
                 }
                 dataRow["Acidification Potential Source"] = value;
             }
         }
     }
 }