Пример #1
0
        private void button3_Click(object sender, EventArgs e)
        {
            //richTextBox1.i
            //myCommonTool.SetControlFreeze(ref richTextBox1);
            //myCommonTool.SetControlUnfreeze(ref richTextBox1);

            timer1.Start();
            //for (int i = 0; i < 2; i++)
            //{
            //    richTextBox1.AppendText("nmbprivate void button2_Click(object sender, EventArgs e)\r\n");
            //    //richTextBox1.Focus();
            //    //richTextBox1.Text += "nmbprivate void button2_Click(object sender, EventArgs e)\r\n";
            //    //MessageBox.Show(" " + richTextBox1.SelectionStart);
            //    //richTextBox1.Focus();
            //}
            return;

            for (int i = 0; i < 1; i++)
            {
                MyControlHelper.setRichTextBoxContent(ref richTextBox1, "nmbprivate void button2_Click(object sender, EventArgs e)", Color.Red, true);
                MyControlHelper.setRichTextBoxContent(ref richTextBox1, "nmbprivate void button2_Click(object sender, EventArgs e)", Color.Beige, true);
                MyControlHelper.setRichTextBoxContent(ref richTextBox1, "nmprivate void button2_Click(object sender, EventArgs e)b", Color.Blue, true);
                MyControlHelper.setRichTextBoxContent(ref richTextBox1, "nmprivate void button2_Click(object sender, EventArgs e)b", Color.BurlyWood, true);
                MyControlHelper.setRichTextBoxContent(ref richTextBox1, "nmprivate void button2_Click(object sender, EventArgs e)b", Color.Black, true);
            }

            return;

            myResetEvent.Set();
            mySP.comm.Write(textBox1.Text);
            mySP.comm.Write("\t");
        }
Пример #2
0
        //Load file
        private void bt_loadFile_Click(object sender, EventArgs e)
        {
            string        errorMessage;
            List <string> errorList;

            newCaseRunner = new CaseRunner("NU");
            if (newCaseRunner.LoadCase(tb_caseFilePath.Text, out errorMessage, out errorList))
            {
                if (errorList != null)
                {
                    foreach (string tempError in errorList)
                    {
                        MyControlHelper.setRichTextBoxContent(ref rtb_info, tempError, Color.Black, true);
                    }
                }
                newCaseRunner.RunnerCasePath = tb_caseFilePath.Text;
                MyControlHelper.setRichTextBoxContent(ref rtb_info, "加载完成请继续", Color.Blue, true);
                LoadFileData();
            }
            else
            {
                MyControlHelper.setRichTextBoxContent(ref rtb_info, errorMessage, Color.Red, true);
                newCaseRunner = null;
                FreezeAdd();
                MessageBox.Show(errorMessage);
            }
        }
