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


C# XmlData.GetAttributeValue方法代码示例

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


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

示例1: AssertBasicContentMetaData

 private static void AssertBasicContentMetaData(XmlData xmlMetaData, ContentMetaData metaData)
 {
     AssertMinimumContentMetaData(xmlMetaData, metaData.Name, metaData.Type.ToString(),
         metaData.LastTimeUpdated);
     Assert.AreEqual(metaData.LocalFilePath, xmlMetaData.GetAttributeValue("LocalFilePath"));
     Assert.AreEqual(metaData.FileSize.ToString(), xmlMetaData.GetAttributeValue("FileSize"));
 }
开发者ID:remy22,项目名称:DeltaEngine,代码行数:7,代码来源:XmlMetaDataExtensionsTests.cs

示例2: AssertMinimumContentMetaData

		private static void AssertMinimumContentMetaData(XmlData xmlMetaData,
			string nameAttributeValue, string typeAttributeValue, DateTime lastUpdatedAttributeValue)
		{
			Assert.AreEqual("ContentMetaData", xmlMetaData.Name);
			Assert.AreEqual(nameAttributeValue, xmlMetaData.GetAttributeValue("Name"));
			Assert.AreEqual(typeAttributeValue, xmlMetaData.GetAttributeValue("Type"));
			Assert.AreEqual(lastUpdatedAttributeValue.GetIsoDateTime(),
				xmlMetaData.GetAttributeValue("LastTimeUpdated"));
		}
开发者ID:whztt07,项目名称:DeltaEngine,代码行数:9,代码来源:XmlMetaDataExtensionsTests.cs

示例3: LoadKerning

		//ncrunch: no coverage start
		public void LoadKerning(XmlData kerningData)
		{
			char firstChar = kerningData.GetAttributeValue("First", '\0');
			char secondChar = kerningData.GetAttributeValue("Second", '\0');
			int kerningDistance = kerningData.GetAttributeValue("Distance", 0);
			if (firstChar == '\0' || secondChar == '\0' || kerningDistance == 0)
				throw new InvalidDataException("Unable to add kerning " + firstChar + " and " + secondChar +
					" with distance=" + kerningDistance);
			Glyph glyph;
			if (GlyphDictionary.TryGetValue(firstChar, out glyph))
				glyph.Kernings.Add(secondChar, kerningDistance);
		} //ncrunch: no coverage end
开发者ID:whztt07,项目名称:DeltaEngine,代码行数:13,代码来源:FontDescription.cs

示例4: LoadGlyph

		private void LoadGlyph(XmlData glyphData, Size fontMapSize)
		{
			char character = glyphData.GetAttributeValue("Character", ' ');
			var glyph = new Glyph
			{
				UV = new Rectangle(glyphData.GetAttributeValue("UV")),
				LeftSideBearing = glyphData.GetAttributeValue("LeftBearing", 0.0f),
				RightSideBearing = glyphData.GetAttributeValue("RightBearing", 0.0f)
			};
			glyph.AdvanceWidth = glyphData.GetAttributeValue("AdvanceWidth", glyph.UV.Width - 2.0f);
			glyph.PrecomputedFontMapUV = Rectangle.BuildUVRectangle(glyph.UV, fontMapSize);
			GlyphDictionary.Add(character, glyph);
		}
开发者ID:whztt07,项目名称:DeltaEngine,代码行数:13,代码来源:FontDescription.cs

示例5: GetAppGuid

 private static Guid GetAppGuid(XmlData appInfoData)
 {
     string appGuidString = appInfoData.GetAttributeValue(XmlAttributeNameOfAppGuid);
     if (String.IsNullOrEmpty(appGuidString))
         throw new AppInfoDataMissing(XmlAttributeNameOfAppGuid);
     return new Guid(appGuidString);
 }
开发者ID:remy22,项目名称:DeltaEngine,代码行数:7,代码来源:AppsStorage.cs

示例6: GetAppPackageFilePath

		private string GetAppPackageFilePath(XmlData appInfoData)
		{
			string fileName = appInfoData.GetAttributeValue(XmlAttributeNameOfFileName);
			if (String.IsNullOrEmpty(fileName))
				throw new AppInfoDataMissing(XmlAttributeNameOfFileName); // ncrunch: no coverage
			return Path.Combine(StorageDirectory, fileName);
		}
开发者ID:whztt07,项目名称:DeltaEngine,代码行数:7,代码来源:AppsStorage.cs

示例7: GetAppBuildData

 private static DateTime GetAppBuildData(XmlData appInfoData)
 {
     var noBuildDate = DateTime.MinValue;
     DateTime buildDate = appInfoData.GetAttributeValue(XmlAttributeNameOfBuildDate, noBuildDate);
     if (buildDate == noBuildDate)
         throw new AppInfoDataMissing(XmlAttributeNameOfBuildDate);
     return buildDate;
 }
