Beispiel #1
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();
            }
        }
Beispiel #2
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);
        }
Beispiel #3
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);
        }
Beispiel #4
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);
         }
     }
 }