Пример #3
0
        private void analyzeCaseData()
        {
            MyRunCaseData <ICaseExecutionContent> yourCaseRunData = ((CaseCell)myTargetNode.Tag).CaseRunData;

            if (yourCaseRunData.errorMessages == null)
            {
                llb_errorInfo.Visible = false;
            }
            else
            {
                llb_errorInfo.Text = yourCaseRunData.errorMessages.MyToString(";");
                return;
            }
            lb_caseId.Text     = "ID:" + yourCaseRunData.id;
            lb_caseTarget.Text = "->" + yourCaseRunData.testContent.MyExecutionTarget;
            lb_protocol.Text   = "Protocol:" + yourCaseRunData.contentProtocol.ToString();
            lb_delay.Text      = "Delay:" + yourCaseRunData.caseAttribute.attributeDelay + "ms";
            lb_level.Text      = "CaseLevel:" + yourCaseRunData.caseAttribute.attributeLevel;
            if (yourCaseRunData.caseAttribute.myParameterSaves != null)
            {
                foreach (ParameterSave tempValue in yourCaseRunData.caseAttribute.myParameterSaves)
                {
                    listView_parameterSave.Items.Add(new ListViewItem(new string[] { tempValue.parameterName, tempValue.parameterFindVaule }));
                }
            }

            lb_expectType.Text = "AssertType:" + yourCaseRunData.caseExpectInfo.myExpectType.ToString();
            if (yourCaseRunData.caseExpectInfo.myExpectContent.IsFilled())
            {
                tb_expectContent.Text = yourCaseRunData.caseExpectInfo.myExpectContent.contentData;
            }
            if (yourCaseRunData.actions != null)
            {
                foreach (KeyValuePair <CaseResult, CaseActionDescription> tempAction in yourCaseRunData.actions)
                {
                    listView_action.Items.Add(new ListViewItem(new string[] { tempAction.Key.ToString(), tempAction.Value.caseAction.ToString() + tempAction.Value.addInfo.MyValue() }));
                }
            }
            if (yourCaseRunData.testContent != null)
            {
                MyControlHelper.myAddRtbStr(ref rtb_Content, "【Actuator】:" + yourCaseRunData.testContent.MyCaseActuator, Color.DarkOrchid, true);
                MyControlHelper.myAddRtbStr(ref rtb_Content, yourCaseRunData.testContent.MyExecutionContent, Color.Maroon, true);
                //rtb_Content.AppendText((((CaseCell)myTargetNode.Tag).CaseXmlNode)["Content"].InnerXml);
                string xmlContent;
                if (MyCommonTool.FormatXmlString((((CaseCell)myTargetNode.Tag).CaseXmlNode)["Content"].OuterXml, out xmlContent))
                {
                    MyControlHelper.myAddRtbStr(ref rtb_Content, xmlContent, Color.Black, true);
                }
                else
                {
                    MyControlHelper.myAddRtbStr(ref rtb_Content, xmlContent, Color.Red, true);
                }
                rtb_Content.Select(0, 0);
                rtb_Content.ScrollToCaret();
            }
            else
            {
                rtb_Content.Text = "NULL";
            }
        }
 public void Visiblity(bool visible)
 {
     if (LabelControlManager != null)
     {
         LabelControlManager.Visiblity(visible);
     }
     MyControlHelper.Visiblity(visible);
 }
Пример #5
0
        private void MyFreeHttpWindow_OnShowInIndependentWindow(object sender, bool e)
        {
            if (e)
            {
                myFreeHttpWindow.FreeHttpWindowParentChanged(sender);
                Form newForm = new Form();
                newForm.Icon         = FreeHttp.Resources.MyResource.freehttpico;
                newForm.Text         = "FreeHttp";
                newForm.Size         = tabPage.Size;
                newForm.FormClosing += new FormClosingEventHandler((yourSender, yourE) => {
                    myFreeHttpWindow.FreeHttpWindowParentChanged(sender);
                    MyControlHelper.SetControlFreeze(tabPage);
                    myFreeHttpWindow.independentWindowToolStripMenuItem.Text = "independent window";
                    tabPage.Controls.Clear();
                    tabPage.Controls.Add(myFreeHttpWindow);
                    MyControlHelper.SetControlUnfreeze(tabPage);
                });
                MyControlHelper.SetControlFreeze(newForm);
                Label lb_info = new Label();
                lb_info.Text      = "closing...";
                lb_info.ForeColor = Color.Blue;
                lb_info.Location  = new Point((newForm.Width - lb_info.Width) / 2, (newForm.Height - lb_info.Height) / 2);
                lb_info.Anchor    = AnchorStyles.None;
                newForm.Controls.Add(lb_info);
                newForm.Controls.Add(myFreeHttpWindow);
                lb_info.SendToBack();
                MyControlHelper.SetControlUnfreeze(newForm);
                newForm.Show();

                LinkLabel llb_info = new LinkLabel();
                llb_info.Text         = "FreeHttp is in independent mode";
                llb_info.ForeColor    = Color.Blue;
                llb_info.AutoSize     = true;
                llb_info.Location     = new Point((tabPage.Width - llb_info.Width) / 2, (tabPage.Height - llb_info.Height) / 2);
                llb_info.Anchor       = AnchorStyles.None;
                llb_info.LinkClicked += new LinkLabelLinkClickedEventHandler((yourSender, yourE) => { newForm.Activate(); });
                tabPage.Controls.Add(llb_info);

                LinkLabel llb_infoRecover = new LinkLabel();
                llb_infoRecover.Text         = "recover to addin mode";
                llb_infoRecover.ForeColor    = Color.Blue;
                llb_infoRecover.AutoSize     = true;
                llb_infoRecover.Location     = new Point((tabPage.Width - llb_infoRecover.Width) / 2, ((tabPage.Height - llb_infoRecover.Height) / 2) + 20);
                llb_infoRecover.Anchor       = AnchorStyles.None;
                llb_infoRecover.LinkClicked += new LinkLabelLinkClickedEventHandler((yourSender, yourE) => { myFreeHttpWindow.independentWindowToolStripMenuItem_Click(null, null); });
                tabPage.Controls.Add(llb_infoRecover);
            }
            else
            {
                (myFreeHttpWindow.Parent as Form)?.Close();
            }
        }
 public void Visiblity(object dataItem, bool visible)
 {
     //foreach (var item in RelatedControl)
     //{
     //    //بهتر شود
     //    if (item is TextBlock)
     //        LabelHelper.Visiblity(item, visible);
     //}
     if (LabelControlManager != null)
     {
         LabelControlManager.Visiblity(visible);
     }
     MyControlHelper.Visiblity(visible);
 }