开发者ID:remy22,项目名称:DeltaEngine,代码行数:8,代码来源:AppsStorage.cs

示例8: AssertFullContentMetaDataEntry

 private static void AssertFullContentMetaDataEntry(XmlData xmlMetaData,
     ContentMetaData metaData)
 {
     AssertBasicContentMetaData(xmlMetaData, metaData);
     AssertLanguageInMetaData(xmlMetaData, metaData);
     AssertPlatformFileIdInMetaData(xmlMetaData, metaData);
     foreach (KeyValuePair<string, string> valuePair in metaData.Values)
         Assert.AreEqual(metaData.Values[valuePair.Key],
             xmlMetaData.GetAttributeValue(valuePair.Key));
 }
开发者ID:remy22,项目名称:DeltaEngine,代码行数:10,代码来源:XmlMetaDataExtensionsTests.cs

示例9: ParseData

		protected override AgentData ParseData(XmlData tower)
		{
			return
				new TowerData((TowerType)Enum.Parse(typeof(TowerType), tower.GetAttributeValue("Type")),
					tower.GetAttributeValue("Name"),
					(AttackType)Enum.Parse(typeof(AttackType), tower.GetAttributeValue("AttackType")),
					tower.GetAttributeValue("Range", 0.0f), tower.GetAttributeValue("AttackFrequency", 0.0f),
					tower.GetAttributeValue("AttackDamage", 0.0f), tower.GetAttributeValue("Cost", 0));
		}
开发者ID:whztt07,项目名称:DeltaEngine,代码行数:9,代码来源:TowerPropertiesXml.cs

示例10: ParseData

		protected override AgentData ParseData(XmlData boss)
		{
			return new BossData((BossType)Enum.Parse(typeof(BossType), boss.GetAttributeValue("Type")),
				boss.GetAttributeValue("Name"), boss.GetAttributeValue("MaxHp", 0.0f),
				boss.GetAttributeValue("Speed", 0.0f), boss.GetAttributeValue("Resistance", 0.0f),
				boss.GetAttributeValue("Gold", 0), ParseTypeDamageModifier(boss));
		}
开发者ID:whztt07,项目名称:DeltaEngine,代码行数:7,代码来源:BossPropertiesXml.cs

示例11: ParseData

		protected override AgentData ParseData(XmlData creep)
		{
			return
				new CreepData((CreepType)Enum.Parse(typeof(CreepType), creep.GetAttributeValue("Type")),
					creep.GetAttributeValue("Name"), creep.GetAttributeValue("MaxHp", 0.0f),
					creep.GetAttributeValue("Speed", 0.0f), creep.GetAttributeValue("Resistance", 0.0f),
					creep.GetAttributeValue("Gold", 0), ParseTypeDamageModifier(creep));
		}
开发者ID:whztt07,项目名称:DeltaEngine,代码行数:8,代码来源:CreepPropertiesXml.cs

示例12: AssertPlatformFileIdInMetaData

 private static void AssertPlatformFileIdInMetaData(XmlData xmlMetaData, ContentMetaData metaData)
 {
     if (metaData.PlatformFileId == 0)
         Assert.IsFalse(IsAttributeAvailable(xmlMetaData, "PlatformFileId"));
     else
         Assert.AreEqual(metaData.PlatformFileId.ToString(),
             xmlMetaData.GetAttributeValue("PlatformFileId"));
 }
开发者ID:remy22,项目名称:DeltaEngine,代码行数:8,代码来源:XmlMetaDataExtensionsTests.cs

示例13: UpdateExistingAttributeWithSameValue

		public void UpdateExistingAttributeWithSameValue()
		{
			var root = new XmlData("root");
			root.AddAttribute("number", "123");
			root.UpdateAttribute("number", "123");
			Assert.AreEqual("123", root.GetAttributeValue("number"));
		}
开发者ID:whztt07,项目名称:DeltaEngine,代码行数:7,代码来源:XmlDataTests.cs

示例14: UpdateNonExistingAttribute

		public void UpdateNonExistingAttribute()
		{
			var root = new XmlData("root");
			root.UpdateAttribute("number", "312");
			Assert.AreEqual("312", root.GetAttributeValue("number"));
		}
开发者ID:whztt07,项目名称:DeltaEngine,代码行数:6,代码来源:XmlDataTests.cs

示例15: GetAttributeValueAsInteger

		public void GetAttributeValueAsInteger()
		{
			var root = new XmlData("root");
			root.AddAttribute("number", "123");
			Assert.AreEqual(123, root.GetAttributeValue("number", 0));
			Assert.AreEqual("", root.GetAttributeValue("nonexistant", ""));
		}
开发者ID:whztt07,项目名称:DeltaEngine,代码行数:7,代码来源:XmlDataTests.cs


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