示例#1
0
 private void ShowComponents()
 {
     // do not show over top of context menu
     if (this.ContextMenuStrip?.Visible ?? false)
     {
         return;
     }
     // only show item components if content is an item
     if (this.Type == DataTypes.ItemBuy || this.Type == DataTypes.Item)
     {
         ItemInfo item = this.drop as ItemInfo;
         if (item != null && item.ComponentIDs.Length > 0)
         {
             // drop slot area
             Rectangle rect = this.ClientRectangle;
             rect.Location = this.PointToScreen(rect.Location);
             // show form
             this.componentsForm = new formItemComponents(item, rect);
             this.componentsForm.VisibleChanged += this.formItemComponents_VisibleChanged;
             this.componentsForm.FormClosing    += this.formItemComponents_FormClosing;
             this.componentsForm.Show(this);
             this.componentsForm.Location = this.Parent.PointToScreen(new Point(this.Left - this.componentsForm.Width / 2 + this.Width / 2, this.Bottom - 1));
         }
     }
     return;
 }
示例#2
0
        private void UpdateOwner()
        {
            formItemComponents owner = this.Parent as formItemComponents;

            if (owner != null)
            {
                owner.ChildrenVisible = this.componentsForm != null && this.componentsForm.Visible;
            }
            return;
        }