當前位置: 首頁>>代碼示例>>C#>>正文


C# XmlElement.GetAttributeInt方法代碼示例

本文整理匯總了C#中System.Xml.XmlElement.GetAttributeInt方法的典型用法代碼示例。如果您正苦於以下問題:C# XmlElement.GetAttributeInt方法的具體用法?C# XmlElement.GetAttributeInt怎麽用?C# XmlElement.GetAttributeInt使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在System.Xml.XmlElement的用法示例。


在下文中一共展示了XmlElement.GetAttributeInt方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: GuardSpawner

 public GuardSpawner(Model m, XmlElement e)
     : base(m, e)
 {
     NumGuards = e.GetAttributeInt("numguards", 2);
     MaxGuards = e.GetAttributeInt("maxguards", 2);
     RespawnRate = e.GetAttributeFloat("respawnrate", 0);
 }
開發者ID:chrisforbes,項目名稱:aliengame,代碼行數:7,代碼來源:GuardSpawner.cs

示例2: Actor

 protected Actor(Model m, XmlElement e)
 {
     this.m = m;
     Position = new Point(e.GetAttributeInt("x", 0),
                          e.GetAttributeInt("y", 0));
     Direction = e.GetAttributeInt("dir", 0);
     Name = e.GetAttribute("name");
 }
開發者ID:chrisforbes,項目名稱:aliengame,代碼行數:8,代碼來源:Actor.cs

示例3: Brush

        public Brush(XmlElement e)
        {
            Bounds = Rectangle.FromLTRB(
                e.GetAttributeInt("left", 0),
                e.GetAttributeInt("top", 0),
                e.GetAttributeInt("right", 0),
                e.GetAttributeInt("bottom", 0));

            Content = e.GetAttributeInt("content", 0);
        }
開發者ID:chrisforbes,項目名稱:aliengame,代碼行數:10,代碼來源:Brush.cs

示例4: Load

// メソッド

		public void Load(HatomaruManager manager, XmlElement contentElement){
			string path = contentElement.GetAttribute(HatomaruReputation.UriAttributeName);
			Path = new AbsPath(path);
			Count = contentElement.GetAttributeInt(HatomaruReputation.CountAttributeName);
			Description = contentElement[HatomaruReputation.DescriptionElementName];

			Title = manager.GetResponseTitle(Path);

		}
開發者ID:bakera,項目名稱:Hatomaru.dll,代碼行數:11,代碼來源:reputationContent.cs

示例5: LoadXml

// パブリックメソッド

		public void LoadXml(XmlElement e){
			Name = e.GetAttributeValue(ExtInfoName);
			ContentType = e.GetAttributeValue(ExtInfoType);
			Charset = e.GetAttributeValue(ExtInfoCharset);
			Description = e.InnerText;

			string tempDisposition = e.GetAttributeValue(ExtInfoDisposition);
			if(!string.IsNullOrEmpty(tempDisposition)) Disposition = true;

			int maxAgeDays = e.GetAttributeInt(ExtInfoMaxAge);
			MaxAge = new TimeSpan(maxAgeDays, 0, 0, 0);
		}
開發者ID:bakera,項目名稱:Hatomaru.dll,代碼行數:14,代碼來源:extinfo.cs

示例6: LoadTradeSettings

        public void LoadTradeSettings(XmlElement node)
        {
            if (node == null) return;
            var tradeAuto = node.GetAttributeBool("tradeAuto");
            if (tradeAuto.HasValue)
                TradeAuto = tradeAuto.Value;

            MaxLeverage = node.GetAttributeDouble("maxLeverage");
            PercentLeverage = node.GetAttributeInt("percentLeverage") ?? 100;
            HedgingOrdersEnabled = node.GetAttributeBool("hedgingOrdersEnabled");
            FixedVolume = node.GetAttributeInt("fixedVolume");
            if (node.Attributes["volumeRound"] != null)
            {
                VolumeRoundType volRnd;
                VolumeRound = Enum.TryParse(node.Attributes["volumeRound"].Value, out volRnd)
                                  ? volRnd
                                  : (VolumeRoundType?)null;
            }
            MinVolume = node.GetAttributeInt("minVolume");
            MaxVolume = node.GetAttributeInt("maxVolume");
            StepVolume = node.GetAttributeInt("stepVolume");
            TargetAccount = node.GetAttributeInt("targetAccount");
        }
開發者ID:johnmensen,項目名稱:TradeSharp,代碼行數:23,代碼來源:AutoTradeSettings.cs

示例7: Door

 public Door(XmlElement e)
 {
     Position = new Point(e.GetAttributeInt("x", 0), e.GetAttributeInt("y", 0));
     Kind = e.GetAttributeInt("kind", 0);
     State = e.GetAttributeInt("state", 0);
 }
開發者ID:chrisforbes,項目名稱:aliengame,代碼行數:6,代碼來源:Door.cs


注:本文中的System.Xml.XmlElement.GetAttributeInt方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。