コード例 #1
0
 public override void Write(XmlWriter writer)
 {
     writer.WriteStartElement(this.elementName);
     foreach (FieldInfo fieldInfo in this.FieldInfos)
     {
         writer.WriteStartElement(fieldInfo.Name);
         writer.WriteValue(BaseSystem.ConvertString(fieldInfo.GetValue((object)this)));
         writer.WriteEndElement();
     }
     writer.WriteEndElement();
 }
コード例 #2
0
        public override void Read(string rootName, XmlDocument xml)
        {
            string str = rootName + "/" + this.elementName + "/";

            foreach (FieldInfo fieldInfo in this.FieldInfos)
            {
                XmlNodeList xmlNodeList = xml.SelectNodes(str + fieldInfo.Name);
                if (xmlNodeList != null && xmlNodeList.Item(0) is XmlElement xmlElement)
                {
                    fieldInfo.SetValue((object)this, BaseSystem.Cast(xmlElement.InnerText, fieldInfo.FieldType));
                }
            }
        }
コード例 #3
0
 public override void Read(string rootName, XmlDocument xml)
 {
     try
     {
         string      str          = rootName + "/" + this.elementName + "/";
         XmlNodeList xmlNodeList1 = xml.SelectNodes(str + "SelfShadow");
         if (xmlNodeList1 != null && xmlNodeList1.Item(0) is XmlElement xmlElement)
         {
             this.SelfShadow = (bool)BaseSystem.Cast(xmlElement.InnerText, this.SelfShadow.GetType());
         }
         XmlNodeList xmlNodeList2 = xml.SelectNodes(str + "Bloom");
         if (xmlNodeList2 != null && xmlNodeList2.Item(0) is XmlElement xmlElement)
         {
             this.Bloom = (bool)BaseSystem.Cast(xmlElement.InnerText, this.Bloom.GetType());
         }
         XmlNodeList xmlNodeList3 = xml.SelectNodes(str + "SSAO");
         if (xmlNodeList3 != null && xmlNodeList3.Item(0) is XmlElement xmlElement)
         {
             this.SSAO = (bool)BaseSystem.Cast(xmlElement.InnerText, this.SSAO.GetType());
         }
         XmlNodeList xmlNodeList4 = xml.SelectNodes(str + "SSR");
         if (xmlNodeList4 != null && xmlNodeList4.Item(0) is XmlElement xmlElement)
         {
             this.SSR = (bool)BaseSystem.Cast(xmlElement.InnerText, this.SSR.GetType());
         }
         XmlNodeList xmlNodeList5 = xml.SelectNodes(str + "DepthOfField");
         if (xmlNodeList5 != null && xmlNodeList5.Item(0) is XmlElement xmlElement)
         {
             this.DepthOfField = (bool)BaseSystem.Cast(xmlElement.InnerText, this.DepthOfField.GetType());
         }
         XmlNodeList xmlNodeList6 = xml.SelectNodes(str + "Atmospheric");
         if (xmlNodeList6 != null && xmlNodeList6.Item(0) is XmlElement xmlElement)
         {
             this.Atmospheric = (bool)BaseSystem.Cast(xmlElement.InnerText, this.Atmospheric.GetType());
         }
         XmlNodeList xmlNodeList7 = xml.SelectNodes(str + "Vignette");
         if (xmlNodeList7 != null && xmlNodeList7.Item(0) is XmlElement xmlElement)
         {
             this.Vignette = (bool)BaseSystem.Cast(xmlElement.InnerText, this.Vignette.GetType());
         }
         XmlNodeList xmlNodeList8 = xml.SelectNodes(str + "Rain");
         if (xmlNodeList8 != null && xmlNodeList8.Item(0) is XmlElement xmlElement)
         {
             this.Rain = (bool)BaseSystem.Cast(xmlElement.InnerText, this.Rain.GetType());
         }
         XmlNodeList xmlNodeList9 = xml.SelectNodes(str + "CharaGraphicQuality");
         if (xmlNodeList9 != null && xmlNodeList9.Item(0) is XmlElement xmlElement)
         {
             this.CharaGraphicQuality = (byte)BaseSystem.Cast(xmlElement.InnerText, this.CharaGraphicQuality.GetType());
         }
         XmlNodeList xmlNodeList10 = xml.SelectNodes(str + "MapGraphicQuality");
         if (xmlNodeList10 != null && xmlNodeList10.Item(0) is XmlElement xmlElement)
         {
             this.MapGraphicQuality = (byte)BaseSystem.Cast(xmlElement.InnerText, this.MapGraphicQuality.GetType());
         }
         XmlNodeList xmlNodeList11 = xml.SelectNodes(str + "FaceLight");
         if (xmlNodeList11 != null && xmlNodeList11.Item(0) is XmlElement xmlElement)
         {
             this.FaceLight = (bool)BaseSystem.Cast(xmlElement.InnerText, this.FaceLight.GetType());
         }
         XmlNodeList xmlNodeList12 = xml.SelectNodes(str + "AmbientLight");
         if (xmlNodeList12 != null && xmlNodeList12.Item(0) is XmlElement xmlElement)
         {
             this.AmbientLight = (bool)BaseSystem.Cast(xmlElement.InnerText, this.AmbientLight.GetType());
         }
         XmlNodeList xmlNodeList13 = xml.SelectNodes(str + "Shield");
         if (xmlNodeList13 != null && xmlNodeList13.Item(0) is XmlElement xmlElement)
         {
             this.Shield = (bool)BaseSystem.Cast(xmlElement.InnerText, this.Shield.GetType());
         }
         XmlNodeList xmlNodeList14 = xml.SelectNodes(str + "SimpleBody");
         if (xmlNodeList14 != null && xmlNodeList14.Item(0) is XmlElement xmlElement)
         {
             this.SimpleBody = (bool)BaseSystem.Cast(xmlElement.InnerText, this.SimpleBody.GetType());
         }
         XmlNodeList xmlNodeList15 = xml.SelectNodes(str + "SilhouetteColor");
         if (xmlNodeList15 != null && xmlNodeList15.Item(0) is XmlElement xmlElement)
         {
             this.SilhouetteColor = (Color)BaseSystem.Cast(xmlElement.InnerText, this.SilhouetteColor.GetType());
         }
         XmlNodeList xmlNodeList16 = xml.SelectNodes(str + "BackColor");
         if (xmlNodeList16 != null && xmlNodeList16.Item(0) is XmlElement xmlElement)
         {
             this.BackColor = (Color)BaseSystem.Cast(xmlElement.InnerText, this.BackColor.GetType());
         }
         XmlNodeList xmlNodeList17 = xml.SelectNodes(str + "MaxCharaNum");
         if (xmlNodeList17 != null && xmlNodeList17.Item(0) is XmlElement xmlElement)
         {
             this.MaxCharaNum = (int)BaseSystem.Cast(xmlElement.InnerText, this.MaxCharaNum.GetType());
         }
         for (int index = 0; index < 4; ++index)
         {
             XmlNodeList xmlNodeList18 = xml.SelectNodes(str + "CharasEntry" + (object)index);
             if (xmlNodeList18 != null && xmlNodeList18.Item(0) is XmlElement xmlElement)
             {
                 this.CharasEntry[index] = (bool)BaseSystem.Cast(xmlElement.InnerText, this.CharasEntry[index].GetType());
             }
         }
     }
     catch (Exception ex)
     {
         Debug.LogError((object)ex.Message);
     }
 }
