Пример #1
0
 private void btnAddOperation_Click(object sender, EventArgs e)
 {
     this.DialogResult = DialogResult.None;
     frmItemsList frm = new frmItemsList();
     frm.application = this.item.Application;
     frm.item = this.item;
     frm.itemType = ItemType.Operation;
     DialogResult dr = frm.ShowDialog(this);
     if (dr == DialogResult.OK)
     {
         foreach (IAzManItem item in frm.selectedItems)
         {
             if (!this.MembersToRemove.Contains(item.Name))
             {
                 if (!this.MembersToAdd.Contains(item.Name) && !this.FindMember(this.item.GetMembers(), item.Name))
                 {
                     this.MembersToAdd.Add(item.Name);
                     this.modified = true;
                 }
             }
             else
             {
                 this.MembersToRemove.Remove(item.Name);
             }
         }
         this.RefreshItems();
     }
     this.HourGlass(false);
 }
Пример #2
0
        private void btnAddTask_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.None;
            frmItemsList frm = new frmItemsList();

            frm.application = this.item.Application;
            frm.item        = this.item;
            frm.itemType    = ItemType.Task;
            DialogResult dr = frm.ShowDialog(this);

            if (dr == DialogResult.OK)
            {
                foreach (IAzManItem item in frm.selectedItems)
                {
                    if (!this.MembersToRemove.Contains(item.Name))
                    {
                        if (!this.MembersToAdd.Contains(item.Name) && !this.FindMember(this.item.GetMembers(), item.Name))
                        {
                            this.MembersToAdd.Add(item.Name);
                            this.modified = true;
                        }
                    }
                    else
                    {
                        this.MembersToRemove.Remove(item.Name);
                    }
                }
                this.RefreshItems();
            }
            this.HourGlass(false);
        }