当前位置: 首页>>代码示例>>C#>>正文


C# XmlReader.MoveToAttribute方法代码示例

本文整理汇总了C#中System.Xml.XmlReader.MoveToAttribute方法的典型用法代码示例。如果您正苦于以下问题:C# XmlReader.MoveToAttribute方法的具体用法?C# XmlReader.MoveToAttribute怎么用?C# XmlReader.MoveToAttribute使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Xml.XmlReader的用法示例。


在下文中一共展示了XmlReader.MoveToAttribute方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: read_microservices_client_details

        private static void read_microservices_client_details(XmlReader readerXml, MicroservicesClient_Configuration config, string SystemBaseUrl)
        {
            // Just step through the subtree of this
            while (readerXml.Read())
            {
                if (readerXml.NodeType == XmlNodeType.Element)
                {
                    switch (readerXml.Name.ToLower())
                    {
                        case "add":
                            string key = String.Empty;
                            string url = String.Empty;
                            string protocol = "JSON";
                            if (readerXml.MoveToAttribute("Key"))
                                key = readerXml.Value;
                            if (readerXml.MoveToAttribute("URL"))
                                url = readerXml.Value.Replace("[BASEURL]", SystemBaseUrl);
                            if (readerXml.MoveToAttribute("Protocol"))
                                protocol = readerXml.Value;

                            if (( !String.IsNullOrEmpty(key)) && ( !String.IsNullOrEmpty(url)))
                                config.Add_Endpoint(key, url, protocol);
                            break;
                    }
                }
            }
        }
开发者ID:Elkolt,项目名称:SobekCM-Web-Application,代码行数:27,代码来源:MicroservicesClient_Config_Reader.cs

示例2: ReadLog

 public void ReadLog(XmlReader reader)
 {
     while (reader.Read() && reader.NodeType != XmlNodeType.EndElement)
     {
         Dictionary<string, string> attributes = new Dictionary<string, string>();
         if (reader.Name == "ME")
         {
             if (reader.HasAttributes)
             {
                 for (int i = 0; i < reader.AttributeCount; i++)
                 {
                     reader.MoveToAttribute(i);
                     attributes.Add(reader.Name, reader.Value);
                 }
             }
             MouseEvent e = new MouseEvent(attributes);
             Evnts.AddLast(e);
             //do shit here
         }
         else if (reader.Name == "Clickthrough")
         {
                 if (reader.HasAttributes)
                 {
                     for (int i = 0; i < reader.AttributeCount; i++)
                     {
                         reader.MoveToAttribute(i);
                         attributes.Add(reader.Name, reader.Value);
                     }
                 }
             Clickthrough c = new Clickthrough(attributes);
             c.ReadLog(reader);
             Evnts.AddLast(c);
         }
     }
 }
开发者ID:ajansen7,项目名称:Pointing-Magnifier,代码行数:35,代码来源:Events.cs

示例3: Mass

  public Mass(Model model, XmlReader xml) : base(model,xml) {//throws Exception {
    //super(model, xml);
      //foreach(XmlAttribute attribute in xml.Attributes)
      //{
          //string key = attribute.Name;
      if (xml.MoveToAttribute("VX".ToLower()))
      {
        velocityX = double.Parse(xml.ReadContentAsString());
      }
      if (xml.MoveToAttribute("VY".ToLower()))
      {
          velocityY = double.Parse(xml.ReadContentAsString());
      }



      //}
    //Enumeration enum = xml.enumerateAttributeNames();
    //while (enum.hasMoreElements()) {
    //  String key = enum.nextElement().toString();
    //  if (key.equals("VX")) {
    //    velocityX = xml.getDoubleAttribute(key);
    //  }
    //  if (key.equals("VY")) {
    //    velocityY = xml.getDoubleAttribute(key);
    //  }
    //}
  }
开发者ID:OptimusLime,项目名称:MINS.js,代码行数:28,代码来源:Mass.cs

示例4: ReadAscii

        private static void ReadAscii(XmlReader reader, string name, uint offset, bool visible, IPluginVisitor visitor, uint pluginLine)
        {
            int size = 0;

            if (reader.MoveToAttribute("size") || reader.MoveToAttribute("length"))
                size = ParseInt(reader.Value);

            visitor.VisitAscii(name, offset, visible, size, pluginLine);
        }
