Exemple #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();
        }
Exemple #2
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();
        }
Exemple #3
0
        private void dataGridView3_MouseClick(object sender, MouseEventArgs e)
        {
            EventSelector formEventSelector = new EventSelector();

            // 首先通过当前树的内容, 修改事件选择器的选定内容
            formEventSelector.SetListAllItemChecked(false);
            foreach (DataGridViewRow row in dataGridView3.Rows)
            {
                if (row != null && row.Cells[0].Value != null)
                {
                    formEventSelector.SetListItemChecked(row.Cells[0].Value.ToString(), true);
                }
            }

            if (formEventSelector.ShowDialog() == DialogResult.OK)
            {
                string[] EventKeyList = formEventSelector.GetSelectedEventList();
                dataGridView3.Rows.Clear();
                foreach (string szKey in EventKeyList)
                {
                    dataGridView3.Rows.Add(szKey, TabFile.EventData.GetTabCell(szKey, "ShowName"));
                }
            }
        }
Exemple #4
0
        private void dataGridView3_MouseClick(object sender, MouseEventArgs e)
        {
            EventSelector formEventSelector = new EventSelector();

            // 首先通过当前树的内容, 修改事件选择器的选定内容
            formEventSelector.SetListAllItemChecked(false);
            foreach (DataGridViewRow row in dataGridView3.Rows)
            {
                if (row != null && row.Cells[0].Value != null)
                {
                    formEventSelector.SetListItemChecked(row.Cells[0].Value.ToString(), true);
                }
            }

            if (formEventSelector.ShowDialog() == DialogResult.OK)
            {
                string[] EventKeyList = formEventSelector.GetSelectedEventList();
                dataGridView3.Rows.Clear();
                foreach (string szKey in EventKeyList)
                {
                    dataGridView3.Rows.Add(szKey, TabFile.EventData.GetTabCell(szKey, "ShowName"));
                }
            }
        }