Пример #7
0
 private void InitAppRunModule()
 {
     //if ((this._userContext.MachineConfig != null) && this._userContext.MachineConfig.IsMultiAppModule)
     //{
     this._tabMainControl = new XtraTabControl();
     this._tabMainControl.ClosePageButtonShowMode = ClosePageButtonShowMode.InAllTabPageHeaders;
     this._tabMainControl.HotTrackedPageChanged  += new TabPageChangedEventHandler(this._tabMainControl_HotTrackedPageChanged);
     this._tabMainControl.CloseButtonClick       += new EventHandler(this._tabMainControl_CloseButtonClick);
     this._tabMainControl.SelectedPageChanged    += new TabPageChangedEventHandler(this._tabMainControl_SelectedPageChanged);
     this._dictTabCtroller     = new Dictionary <string, TabControlController>();
     this._tabMainControl.Dock = DockStyle.Fill;
     this.panel_main.Controls.Add(this._tabMainControl);
     MyControlHelper.DockControl <XtraTabControl>(this._tabMainControl, this.panel_main, DockStyle.Fill);
     //}
 }
Пример #8
0
        private void timer1_Tick(object sender, EventArgs e)
        {
            MyControlHelper.SetControlFreeze(richTextBox1);
            int tempStart = richTextBox1.SelectionStart;
            int tempEnd   = richTextBox1.SelectionLength;

            richTextBox1.AppendText("nmbprivate void button2_Click(object sender, EventArgs e+++++)\r\n");
            richTextBox1.AppendText("nmbprivate void button2_Click(object sender, EventArgs e)\r\n");
            //myCommonTool.setControlContentBottom(ref richTextBox1, "nmprivate void button2_Click(object sender, EventArgs e)b", Color.BurlyWood, true);
            //myCommonTool.setControlContentBottom(ref richTextBox1, "nmprivate void button2_Click(object sender, EventArgs e)b", Color.Black, true);
            richTextBox1.Select(tempStart, tempEnd);
            MyControlHelper.SetControlUnfreeze(richTextBox1);

            dataRecordBox1.AddDate("nmprivate void button2_Click(object sender, EventArgs e)b", Color.Blue, true);
            dataRecordBox1.AddDate("nmprivate void button2_Click(object sender, EventArgs e)b", Color.Black, true);
        }
Пример #9
0
        public void updatalistView_CaseParameter()
        {
            MyControlHelper.SetControlFreeze(listView_CaseParameter);
            listView_CaseParameter.BeginUpdate();
            listView_CaseParameter.Items.Clear();
            try
            {
                switch (nowShowType)
                {
                case ShowRunTimeParameterType.KeyValue:
                    foreach (KeyValuePair <string, string> tempKvp in myParentWindow.nowCaseActionActuator.RunActuatorStaticDataCollection.RunActuatorStaticDataKeyList)
                    {
                        listView_CaseParameter.Items.Add(new ListViewItem(new string[] { tempKvp.Key, tempKvp.Value }));
                    }
                    break;

                case ShowRunTimeParameterType.Parameter:
                    foreach (KeyValuePair <string, CaseExecutiveActuator.IRunTimeStaticData> tempKvp in myParentWindow.nowCaseActionActuator.RunActuatorStaticDataCollection.RunActuatorStaticDataParameterList)
                    {
                        listView_CaseParameter.Items.Add(new ListViewItem(new string[] { tempKvp.Key, tempKvp.Value.DataCurrent() }));
                    }
                    break;

                case ShowRunTimeParameterType.DataSouce:
                    foreach (KeyValuePair <string, CaseExecutiveActuator.IRunTimeDataSource> tempKvp  in myParentWindow.nowCaseActionActuator.RunActuatorStaticDataCollection.RunActuatorStaticDataSouceList)
                    {
                        listView_CaseParameter.Items.Add(new ListViewItem(new string[] { tempKvp.Key, tempKvp.Value.DataCurrent() }));
                    }
                    break;

                default:
                    //not this way
                    break;
                }
            }
            catch
            {
                //RunActuatorStaticDataCollection可能在执行线程中被修改
            }
            listView_CaseParameter.EndUpdate();
            MyControlHelper.SetControlUnfreeze(listView_CaseParameter);
        }
