コード例 #1
0
        /*public static void Generate()
         * {
         *  if (Control == null)
         *      new AdminControl();
         *  Serial<AdminControl>.WriteToFile(Control, Path.Combine(Program.DataPath, "AdminControl.xml"));
         * }*/

        public static void Load()
        {
            string path  = Path.Combine(Program.DataPath, "AdminControl.json");
            string path2 = Path.Combine(Program.DataPath, "AdminControl.xml");

            if (File.Exists(path))
            {
                Control = Serializer <AdminControl> .LoadFromJSONFile(path);
            }
            else if (File.Exists(path2))
            {
                Control = Serializer <AdminControl> .LoadFromXMLFile(path2);

                Serializer <AdminControl> .WriteToJSONFile(Control, path);

                File.Delete(path2);
            }
            else
            {
                new AdminControl();
            }
        }
コード例 #2
0
 public AdminControl()
 {
     Control = this;
 }