public static FunctionElement createElement(FunctionsManager managerT,String title)
 {
     manager = managerT;
     element = new FunctionElement(manager);
     SmallDialog_FunctionsConfig dialog = new SmallDialog_FunctionsConfig(title);
     dialog.ShowDialog();
     return element;
 }
        public static FunctionElement createElement(FunctionsManager managerT, String title)
        {
            manager = managerT;
            element = new FunctionElement(manager);
            SmallDialog_FunctionsConfig dialog = new SmallDialog_FunctionsConfig(title);

            dialog.ShowDialog();
            return(element);
        }
 //设置地图单元
 public static void configElement(FunctionElement elementT, String title)
 {
     if (elementT == null)
     {
         Console.WriteLine("error in configElement");
         return;
     }
     manager = (FunctionsManager)elementT.parent;
     element = elementT;
     SmallDialog_FunctionsConfig dialog = new SmallDialog_FunctionsConfig(title);
     dialog.textBox_name.Text = element.name;
     dialog.textBox_Commet.Text = element.commet;
     dialog.showParamsList();
     dialog.ShowDialog();
 }
        //设置地图单元
        public static void configElement(FunctionElement elementT, String title)
        {
            if (elementT == null)
            {
                Console.WriteLine("error in configElement");
                return;
            }
            manager = (FunctionsManager)elementT.parent;
            element = elementT;
            SmallDialog_FunctionsConfig dialog = new SmallDialog_FunctionsConfig(title);

            dialog.textBox_name.Text   = element.name;
            dialog.textBox_Commet.Text = element.commet;
            dialog.showParamsList();
            dialog.ShowDialog();
        }
Esempio n. 5
0
 //配置变量
 private void configElement()
 {
     if (tabControl_Lists.SelectedIndex == 0)//配置整型单元
     {
         if (listBox_VarInt.SelectedIndex >= 0)
         {
             SmallDialog_NewVar_INT.configElement((VarElement)form_main.varIntManager.getElement(listBox_VarInt.SelectedIndex));
             form_main.varIntManager.refreshUI_Element(listBox_VarInt.SelectedIndex);
         }
     }
     if (tabControl_Lists.SelectedIndex == 1)//配置字符单元
     {
         if (listBox_VarString.SelectedIndex >= 0)
         {
             SmallDialog_NewVar_String.configElement((VarElement)form_main.varStringManager.getElement(listBox_VarString.SelectedIndex));
             form_main.varStringManager.refreshUI_Element(listBox_VarString.SelectedIndex);
         }
     }
     if (tabControl_Lists.SelectedIndex == 2)//配置触发函数单元
     {
         if (listBox_Trigger.SelectedIndex >= 0)
         {
             SmallDialog_FunctionsConfig.configElement((FunctionElement)form_main.triggerFunctionManager.getElement(listBox_Trigger.SelectedIndex), "设置触发函数单元");
             form_main.triggerFunctionManager.refreshUI_Element(listBox_Trigger.SelectedIndex);
         }
     }
     if (tabControl_Lists.SelectedIndex == 3)//配置环境函数单元
     {
         if (listBox_Condition.SelectedIndex >= 0)
         {
             SmallDialog_FunctionsConfig.configElement((FunctionElement)form_main.contextFunctionManager.getElement(listBox_Condition.SelectedIndex), "设置环境函数单元");
             form_main.contextFunctionManager.refreshUI_Element(listBox_Condition.SelectedIndex);
         }
     }
     if (tabControl_Lists.SelectedIndex == 4)//配置执行函数单元
     {
         if (listBox_Execution.SelectedIndex >= 0)
         {
             SmallDialog_FunctionsConfig.configElement((FunctionElement)form_main.executionFunctionManager.getElement(listBox_Execution.SelectedIndex), "设置执行函数单元");
             form_main.executionFunctionManager.refreshUI_Element(listBox_Execution.SelectedIndex);
         }
     }
 }
Esempio n. 6
0
 //增加单元
 private void addElement()
 {
     if (tabControl_Lists.SelectedIndex == 0)//增加整型单元
     {
         VarElement element = SmallDialog_NewVar_INT.createElement(form_main.varIntManager);
         if (element != null)
         {
             form_main.varIntManager.addElement(element);
         }
     }
     if (tabControl_Lists.SelectedIndex == 1)//增加字符单元
     {
         VarElement element = SmallDialog_NewVar_String.createElement(form_main.varStringManager);
         if (element != null)
         {
             form_main.varStringManager.addElement(element);
         }
     }
     if (tabControl_Lists.SelectedIndex == 2)//增加触发器函数单元
     {
         FunctionElement element = SmallDialog_FunctionsConfig.createElement(form_main.triggerFunctionManager, "新建触发函数单元");
         if (element != null)
         {
             form_main.triggerFunctionManager.addElement(element);
         }
     }
     if (tabControl_Lists.SelectedIndex == 3)//增加环境函数单元
     {
         FunctionElement element = SmallDialog_FunctionsConfig.createElement(form_main.contextFunctionManager, "新建环境函数单元");
         if (element != null)
         {
             form_main.contextFunctionManager.addElement(element);
         }
     }
     if (tabControl_Lists.SelectedIndex == 4)//增加执行函数单元
     {
         FunctionElement element = SmallDialog_FunctionsConfig.createElement(form_main.executionFunctionManager, "新建执行函数单元");
         if (element != null)
         {
             form_main.executionFunctionManager.addElement(element);
         }
     }
 }