Ejemplo n.º 1
0
        public Form1()
        {
            InitializeComponent();

            // 初始化数据表
            TabFile.EventData     = new TabFileData("Settings\\EventDefine.tab", "EventID");
            TabFile.ConditionData = new TabFileData("Settings\\ConditionDefine.tab", "ConditionID");

            // 初始化选择器
            formEventSelector     = new EventSelector();
            formConditionSelector = new ConditionSelector();
            formActionSelector    = new ActionSelector();
            formHelpWindow        = new HelpWindow();

            // 初始化修改器
            conditionDefineEditor = new ConditionDefineEditor();

            // 初始化 Condition Tree
            groupBox2.Enabled = false;

            // 初始化 Config
            string szConfigFileName = Directory.GetCurrentDirectory() + @"\Config.ini";

            iniConfig = new INIFile(szConfigFileName);
            if (File.Exists(szConfigFileName) == false)
            {
                // 如果没有 Config 文件则创建一个带有默认值的 Config
                iniConfig.SetValue(szSection, "AutoLoadEventTreeWhenStartUp", "1");
                iniConfig.SetValue(szSection, "AutoSaveEventTreeWhenExchangeEventItem", "1");
                iniConfig.SetValue(szSection, "LastSavedFileName", "");
            }

            if (iniConfig.GetValue(szSection, "AutoLoadEventTreeWhenStartUp") == "1")
            {
                checkBox2.Checked = true;
                string szLastSavedFileName = iniConfig.GetValue(szSection, "LastSavedFileName");
                if (File.Exists(szLastSavedFileName) == true)
                {
                    LoadEventTreeByFile(szLastSavedFileName);
                }
            }
            else
            {
                checkBox2.Checked = false;
            }

            if (iniConfig.GetValue(szSection, "AutoSaveEventTreeWhenExchangeEventItem") == "1")
            {
                checkBox1.Checked = true;
            }
            else
            {
                checkBox1.Checked = false;
            }

            // TEST
            //conditionDefineEditor.ShowDialog();
        }
Ejemplo n.º 2
0
Archivo: Form1.cs Proyecto: viticm/pap2
        public Form1()
        {
            InitializeComponent();

            // 初始化数据表
            TabFile.EventData = new TabFileData("Settings\\EventDefine.tab", "EventID");
            TabFile.ConditionData = new TabFileData("Settings\\ConditionDefine.tab", "ConditionID");

            // 初始化选择器
            formEventSelector = new EventSelector();
            formConditionSelector = new ConditionSelector();
            formActionSelector = new ActionSelector();
            formHelpWindow = new HelpWindow();

            // 初始化修改器
            conditionDefineEditor = new ConditionDefineEditor();

            // 初始化 Condition Tree
            groupBox2.Enabled = false;

            // 初始化 Config
            string szConfigFileName = Directory.GetCurrentDirectory() + @"\Config.ini";
            iniConfig = new INIFile(szConfigFileName);
            if (File.Exists(szConfigFileName) == false)
            {
                // 如果没有 Config 文件则创建一个带有默认值的 Config
                iniConfig.SetValue(szSection, "AutoLoadEventTreeWhenStartUp", "1");
                iniConfig.SetValue(szSection, "AutoSaveEventTreeWhenExchangeEventItem", "1");
                iniConfig.SetValue(szSection, "LastSavedFileName", "");
            }

            if (iniConfig.GetValue(szSection, "AutoLoadEventTreeWhenStartUp") == "1")
            {
                checkBox2.Checked = true;
                string szLastSavedFileName = iniConfig.GetValue(szSection, "LastSavedFileName");
                if (File.Exists(szLastSavedFileName) == true)
                    LoadEventTreeByFile(szLastSavedFileName);
            }
            else
                checkBox2.Checked = false;

            if (iniConfig.GetValue(szSection, "AutoSaveEventTreeWhenExchangeEventItem") == "1")
                checkBox1.Checked = true;
            else
                checkBox1.Checked = false;

            // TEST
            //conditionDefineEditor.ShowDialog();
        }