Пример #1
0
        public SaveResult SaveHeader(string folderPath)
        {
            // ちゃんとしたファイルを書き出す。
            XmlSerializer serializer = new XmlSerializer(typeof(LoadFileInfo));
            var           outstream  = new System.IO.FileStream(folderPath + "\\" + "version.xml", System.IO.FileMode.Create);
            var           saveInfo   = new LoadFileInfo()
            {
                version = FileVersion.Ver4_0_0
            };

            serializer.Serialize(outstream, saveInfo);
            outstream.Close();

            return(SaveResult.Succeed);
        }
 public static FileExpanderInterface GetExpander(LoadFileInfo loadFileInfo)
 {
     if (loadFileInfo.version == FileVersion.Ver1_0_0)
     {
         return new FileExpanderVer1_0_0();
     }
     if (loadFileInfo.version == FileVersion.Ver2_0_0)
     {
         return new FileExpanderVer2_0_0();
     }
     if (loadFileInfo.version == FileVersion.Ver3_0_0)
     {
         return new FileExpanderVer3_0_0();
     }
     if (loadFileInfo.version == FileVersion.Ver4_0_0)
     {
         return new FileExpanderVer4_0_0();
     }
     return null;
 }
Пример #3
0
        public void LoadFileInfoFile(string folderPath)
        {
            string versionFilePath = folderPath + "\\version.xml";

            if (!File.Exists(versionFilePath))
            {
                LoadFileInfo = new LoadFileInfo()
                {
                    version = FileVersion.Ver1_0_0
                };

                return;
            }

            // ちゃんとしたファイルを書き出す。
            XmlSerializer serializer = new XmlSerializer(typeof(LoadFileInfo));
            FileStream    outstream  = new System.IO.FileStream(versionFilePath, System.IO.FileMode.Open);

            LoadFileInfo = (LoadFileInfo)serializer.Deserialize(outstream);
            outstream.Close();
        }
Пример #4
0
        public void LoadFileInfoFile(string folderPath)
        {
            string versionFilePath = folderPath + "\\version.xml";

            if (!File.Exists(versionFilePath))
            {
                LoadFileInfo = new LoadFileInfo()
                {
                    version = FileVersion.Ver1_0_0
                };

                return ;
            }

            // ちゃんとしたファイルを書き出す。
            XmlSerializer serializer = new XmlSerializer(typeof(LoadFileInfo));
            FileStream outstream = new System.IO.FileStream(versionFilePath, System.IO.FileMode.Open);

            LoadFileInfo = (LoadFileInfo)serializer.Deserialize(outstream);
            outstream.Close();
        }
Пример #5
0
        public SaveResult SaveHeader(string folderPath)
        {
            // ちゃんとしたファイルを書き出す。
            XmlSerializer serializer = new XmlSerializer(typeof(LoadFileInfo));
            var outstream = new System.IO.FileStream(folderPath + "\\" + "version.xml", System.IO.FileMode.Create);
            var saveInfo = new LoadFileInfo() { version = FileVersion.Ver4_0_0 };

            serializer.Serialize(outstream, saveInfo);
            outstream.Close();

            return SaveResult.Succeed;
        }