Пример #10
0
 private void RefreshPathList(List <IMessageConsumer> souceData)
 {
     if (souceData != null)
     {
         if (this.InvokeRequired)
         {
             this.Invoke(new Action <List <IMessageConsumer> >(RefreshPathList), souceData);
         }
         else
         {
             MyControlHelper.SetControlFreeze(lv_pathList);
             lv_pathList.ClearEx();
             foreach (IMessageConsumer tempConsumer in souceData)
             {
                 ListViewItem tempLvi = new ListViewItem(new string[] { ((Apache.NMS.ActiveMQ.MessageConsumer)(tempConsumer)).ConsumerInfo.Destination.ToString(), "" });
                 tempLvi.Tag = new Button();
                 ((Button)tempLvi.Tag).Text = "Delete";
                 tempLvi.SubItems[0].Tag    = tempConsumer;
                 lv_pathList.AddItemEx(tempLvi);
             }
             MyControlHelper.SetControlUnfreeze(lv_pathList);
         }
     }
 }
 public bool SetOperator(CommonOperator searchOperator)
 {
     return(MyControlHelper.SetOperator(searchOperator));
 }
 public void RemoveButtonMenu(string name)
 {
     MyControlHelper.RemoveButtonMenu(name);
 }
Пример #13
0
 //Add User
 private void pictureBox_AddRunner_Click(object sender, EventArgs e)
 {
     if (newCaseRunner == null)
     {
         bt_loadFile_Click(null, null);
         if (newCaseRunner != null)
         {
             pictureBox_AddRunner_Click(null, null);
         }
     }
     else
     {
         int    tempIndex    = 0;
         int    tempCloneNum = 0;
         string tempName     = tb_runnerName.Text;
         while (myOwner.IsContainRunnerName(tempName))
         {
             tempName = tb_runnerName.Text + "_" + tempIndex;
             tempIndex++;
             if (tempIndex > 1000000)
             {
                 break;
             }
         }
         try
         {
             newCaseRunner.RunerActuator.ExecutiveThinkTime = int.Parse(tb_waitTime.Text);
         }
         catch
         {
             newCaseRunner.RunerActuator.ExecutiveThinkTime = 0;
             MyControlHelper.setRichTextBoxContent(ref rtb_info, "WaitTime Set Error", Color.Red, true);
         }
         try
         {
             tempCloneNum = int.Parse(tb_cloneNum.Text);
         }
         catch
         {
             tempCloneNum = 0;
             MyControlHelper.setRichTextBoxContent(ref rtb_info, "CloneNum Set Error", Color.Red, true);
         }
         newCaseRunner.RunnerName = tempName;
         try
         {
             newCaseRunner.StartCell = (CaseCell)cb_cList.SelectedValue;
         }
         catch
         {
             MyControlHelper.setRichTextBoxContent(ref rtb_info, "StartCell Set Error", Color.Red, true);
         }
         myOwner.AddRunner(newCaseRunner);
         MyControlHelper.setRichTextBoxContent(ref rtb_info, "新用户 " + tempName + "添加成功", Color.Red, true);
         if (tempCloneNum > 0)
         {
             if (tempCloneNum > 200)
             {
                 if (MessageBox.Show("您创建过多的克隆用户,可能需要较长的时间,是否继续?", "Warning", MessageBoxButtons.YesNo) == DialogResult.Yes)
                 {
                     for (int i = 0; i < tempCloneNum; i++)
                     {
                         myOwner.AddRunner(newCaseRunner.Clone(tempName + "#" + i));
                         MyControlHelper.setRichTextBoxContent(ref rtb_info, "新克隆用户 " + tempName + "#" + i + " 添加成功", Color.Red, true);
                     }
                 }
             }
             else
             {
                 for (int i = 0; i < tempCloneNum; i++)
                 {
                     myOwner.AddRunner(newCaseRunner.Clone(tempName + "#" + i));
                     MyControlHelper.setRichTextBoxContent(ref rtb_info, "新克隆用户 " + tempName + "#" + i + " 添加成功", Color.Red, true);
                 }
             }
         }
         tb_cloneNum.Text = "0";
         newCaseRunner    = null;
     }
 }