コード例 #4
0
 public override void Write(XmlWriter writer)
 {
     writer.WriteStartElement(this.elementName);
     writer.WriteStartElement("SelfShadow");
     writer.WriteValue(BaseSystem.ConvertString((object)this.SelfShadow));
     writer.WriteEndElement();
     writer.WriteStartElement("Bloom");
     writer.WriteValue(BaseSystem.ConvertString((object)this.Bloom));
     writer.WriteEndElement();
     writer.WriteStartElement("SSAO");
     writer.WriteValue(BaseSystem.ConvertString((object)this.SSAO));
     writer.WriteEndElement();
     writer.WriteStartElement("SSR");
     writer.WriteValue(BaseSystem.ConvertString((object)this.SSR));
     writer.WriteEndElement();
     writer.WriteStartElement("DepthOfField");
     writer.WriteValue(BaseSystem.ConvertString((object)this.DepthOfField));
     writer.WriteEndElement();
     writer.WriteStartElement("Atmospheric");
     writer.WriteValue(BaseSystem.ConvertString((object)this.Atmospheric));
     writer.WriteEndElement();
     writer.WriteStartElement("Vignette");
     writer.WriteValue(BaseSystem.ConvertString((object)this.Vignette));
     writer.WriteEndElement();
     writer.WriteStartElement("Rain");
     writer.WriteValue(BaseSystem.ConvertString((object)this.Rain));
     writer.WriteEndElement();
     writer.WriteStartElement("CharaGraphicQuality");
     writer.WriteValue(BaseSystem.ConvertString((object)this.CharaGraphicQuality));
     writer.WriteEndElement();
     writer.WriteStartElement("MapGraphicQuality");
     writer.WriteValue(BaseSystem.ConvertString((object)this.MapGraphicQuality));
     writer.WriteEndElement();
     writer.WriteStartElement("FaceLight");
     writer.WriteValue(BaseSystem.ConvertString((object)this.FaceLight));
     writer.WriteEndElement();
     writer.WriteStartElement("AmbientLight");
     writer.WriteValue(BaseSystem.ConvertString((object)this.AmbientLight));
     writer.WriteEndElement();
     writer.WriteStartElement("Shield");
     writer.WriteValue(BaseSystem.ConvertString((object)this.Shield));
     writer.WriteEndElement();
     writer.WriteStartElement("SimpleBody");
     writer.WriteValue(BaseSystem.ConvertString((object)this.SimpleBody));
     writer.WriteEndElement();
     writer.WriteStartElement("SilhouetteColor");
     writer.WriteValue(BaseSystem.ConvertString((object)this.SilhouetteColor));
     writer.WriteEndElement();
     writer.WriteStartElement("BackColor");
     writer.WriteValue(BaseSystem.ConvertString((object)this.BackColor));
     writer.WriteEndElement();
     writer.WriteStartElement("MaxCharaNum");
     writer.WriteValue(BaseSystem.ConvertString((object)this.MaxCharaNum));
     writer.WriteEndElement();
     for (int index = 0; index < 4; ++index)
     {
         string localName = "CharasEntry" + (object)index;
         writer.WriteStartElement(localName);
         writer.WriteValue(BaseSystem.ConvertString((object)this.CharasEntry[index]));
         writer.WriteEndElement();
     }
     writer.WriteEndElement();
 }