public static VarElement createElement(VarsManager managerT)
 {
     manager = managerT;
     element = new VarElement(manager,Consts.PARAM_STR);
     SmallDialog_NewVar_String dialog = new SmallDialog_NewVar_String("新建字符变量");
     dialog.ShowDialog();
     return element;
 }
        public static VarElement createElement(VarsManager managerT)
        {
            manager = managerT;
            element = new VarElement(manager, Consts.PARAM_STR);
            SmallDialog_NewVar_String dialog = new SmallDialog_NewVar_String("新建字符变量");

            dialog.ShowDialog();
            return(element);
        }
 //设置地图单元
 public static void configElement(VarElement elementT)
 {
     if (elementT == null)
     {
         Console.WriteLine("error in configElement");
         return;
     }
     manager = (VarsManager)elementT.parent;
     element = elementT;
     SmallDialog_NewVar_String dialog = new SmallDialog_NewVar_String("设置字符变量");
     dialog.textBox_name.Text = element.name;
     dialog.textBox_Value.Text = (String)element.getValue();
     dialog.ShowDialog();
 }
        //设置地图单元
        public static void configElement(VarElement elementT)
        {
            if (elementT == null)
            {
                Console.WriteLine("error in configElement");
                return;
            }
            manager = (VarsManager)elementT.parent;
            element = elementT;
            SmallDialog_NewVar_String dialog = new SmallDialog_NewVar_String("设置字符变量");

            dialog.textBox_name.Text  = element.name;
            dialog.textBox_Value.Text = (String)element.getValue();
            dialog.ShowDialog();
        }
Ejemplo 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);
         }
     }
 }
Ejemplo 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);
         }
     }
 }