Пример #14
0
        public void DockMainControl(IMainControl mainControl)
        {
            this.ResetToolbar();
            if (mainControl is Control)
            {
                Control control = mainControl as Control;
                if (!((this._dictTabCtroller == null) || this._dictTabCtroller.ContainsKey("首页")) && mainControl is IDesktop)
                {
                    TabControlController controller2 = new TabControlController
                    {
                        eventHandler  = this._currentEventHandler,
                        CurrentDeptid = _currentDeptId,
                        ModuleId      = "00001",
                        CurrentModule = UserContextManager.userContext.currentWorkstationModule,
                        //  MainController = mainController
                    };
                    control.Text = "首页";
                    this._dictTabCtroller.Add("首页", controller2);
                }

                string text = control.Text;
                if ((this._userContext.MachineConfig.IsMultiAppModule && (this._tabMainControl != null)) && !string.IsNullOrEmpty(text))
                {
                    this._tabMainControl.Visible = true;
                    control.Dock = DockStyle.Fill;
                    Control     control2 = this.panel_main;
                    XtraTabPage page     = new XtraTabPage
                    {
                        Text = text
                    };
                    if (this._dictTabCtroller.ContainsKey(text))
                    {
                        if (this._dictTabCtroller[text].MainTabPage == null)
                        {
                            this._dictTabCtroller[text].MainTabPage = page;
                            this._dictTabCtroller[text].MainControl = mainControl;
                            this._tabMainControl.TabPages.Add(page);
                            page.Tag = control;
                            page.Controls.Add(control);
                            this._tabMainControl.SelectedTabPage = page;
                        }
                        else
                        {
                            if (this._tabMainControl.SelectedTabPage.Equals(this._dictTabCtroller[text].MainTabPage))
                            {
                                TabPageChangedEventArgs e = new TabPageChangedEventArgs(null, this._dictTabCtroller[text].MainTabPage);
                                this._tabMainControl_SelectedPageChanged(this._dictTabCtroller[text].MainTabPage, e);
                            }
                            this._tabMainControl.SelectedTabPage = this._dictTabCtroller[text].MainTabPage;
                        }
                    }
                }
                else
                {
                    //if (this._tabMainControl != null)
                    //{
                    //    this._tabMainControl.Visible = false;
                    //}
                    if (this._currentMainControl != mainControl)
                    {
                        if (this._currentMainControl != null)
                        {
                            Control control3;
                            this._currentMainControl.ClearToolBarButton();
                            control.Visible = false;
                            control.Dock    = DockStyle.Fill;
                            this.panel_main.Controls.Add(control);
                            control.Visible = true;
                            if (!this._userContext.MachineConfig.IsMultiAppModule)
                            {
                                control3 = this._currentMainControl as Control;
                                this.panel_main.Controls.Remove(control3);
                                control3.Dispose();
                            }
                            else if (mainControl is IDesktop)
                            {
                                if (this._currentDesktop != null)
                                {
                                    control3 = this._currentDesktop as Control;
                                    this.panel_main.Controls.Remove(control3);
                                    control3.Dispose();
                                }
                                this._currentDesktop = mainControl as IDesktop;
                            }
                        }
                        else
                        {
                            MyControlHelper.DockControl <IMainControl>(mainControl, this.panel_main, DockStyle.Fill);
                            if (mainControl is IDesktop)
                            {
                                this._currentDesktop = mainControl as IDesktop;
                            }
                        }
                        this._currentMainControl = mainControl;
                    }
                }
            }
        }
 public object GetValue(object dataItem)
 {
     return(MyControlHelper.GetValue());
 }
 public CommonOperator GetOperator()
 {
     return(MyControlHelper.GetOperator());
 }
 public void SetForegroundColor(object dataItem, InfoColor color)
 {
     MyControlHelper.SetForegroundColor(color);
 }
 public void SetBorderColor(object dataItem, InfoColor color)
 {
     MyControlHelper.SetBorderColor(color);
 }
 public void EnableDisable(object dataItem, bool enable)
 {
     MyControlHelper.EnableDisable(enable);
 }
 public void EnableDisable(bool enable)
 {
     MyControlHelper.EnableDisable(enable);
 }