开发者ID:iBotPeaches,项目名称:Assembly,代码行数:9,代码来源:UniversalPluginLoader.cs

示例5: MarkerModel

 public MarkerModel(XmlReader reader, Set set)
 {
     reader.MoveToAttribute("name");
     name = reader.Value;
     reader.MoveToAttribute("id");
     id = new Guid(reader.Value);
     reader.Read();  // <marker />
     this.set = set;
 }
开发者ID:kellyelton,项目名称:octgnwlobby,代码行数:9,代码来源:MarkerModel.cs

示例6: DeserializeElement

		protected override void DeserializeElement(XmlReader reader, bool serializeCollectionKey)
		{
			reader.MoveToAttribute("name");
			Name = reader.Value;

			ConnectionStringName = reader.MoveToAttribute("connectionStringName") ? reader.Value : null;

			while (reader.Read())
			{
				if (reader.NodeType == XmlNodeType.EndElement) break;
				if (reader.NodeType == XmlNodeType.CDATA) Select = reader.Value;
			}
		}
开发者ID:haoasqui,项目名称:ONLYOFFICE-Server,代码行数:13,代码来源:TextIndexCfgModuleElement.cs

示例7: BuildClassEntry

        private static ClassEntry BuildClassEntry(XmlReader xmlReader, string fileName, string assemblyName, string @namespace, Assembly assembly)
		{
			xmlReader.MoveToAttribute("name");
			string className = xmlReader.Value;

			string extends = null;
			if (xmlReader.MoveToAttribute("extends"))
			{
				extends = xmlReader.Value;
			}

			return new ClassEntry(extends, className, assemblyName, @namespace, fileName, assembly);
		}
开发者ID:nhannd,项目名称:Xian,代码行数:13,代码来源:AssembliesHbmOrderer.cs

示例8: Load

		public void Load (XmlReader x)
		{
			if(x.MoveToAttribute("ShowParameters"))
				ShowFuncParams = Boolean.Parse(x.ReadContentAsString());
			if(x.MoveToAttribute("ShowVariables"))
				ShowFuncVariables = Boolean.Parse(x.ReadContentAsString());
			if(x.MoveToAttribute("ShowTypes"))
				ShowBaseTypes = Boolean.Parse(x.ReadContentAsString());
			if(x.MoveToAttribute("GrayOutNonPublic"))
				GrayOutNonPublic = Boolean.Parse(x.ReadContentAsString());
			if(x.MoveToAttribute("ExpansionBehaviour"))
				Enum.TryParse(x.ReadContentAsString(),out ExpansionBehaviour);
		}
开发者ID:DinrusGroup,项目名称:Mono-D,代码行数:13,代码来源:DCompilerService.cs

示例9: load

 public static Firewall load(XmlReader reader)
 {
     while (reader.Name != "firewall")
         reader.Read();
     var complexity = 0;
     string solution = null;
     var additionalTime = 0.0f;
     if (reader.MoveToAttribute("complexity"))
         complexity = reader.ReadContentAsInt();
     if (reader.MoveToAttribute("solution"))
         solution = reader.ReadContentAsString();
     if (reader.MoveToAttribute("additionalDelay"))
         additionalTime = reader.ReadContentAsFloat();
     return new Firewall(complexity, solution, additionalTime);
 }
开发者ID:strangea,项目名称:OpenHacknet,代码行数:15,代码来源:Firewall.cs

示例10: loadUserDetail

 public static UserDetail loadUserDetail(XmlReader reader)
 {
     reader.MoveToAttribute("name");
     var user = reader.ReadContentAsString();
     reader.MoveToAttribute("pass");
     var password = reader.ReadContentAsString();
     reader.MoveToAttribute("type");
     var accountType = (byte) reader.ReadContentAsInt();
     reader.MoveToAttribute("known");
     var flag = reader.ReadContentAsString().ToLower().Equals("true");
     return new UserDetail(user, password, accountType)
     {
         known = flag
     };
 }
开发者ID:strangea,项目名称:OpenHacknet,代码行数:15,代码来源:UserDetail.cs

