• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# XmlData类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: AutoAssign

 internal AutoAssign(XmlData dat)
     : base("autoId")
 {
     this.dat = dat;
     nextSignedId = GetValue<ushort>("nextSigned", "24576"); //0x6000
     nextFullId = GetValue<ushort>("nextFull", "32768");     //0x8000
 }
开发者ID:Jankos132,项目名称:Server-Source,代码行数:7,代码来源:XmlData.cs


示例2: CreateImageAndContentMetaData

		public static void CreateImageAndContentMetaData(string filePath, Size pixelSize,
			XmlData image)
		{
			CreateImage(filePath, pixelSize);
			image.AddAttribute("FileSize", new FileInfo(filePath).Length);
			image.AddAttribute("PixelSize", pixelSize.ToString());
		}
开发者ID:whztt07,项目名称:DeltaEngine,代码行数:7,代码来源:ContentDiskTestsExtensions.cs


示例3: 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


示例4: CreateMockCreepProperties

		private static Stream CreateMockCreepProperties()
		{
			var xmlData = new XmlData("CreepProperties");
			xmlData.AddChild(CreateTestCottonCreep());
			xmlData.AddChild(CreateTestGlassCreep());
			return new XmlFile(xmlData).ToMemoryStream();
		}
开发者ID:whztt07,项目名称:DeltaEngine,代码行数:7,代码来源:CreepyTowersMockContentLoader.cs


示例5: 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


示例6: 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


示例7: ParseTypeDamageModifier

		private static Dictionary<TowerType, float> ParseTypeDamageModifier(XmlData boss)
		{
			return
				boss.GetChild("Modifiers").Attributes.ToDictionary(
					attribute => (TowerType)Enum.Parse(typeof(TowerType), attribute.Name),
					attribute => attribute.Value.Convert<float>());
		}
开发者ID:whztt07,项目名称:DeltaEngine,代码行数:7,代码来源:BossPropertiesXml.cs


示例8: FontDescription

		public FontDescription(XmlData data)
		{
			this.data = data;
			GlyphDictionary = new Dictionary<char, Glyph>();
			LoadFromXmlData();
			converter = new TextConverter(GlyphDictionary, PixelLineHeight);
		}
开发者ID:whztt07,项目名称:DeltaEngine,代码行数:7,代码来源:FontDescription.cs


示例9: AddAttributeObject

 public void AddAttributeObject()
 {
     var root = new XmlData("root");
     root.AddAttribute("attribute", DayOfWeek.Friday);
     Assert.AreEqual(1, root.Attributes.Count);
     Assert.AreEqual(new XmlAttribute("attribute", "Friday"), root.Attributes[0]);
 }
开发者ID:remy22,项目名称:DeltaEngine,代码行数:7,代码来源:XmlDataTests.cs


示例10: AddAttribute

 public void AddAttribute()
 {
     var root = new XmlData("root");
     root.AddAttribute("attribute", "value");
     Assert.AreEqual(1, root.Attributes.Count);
     Assert.AreEqual(new XmlAttribute("attribute", "value"), root.Attributes[0]);
 }
开发者ID:hillwhite,项目名称:DeltaEngine,代码行数:7,代码来源:XmlDataTests.cs


示例11: TryLoadAppFromStorageData

		private void TryLoadAppFromStorageData(XmlData appInfoData)
		{
			AppInfo app = AppInfoExtensions.CreateAppInfo(GetAppPackageFilePath(appInfoData),
				GetAppPlatform(appInfoData), GetAppGuid(appInfoData), GetAppBuildData(appInfoData));
			app.SolutionFilePath = GetAppSolutionFilePath(appInfoData);
			availableApps.Add(app);
		}
开发者ID:whztt07,项目名称:DeltaEngine,代码行数:7,代码来源:AppsStorage.cs


示例12: CreateMockGroupProperties

		private static Stream CreateMockGroupProperties()
		{
			var xmlData = new XmlData("Groups");
			xmlData.AddChild(CreateTestGroup("Paper2", "Paper, Paper"));
			xmlData.AddChild(CreateTestGroup("Cloth3", "Cloth, Cloth, Cloth"));
			return new XmlFile(xmlData).ToMemoryStream();
		}
开发者ID:whztt07,项目名称:DeltaEngine,代码行数:7,代码来源:CreepyTowersMockContentLoader.cs


