コード例 #1
0
 private void menuItemTemplateModify_Click(object sender, EventArgs e)
 {
     if (this.listViewProcessTemplate.SelectedItems.Count > 0)
     {
         string text = this.listViewProcessTemplate.SelectedItems[0].Text;
         foreach (RCProcess rcprocess in this.processTemplateCollection)
         {
             if (rcprocess.Name == text)
             {
                 ProcessPropertyForm processPropertyForm = new ProcessPropertyForm(rcprocess, 0, true, false);
                 while (processPropertyForm.ShowDialog() == DialogResult.OK)
                 {
                     try
                     {
                         this.ModifyTemplate(processPropertyForm.RCProcess, this.listViewProcessTemplate.SelectedIndices[0]);
                         this._modified = true;
                         break;
                     }
                     catch (ArgumentException ex)
                     {
                         Utility.ShowErrorMessage(LocalizeText.Get(331) + ex.Message);
                     }
                 }
                 break;
             }
         }
     }
 }
コード例 #2
0
        private void menuItemProcessAdd_Click(object sender, EventArgs e)
        {
            if (this.calculateThread != null)
            {
                return;
            }
            ProcessPropertyForm processPropertyForm = new ProcessPropertyForm(this.processTemplateCollection);

            if (processPropertyForm.ShowDialog(this) == DialogResult.OK)
            {
                ControlRequestMessage controlRequestMessage = new ControlRequestMessage(SerializeWriter.ToBinary <AddProcessMessage>(new AddProcessMessage(processPropertyForm.RCProcess)).Bytes);
                bool flag = false;
                foreach (object obj in this.listViewRCClient.SelectedItems)
                {
                    RCClientControl.ClientItem clientItem = (RCClientControl.ClientItem)obj;
                    try
                    {
                        clientItem.AddProcess(processPropertyForm.RCProcess);
                        controlRequestMessage.AddClientID(clientItem.ID);
                    }
                    catch (ArgumentException)
                    {
                        flag = true;
                    }
                }
                this.messageList.Add(controlRequestMessage);
                if (flag)
                {
                    Utility.ShowErrorMessage(LocalizeText.Get(343));
                }
                this.RecalculateCommonProcess();
            }
        }
コード例 #3
0
        private void menuItemTemplateNew_Click(object sender, EventArgs e)
        {
            ProcessPropertyForm processPropertyForm = new ProcessPropertyForm(this.processTemplateCollection);

            while (processPropertyForm.ShowDialog() == DialogResult.OK)
            {
                try
                {
                    this.AddTemplate(processPropertyForm.RCProcess);
                    this._modified = true;
                    break;
                }
                catch (ArgumentException ex)
                {
                    Utility.ShowErrorMessage(LocalizeText.Get(330) + ex.Message);
                }
            }
        }
コード例 #4
0
 private void menuItemProcessProperty_Click(object sender, EventArgs e)
 {
     if (this.listViewProcess.SelectedItems.Count == 1 && this.calculateThread == null)
     {
         bool multEdit = this.listViewRCClient.SelectedItems.Count > 1;
         int  num      = 8;
         foreach (object obj in this.listViewRCClient.SelectedItems)
         {
             RCClientControl.ClientItem clientItem = (RCClientControl.ClientItem)obj;
             if (clientItem.Version < num)
             {
                 num = clientItem.Version;
             }
         }
         ProcessPropertyForm processPropertyForm = new ProcessPropertyForm(((RCClientControl.ProcessItem) this.listViewProcess.SelectedItems[0]).Process, num, true, multEdit);
         if (processPropertyForm.ShowDialog() == DialogResult.OK)
         {
             bool flag = this.listViewRCClient.SelectedItems.Count == 1;
             foreach (object obj2 in this.listViewRCClient.SelectedItems)
             {
                 RCClientControl.ClientItem clientItem2 = (RCClientControl.ClientItem)obj2;
                 ModifyProcessMessage       value;
                 if (flag)
                 {
                     value = new ModifyProcessMessage(processPropertyForm.RCProcess);
                     clientItem2.ModifyProcess(processPropertyForm.RCProcess);
                 }
                 else
                 {
                     RCProcess process = clientItem2.ModifyProcessWithoutPrimaryInfo(processPropertyForm.RCProcess);
                     value = new ModifyProcessMessage(process);
                 }
                 ControlRequestMessage controlRequestMessage = new ControlRequestMessage(SerializeWriter.ToBinary <ModifyProcessMessage>(value).Bytes);
                 controlRequestMessage.AddClientID(clientItem2.ID);
                 this.messageList.Add(controlRequestMessage);
             }
         }
         this.RecalculateCommonProcess();
     }
 }