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


C# XmlWriter.WriteVector方法代码示例

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


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

示例1: ReadPhysics

 void ReadPhysics(string pText)
 {
     switch (pText)
     {
         case "Physics":
             string fileName = $"Physics_{PhysicsCount}.xml";
             xw = XmlWriter.Create(Path.Combine(Folder, fileName), xws);
             filelist.Add(fileName);
             PhysicsCount++;
             xw.WriteStartDocument();
             xw.WriteStartElement("Physics");
             break;
         case "SizeRatio":
             xw.WriteStartElement("SizeRatio");
             xw.WriteAttributeString("Value", br.ReadSingle());
             xw.WriteEndElement();
             break;
         case "Gravity":
             xw.WriteStartElement("Gravity");
             xw.WriteAttributeString("Value", br.ReadSingle());
             xw.WriteEndElement();
             break;
         case "RigidBody":
             xw.WriteStartElement("RigidBody");
             xw.WriteAttributeString("Count", br.ReadInt32());
             xw.WriteEndElement();
             break;
         case "Name":
             xw.WriteStartElement("Name");
             xw.WriteAttributeString("Text", ReadText());
             break;
         case "BoneIdx":
             xw.WriteStartElement("BoneIdx");
             xw.WriteAttributeString("Value", br.ReadInt32());
             xw.WriteEndElement();
             break;
         case "GroupNo":
             xw.WriteStartElement("GroupNo");
             xw.WriteAttributeString("Value", br.ReadByte());
             xw.WriteEndElement();
             break;
         case "UnCollisionGroup":
             xw.WriteStartElement("UnCollisionGroup");
             xw.WriteAttributeString("Value", br.ReadInt16());
             xw.WriteEndElement();
             break;
         case "Shape":
             xw.WriteStartElement("Shape");
             xw.WriteAttributeString("Value", br.ReadByte());
             xw.WriteEndElement();
             break;
         case "Size":
             xw.WriteStartElement("Size");
             xw.WriteVector(br.ReadSingle(), br.ReadSingle(), br.ReadSingle());
             xw.WriteEndElement();
             break;
         case "Pos":
             xw.WriteStartElement("Pos");
             xw.WriteVector(br.ReadSingle(), br.ReadSingle(), br.ReadSingle());
             xw.WriteEndElement();
             break;
         case "Rota":
             xw.WriteStartElement("Rota");
             xw.WriteVector(br.ReadSingle(), br.ReadSingle(), br.ReadSingle());
             xw.WriteEndElement();
             break;
         case "Mass":
             xw.WriteStartElement("Mass");
             xw.WriteAttributeString("Value", br.ReadSingle());
             xw.WriteEndElement();
             break;
         case "MoveAtte":
             xw.WriteStartElement("MoveAtte");
             xw.WriteAttributeString("Value", br.ReadSingle());
             xw.WriteEndElement();
             break;
         case "RotaAtte":
             xw.WriteStartElement("RotaAtte");
             xw.WriteAttributeString("Value", br.ReadSingle());
             xw.WriteEndElement();
             break;
         case "Repulsion":
             xw.WriteStartElement("Repulsion");
             xw.WriteAttributeString("Value", br.ReadSingle());
             xw.WriteEndElement();
             break;
         case "Fric":
             xw.WriteStartElement("Fric");
             xw.WriteAttributeString("Value", br.ReadSingle());
             xw.WriteEndElement();
             break;
         case "CalcType":
             xw.WriteStartElement("CalcType");
             xw.WriteAttributeString("Value", br.ReadByte());
             xw.WriteEndElement();
             break;
         case "EndRigid":
             xw.WriteEndElement();
             break;
         case "Joint":
//.........这里部分代码省略.........
开发者ID:LightningDragon,项目名称:Windom-SV-xed-Tool,代码行数:101,代码来源:XedDecrypt.cs

示例2: ReadAnimation

 void ReadAnimation(string ptext)
 {
     switch (ptext)
     {
         case "AnimeName":
             string fileName = $"Anime_{AnimeCount}.xml";
             xw = XmlWriter.Create(Path.Combine(Folder, fileName), xws);
             filelist.Add(fileName);
             AnimeCount++;
             xw.WriteStartDocument();
             xw.WriteStartElement("AnimeName");
             xw.WriteAttributeString("Name", ReadText());
             xw.WriteAttributeString("ID", br.ReadInt32());
             break;
         case "Windom_TopScript":
             xw.WriteStartElement("Windom_TopScript");
             xw.WriteString(ReadText());
             xw.WriteEndElement();
             break;
         case "ScriptKey":
             xw.WriteStartElement("ScriptKey");
             xw.WriteAttributeString("Count", br.ReadInt32());
             xw.WriteEndElement();
             break;
         case "Time":
             xw.WriteStartElement("Time");
             xw.WriteAttributeString("Value", br.ReadInt32());
             break;
         case "ScriptText":
             xw.WriteStartElement("ScriptText");
             xw.WriteString(ReadText());
             xw.WriteEndElement();
             break;
         case "End":
             xw.WriteEndElement();
             break;
         case "BoneData":
             xw.WriteStartElement("BoneData");
             break;
         case "BoneName":
             if (lastbone != "")
                 xw.WriteEndElement();
             xw.WriteStartElement("BoneName");
             lastbone = ReadText();
             xw.WriteAttributeString("Text", lastbone);
             break;
         case "CalcType":
             xw.WriteStartElement("CalcType");
             xw.WriteAttributeString("Value", br.ReadByte());
             xw.WriteEndElement();
             break;
         case "PowVal":
             xw.WriteStartElement("PowVal");
             xw.WriteAttributeString("Value", br.ReadSingle());
             xw.WriteEndElement();
             break;
         case "Pos":
             xw.WriteStartElement("Pos");
             xw.WriteVector(br.ReadSingle(), br.ReadSingle(), br.ReadSingle());
             xw.WriteEndElement();
             break;
         case "PosKey":
             xw.WriteStartElement("PosKey");
             xw.WriteAttributeString("Count", br.ReadInt32());
             xw.WriteEndElement();
             break;
         case "Rota":
             xw.WriteStartElement("Rota");
             xw.WriteVector(br.ReadSingle(), br.ReadSingle(), br.ReadSingle(), br.ReadSingle());
             xw.WriteEndElement();
             break;
         case "RotateKey":
             xw.WriteStartElement("RotateKey");
             xw.WriteAttributeString("Count", br.ReadInt32());
             xw.WriteEndElement();
             break;
         case "Scale":
             xw.WriteStartElement("Scale");
             xw.WriteVector(br.ReadSingle(), br.ReadSingle(), br.ReadSingle());
             xw.WriteEndElement();
             break;
         case "ScaleKey":
             xw.WriteStartElement("ScaleKey");
             xw.WriteAttributeString("Count", br.ReadInt32());
             xw.WriteEndElement();
             break;
     }
 }
开发者ID:LightningDragon,项目名称:Windom-SV-xed-Tool,代码行数:88,代码来源:XedDecrypt.cs


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