示例13: GetChars

        public Chars GetChars(string guid, string password, XmlData data)
        {
            using (var db = new Database())
            {
                Account a = db.Verify(guid, password, data);
                if (a != null)
                {
                    if (a.Banned)
                        return null;
                }

                Chars chrs = new Chars
                {
                    Characters = new List<Char>(),
                    NextCharId = 2,
                    MaxNumChars = 1,
                    Account = a,
                };
                db.GetCharData(chrs.Account, chrs);
                db.LoadCharacters(chrs.Account, chrs);
                chrs.News = db.GetNews(Program.GameData, chrs.Account);
                chrs.OwnedSkins = Utils.GetCommaSepString(chrs.Account.OwnedSkins.ToArray());
                return chrs;
            }
        }
开发者ID:SirAnuse,项目名称:fabiano-swagger-of-doom,代码行数:25,代码来源:list.cs


示例14: Convert

        public static byte[] Convert(XmlData data, string json)
        {
            var obj = JsonConvert.DeserializeObject<json_dat>(json);
            byte[] dat = ZlibStream.UncompressBuffer(obj.data);

            var tileDict = new Dictionary<short, TerrainTile>();
            for (int i = 0; i < obj.dict.Length; i++)
            {
                loc o = obj.dict[i];
                tileDict[(short) i] = new TerrainTile
                {
                    TileId = o.ground == null ? (ushort) 0xff : data.IdToTileType[o.ground],
                    TileObj = o.objs == null ? null : o.objs[0].id,
                    Name = o.objs == null ? "" : o.objs[0].name ?? "",
                    Terrain = TerrainType.None,
                    Region =
                        o.regions == null
                            ? TileRegion.None
                            : (TileRegion) Enum.Parse(typeof (TileRegion), o.regions[0].id.Replace(' ', '_'))
                };
            }

            var tiles = new TerrainTile[obj.width, obj.height];
            using (var rdr = new NReader(new MemoryStream(dat)))
                for (int y = 0; y < obj.height; y++)
                    for (int x = 0; x < obj.width; x++)
                    {
                        tiles[x, y] = tileDict[rdr.ReadInt16()];
                    }
            return WorldMapExporter.Export(tiles);
        }
开发者ID:Club559,项目名称:Travs-Domain-Server,代码行数:31,代码来源:Json2Wmap.cs


示例15: GetDevicesXmlStream

		protected override Stream GetDevicesXmlStream()
		{
			var devicesXmlData = new XmlData("Devices");
			devicesXmlData.AddChild(EmulatorTestExtensions.CreateDefaultDeviceData());
			devicesXmlData.AddChild(EmulatorTestExtensions.CreateWindows8DeviceData());
			return new XmlFile(devicesXmlData).ToMemoryStream();
		}
开发者ID:whztt07,项目名称:DeltaEngine,代码行数:7,代码来源:MockEmulatorViewModel.cs


示例16: GetChild

 public void GetChild()
 {
     var root = new XmlData("root");
     new XmlData("child1", root);
     var child2 = new XmlData("child2", root);
     Assert.AreEqual(child2, root.GetChild("child2"));
 }
开发者ID:hillwhite,项目名称:DeltaEngine,代码行数:7,代码来源:XmlDataTests.cs


示例17: 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


示例18: AddChild1

		private static void AddChild1(XmlData root)
		{
			var child1 = new XmlData("Child1");
			child1.AddAttribute("Attr1", "Value with space");
			child1.AddAttribute("Attr2", "Value2");
			root.AddChild(child1);
		}
开发者ID:whztt07,项目名称:DeltaEngine,代码行数:7,代码来源:XmlFileTests.cs


示例19: Constructor

		public void Constructor()
		{
			var root = new XmlData("name");
			Assert.AreEqual("name", root.Name);
			Assert.AreEqual(0, root.Children.Count);
			Assert.AreEqual(0, root.Attributes.Count);
		}
开发者ID:whztt07,项目名称:DeltaEngine,代码行数:7,代码来源:XmlDataTests.cs


示例20: CreateTestXmlData

		private static XmlData CreateTestXmlData()
		{
			var root = new XmlData("Root");
			AddChild1(root);
			AddChild2(root);
			return root;
		}
开发者ID:whztt07,项目名称:DeltaEngine,代码行数:7,代码来源:XmlFileTests.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# XmlDbRow类代码示例发布时间:2022-05-24
下一篇:
C# XmlCompletionItemCollection类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap