示例#1
0
    public static bool Reload()
    {
        bool succ = true;

        dataHolder = new DataHolder();
        reader.Restart();

        try {
            _Load();

            // Reset all the items to be reloaded, (not failed to load)
            if (dataHolder.cur_graphicSetting != null)
            {
                Program.windowStatus.graphicsCreator.Prototype.Dispose();
            }

            if (dataHolder.indexSettings != null)
            {
                Program.windowStatus.indexSettings.Dispose();
            }

            if (dataHolder.indexStats != null)
            {
                Program.windowStatus.indexStats.Dispose();
            }

            _InsertDataToProgram();

            // Fix up some stuff, loose ends
            Program.windowStatus.indexStats.CheckAllLinks();
            Program.windowStatus.graphicsCreator.Prototype.UpdateIdxSettingReference();
        } catch {
            succ = false;
        }

        Program.windowStatus.txtbox_dllimported.Text = CommHandler.dllpath;
        CommHandler.InitDllImport();

        dataHolder.Clear();
        dataHolder = null;

        return(succ);
    }
示例#2
0
    public static void Load()
    {
        dataHolder = new DataHolder();
        // Set up failproof values if the load fails
        Program.windowStatus.graphicsCreator.SetPrototype(new GraphicsCreator.graphicPrototype("", new GraphicsCreator.graphicPrototype.prototypeIndex[0]));

        try {
            _Load();
            _InsertDataToProgram();
        } catch (Exception e) {
            Console.WriteLine(e);
            Program.errors.Add("Failed to load settings.");
        }

        Program.windowStatus.txtbox_dllimported.Text = CommHandler.dllpath;
        CommHandler.InitDllImport();

        dataHolder.Clear();
        dataHolder = null;
    }