Пример #21
0
 public void DockMainControl(IMainControl mainControl)
 {
     this.ResetToolbar();
     if (mainControl is Control)
     {
         Control control = mainControl as Control;
         string  text    = control.Text;
         if ((this._tabMainControl != null) && !string.IsNullOrEmpty(text))
         {
             this._tabMainControl.Visible = true;
             control.Dock = DockStyle.Fill;
             Control     control2 = this.panel_main;
             XtraTabPage page     = new XtraTabPage
             {
                 Text = text
             };
             if (this._dictTabCtroller.ContainsKey(text))
             {
                 if (this._dictTabCtroller[text].MainTabPage == null)
                 {
                     this._dictTabCtroller[text].MainTabPage = page;
                     this._dictTabCtroller[text].MainControl = mainControl;
                     this._tabMainControl.TabPages.Add(page);
                     page.Tag = control;
                     page.Controls.Add(control);
                     this._tabMainControl.SelectedTabPage = page;
                 }
                 else
                 {
                     if (this._tabMainControl.SelectedTabPage.Equals(this._dictTabCtroller[text].MainTabPage))
                     {
                         TabPageChangedEventArgs e = new TabPageChangedEventArgs(null, this._dictTabCtroller[text].MainTabPage);
                         this._tabMainControl_SelectedPageChanged(this._dictTabCtroller[text].MainTabPage, e);
                     }
                     this._tabMainControl.SelectedTabPage = this._dictTabCtroller[text].MainTabPage;
                 }
             }
         }
         else
         {
             if (this._tabMainControl != null)
             {
                 this._tabMainControl.Visible = false;
             }
             if (this._currentMainControl != mainControl)
             {
                 if (this._currentMainControl != null)
                 {
                     Control control3;
                     this._currentMainControl.ClearToolBarButton();
                     control.Visible = false;
                     control.Dock    = DockStyle.Fill;
                     this.panel_main.Controls.Add(control);
                     control.Visible = true;
                     if (!this._userContext.MachineConfig.IsMultiAppModule)
                     {
                         control3 = this._currentMainControl as Control;
                         this.panel_main.Controls.Remove(control3);
                         control3.Dispose();
                     }
                     else if (mainControl is IDesktop)
                     {
                         if (this._currentDesktop != null)
                         {
                             control3 = this._currentDesktop as Control;
                             this.panel_main.Controls.Remove(control3);
                             control3.Dispose();
                         }
                         this._currentDesktop = mainControl as IDesktop;
                     }
                 }
                 else
                 {
                     MyControlHelper.DockControl <IMainControl>(mainControl, this.panel_main, DockStyle.Fill);
                     if (mainControl is IDesktop)
                     {
                         this._currentDesktop = mainControl as IDesktop;
                     }
                 }
                 this._currentMainControl = mainControl;
             }
         }
     }
 }
 public void AddButtonMenu(object dataItem, ConrolPackageMenu menu)
 {
     MyControlHelper.AddButtonMenu(menu);
 }
 public void SetBinding(object dataItem, EntityInstanceProperty property)
 {
     MyControlHelper.SetBinding(property);
 }
 public void SetReadonly(object dataItem, bool isreadonly)
 {
     MyControlHelper.SetReadonly(isreadonly);
 }
 public bool SetValue(object dataItem, object value)
 {
     return(MyControlHelper.SetValue(value));
 }
 public void AddButtonMenu(ConrolPackageMenu menu)
 {
     MyControlHelper.AddButtonMenu(menu);
 }
 public bool HasOperator()
 {
     return(MyControlHelper.HasOperator());
 }
 public void SetReadonly(bool isreadonly)
 {
     MyControlHelper.SetReadonly(isreadonly);
 }
 public void RemoveButtonMenu(object dataItem, string name)
 {
     MyControlHelper.RemoveButtonMenu(name);
 }