示例11: Restore

        public void Restore(XmlReader reader)
        {
            int count = reader.AttributeCount;
            for (int i = 0; i < count; ++i)
            {
                reader.MoveToAttribute(i);
                switch (reader.Name)
                {
                    case "top":
                        Top = reader.ReadContentAsDouble();
                        break;

                    case "left":
                        Left = reader.ReadContentAsDouble();
                        break;

                    case "width":
                        Width = reader.ReadContentAsDouble();
                        break;

                    case "height":
                        Height = reader.ReadContentAsDouble();
                        break;

                    case "state":
                        State = (WindowState) Enum.Parse(typeof (WindowState), reader.Value);
                        break;
                }
            }
        }
开发者ID:Kittyfisto,项目名称:Tailviewer,代码行数:30,代码来源:WindowSettings.cs

示例12: HeightfieldTerrainGenerator

        public HeightfieldTerrainGenerator(XmlReader r)
        {
            for (int i = 0; i < r.AttributeCount; i++)
            {
                r.MoveToAttribute(i);
                switch (r.Name)
                {
                    case "Type":
                        string type = r.Value;
                        Debug.Assert(type == "HeightfieldMosaic");
                        break;
                    case "MosaicName":
                        heightfieldName = r.Value;
                        break;
                    case "PreloadRadius":
                        preloadRadius = int.Parse(r.Value);
                        break;
                    case "OutsideHeight":
                        outsideHeight = float.Parse(r.Value);
                        break;
                }
            }
            r.MoveToElement();
            if (!r.IsEmptyElement)
            {
                do
                {
                    r.Read();
                } while (r.NodeType != XmlNodeType.EndElement);
            }

            Mosaic = new HeightfieldMosaic(heightfieldName, preloadRadius, outsideHeight);
            Mosaic.MosaicModificationStateChanged += Mosaic_OnMosaicModificationStateChanged;
            Mosaic.MosaicChanged += Mosaic_OnMosaicChanged;
        }
开发者ID:ufosky-server,项目名称:MultiversePlatform,代码行数:35,代码来源:HeightfieldTerrainGenerator.cs

示例13: ReadXml

    public void ReadXml(XmlReader reader)
    {
      if (!reader.MoveToAttribute("State"))
        throw new ArgumentException("State attribute not present");

      InitFromString(reader.Value);
    }
开发者ID:davinx,项目名称:MediaPortal-2,代码行数:7,代码来源:ResumeStateBase.cs

示例14: ArgumentException

    void IXmlSerializable.ReadXml(XmlReader reader)
    {
      try
      {
        // First read attributes, then check for empty start element
        if (!reader.MoveToAttribute("Id"))
          throw new ArgumentException("Id attribute not present");
        _id = new Guid(reader.Value);
        if (reader.IsEmptyElement)
          return;
      }
      finally
      {
        reader.ReadStartElement();
      }

      _additionalProperties = reader.DeserializeXml<Dictionary>();
      _timeshiftContexes = reader.DeserializeXml<List<ITimeshiftContext>>();


      while (reader.NodeType != XmlNodeType.EndElement)
      {
        MediaItemAspect mia = MediaItemAspect.Deserialize(reader);
        _aspects[mia.Metadata.AspectId] = mia;
      }
      reader.ReadEndElement(); // MI
    }
开发者ID:chekiI,项目名称:MediaPortal-2,代码行数:27,代码来源:LiveTvMediaItem.cs

示例15: ParseQuaternion

        public static Quaternion ParseQuaternion(XmlReader r)
        {
            float w = 0;
            float x = 0;
            float y = 0;
            float z = 0;

            for (int i = 0; i < r.AttributeCount; i++)
            {
                r.MoveToAttribute(i);

                // set the field in this object based on the element we just read
                switch (r.Name)
                {

                    case "w":
                        w = float.Parse(r.Value);
                        break;
                    case "x":
                        x = float.Parse(r.Value);
                        break;
                    case "y":
                        y = float.Parse(r.Value);
                        break;
                    case "z":
                        z = float.Parse(r.Value);
                        break;
                }
            }
            r.MoveToElement(); //Moves the reader back to the element node.

            return new Quaternion(w, x, y, z);
        }
开发者ID:ufosky-server,项目名称:MultiversePlatform,代码行数:33,代码来源:XmlHelperClass.cs


注:本文中的System.Xml.XmlReader.MoveToAttribute方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。