public void removeFrom(Control.ControlCollection controls)
 {
     controls.Remove(depthTextBox);
     controls.Remove(statusLabel);
     controls.Remove(amountTextBox);
     controls.Remove(deleteCheckBox);
 }
Exemplo n.º 2
0
        private void RemoveView(int uid)
        {
            foreach (Object view in ViewList)
            {
                if (view is ViewBox)
                {
                    ViewBox viewType = (ViewBox)view;

                    if (viewType.Uid == uid)
                    {
                        ViewList.Remove(viewType);
                        break;
                    }
                }

                else if (view is ViewCupboard)
                {
                    ViewCupboard viewType = (ViewCupboard)view;

                    if (viewType.Uid == uid)
                    {
                        ViewList.Remove(viewType);
                        break;
                    }
                }
            }
        }
Exemplo n.º 3
0
        public void InitializeMarkerControls(IList <double> xValues, IList <double> yValues)
        {
            DataCount = xValues.Count;
            while (Markers.Count < DataCount)
            {
                MarkerControl markerControl = new MarkerControl();
                markerControl.Paint      += PaintMarker;
                markerControl.MouseEnter += ShowMarkerValue;
                markerControl.MouseLeave += HideMarkerValue;
                _container.Add(markerControl);
                Markers.Add(markerControl);
            }
            int removeIndex = Markers.Count - 1;

            while (Markers.Count > DataCount)
            {
                MarkerControl removedMarker = Markers[removeIndex];
                _container.Remove(removedMarker);
                removedMarker.Dispose();
                Markers.RemoveAt(removeIndex);
            }
            for (int i = 0; i < DataCount; i++)
            {
                if (Markers[i].Height != MarkerSize)
                {
                    Markers[i].Width  = MarkerSize;
                    Markers[i].Height = MarkerSize;
                }
                Markers[i].XValue = xValues[i];
                Markers[i].YValue = yValues[i];
            }
        }
Exemplo n.º 4
0
        public void goUp(Map map, Control.ControlCollection Controls)
        {
            int[] heroPosition = map.findHeroPosition();
            Part  help;
            Part  help2;
            Part  toRemove;

            if (map.getPart(heroPosition[0] - 1, heroPosition[1]).GetType() == typeof(Wall)) //gdy na prawo bedzie sciana
            {
                return;
            }

            if (map.getPart(heroPosition[0] - 1, heroPosition[1]).GetType() == typeof(Floor)) //gdy na prawo bedzie podloga
            {
                help = map.getPart(heroPosition[0] - 1, heroPosition[1]);
                map.setPart(map.getPart(heroPosition[0], heroPosition[1]), heroPosition[0] - 1, heroPosition[1]);
                map.setPart(help, heroPosition[0], heroPosition[1]);
                map.getPart(heroPosition[0] - 1, heroPosition[1]).setPosition(map.getPart(heroPosition[0] - 1, heroPosition[1]).getX(), map.getPart(heroPosition[0] - 1, heroPosition[1]).getY() - 64);
                map.getPart(heroPosition[0], heroPosition[1]).setPosition(map.getPart(heroPosition[0], heroPosition[1]).getX(), map.getPart(heroPosition[0], heroPosition[1]).getY() + 64);

                incrementNumberSteps();
            }


            if (map.getPart(heroPosition[0] - 1, heroPosition[1]).GetType() == typeof(Box))                                                                                          //gdy na prawo bedzie skrzynka
            {
                if (map.getPart(heroPosition[0] - 2, heroPosition[1]).GetType() == typeof(Floor) || map.getPart(heroPosition[0] - 2, heroPosition[1]).GetType() == typeof(BoxPoint)) //sprawdz czy mozna przesunac skrzynke(podloga lub punkt)
                {
                    help = map.getPart(heroPosition[0], heroPosition[1]);
                    map.setPart(Factory.produceFloor(heroPosition[1] * 64, heroPosition[0] * 64, map.getStyle()), heroPosition[0], heroPosition[1]);
                    Controls.Add(map.getPart(heroPosition[0], heroPosition[1]).picturebox);
                    help2 = map.getPart(heroPosition[0] - 1, heroPosition[1]);// = 5;
                    map.setPart(help, heroPosition[0] - 1, heroPosition[1]);
                    toRemove = map.getPart(heroPosition[0] - 2, heroPosition[1]);
                    map.setPart(help2, heroPosition[0] - 2, heroPosition[1]);
                    map.getPart(heroPosition[0] - 1, heroPosition[1]).setPosition(map.getPart(heroPosition[0] - 1, heroPosition[1]).getX(), map.getPart(heroPosition[0] - 1, heroPosition[1]).getY() - 64);
                    map.getPart(heroPosition[0] - 2, heroPosition[1]).setPosition(map.getPart(heroPosition[0] - 2, heroPosition[1]).getX(), map.getPart(heroPosition[0] - 2, heroPosition[1]).getY() - 64);
                    Controls.Remove(toRemove.picturebox);

                    incrementNumberSteps();
                }
                else
                {
                }
            }

            if (map.getPart(heroPosition[0] - 1, heroPosition[1]).GetType() == typeof(BoxPoint)) //gdy na prawo bedzie punkt
            {
                help = map.getPart(heroPosition[0], heroPosition[1]);
                map.setPart(Factory.produceFloor(heroPosition[1] * 64, heroPosition[0] * 64, map.getStyle()), heroPosition[0], heroPosition[1]);
                Controls.Add(map.getPart(heroPosition[0], heroPosition[1]).picturebox);
                toRemove = map.getPart(heroPosition[0] - 1, heroPosition[1]);
                map.setPart(help, heroPosition[0] - 1, heroPosition[1]);
                map.getPart(heroPosition[0] - 1, heroPosition[1]).setPosition(map.getPart(heroPosition[0] - 1, heroPosition[1]).getX(), map.getPart(heroPosition[0] - 1, heroPosition[1]).getY() - 64);
                Controls.Remove(toRemove.picturebox);

                incrementNumberSteps();
            }
            addBoxPoints(map, Controls);
        }
Exemplo n.º 5
0
        public void MakeBoom(Control x, Control.ControlCollection Controls, Point point, Game game)
        {
            var timer = new Timer()
            {
                Interval = 500
            };

            x.Size = new Size(300, 300);
            var location = new Point(point.X - x.Size.Width / 2, point.Y - x.Size.Height / 2);

            boom.Location = location;
            Controls.Add(boom);
            Controls.Remove(x);
            x.Tag = "bombPB";
            Sound.bomb.Play();
            for (var i = 0; i < Controls.Count; i++)
            {
                if ((string)Controls[i].Tag == "enemies" && boom.Bounds.IntersectsWith(Controls[i].Bounds))
                {
                    Controls.Remove(Controls[i]);
                    game.Score    += 1;
                    i             -= 1;
                    game.TotalSum += 1;
                    game.Shooting  = false;
                }
            }
            timer.Start();
            timer.Tick += (sender, e) =>
            {
                Controls.Remove(boom);
                timer.Stop();
            };
        }
Exemplo n.º 6
0
        public static bool Collision(PictureBox ball, Control c, Control.ControlCollection control)
        {
            if (ball.Bounds.IntersectsWith(c.Bounds))
            {
                control.Remove(ball);
                control.Remove(c);
                return(false);
            }

            return(true);
        }
Exemplo n.º 7
0
 public void RemovePrevious(Dictionary <TextBox, ListBox> lists, Control.ControlCollection Controls)
 {
     if (lists != null)
     {
         foreach (var remove in lists)
         {
             Controls.Remove(remove.Key);
             Controls.Remove(remove.Value);
         }
     }
 }
Exemplo n.º 8
0
        private void buttonImport_Click(object sender, EventArgs e)
        {
            var form = new ImportMode(modFilter, playerItemDao, sm)
            {
                TopLevel = false
            };

            parentContainer.Add(form);
            parentContainer.Remove(this);
            form.Show();
            this.Close();
        }
Exemplo n.º 9
0
 private void Click_RemoveToBlendPanel(object ss, EventArgs ee, Control.ControlCollection cc2, PictureBox pbx, int index)
 {//when you click a picture in the left panel it gets rem,oved from the panel and from the list box in the left bottom part
     cc2.Remove(pbx);
     updateItem(index, 0, itemList[index].quantity + 1, itemList[index].soldCount - 1, ite);
     rtbxDetails.Text = "Name: " + itemList[index].name + "\nQuantity: " + itemList[index].quantity + "\nCost: $" + itemList[index].cost;
     displayRecipt();
 }
Exemplo n.º 10
0
        public static IEnumerable <TControl> RenderControlList <TModel, TKey, TControl>(this IEnumerable <TModel> models, Control.ControlCollection controls, Func <TModel, int, TKey> key, Func <TModel, int, TControl> builder) where TControl : Control
        {
            var existingKeys = controls.OfType <Control>().Where(x => x.Tag is ControlKey).ToDictionary(x => ((ControlKey)x.Tag).Key);
            var index        = 0;
            var result       = new List <TControl>();

            foreach (var m in models)
            {
                var k = key(m, index);
                if (existingKeys.TryGetValue(k, out Control c))
                {
                    // not build again
                    existingKeys.Remove(k);
                }
                else
                {
                    c     = builder(m, index);
                    c.Tag = new ControlKey(k);
                    controls.Add(c);
                }

                controls.SetChildIndex(c, index);
                index++;
                result.Add((TControl)c);
            }

            // remove unused controls
            foreach (var value in existingKeys.Values)
            {
                controls.Remove(value);
            }

            return(result);
        }
Exemplo n.º 11
0
        protected void ShowInvalidState()
        {
            this.SuspendLayout();

            Control.ControlCollection ctls = this.Controls;
            for (int i = ctls.Count - 1; i >= 0; i--)
            {
                Control ctl = ctls[i];
                if (!object.ReferenceEquals(ctl, this.btnCancel) && !object.ReferenceEquals(ctl, this.pnlTitle) && !object.ReferenceEquals(ctl, this.lineAction))
                {
                    ctls.Remove(ctl);
                    ctl.Dispose();
                }
            }

            Label lblMsg = new Label();

            lblMsg.Name        = "lblMsg";
            lblMsg.Text        = "Invalid object state!";
            lblMsg.UseMnemonic = false;
            lblMsg.BorderStyle = BorderStyle.None;
            lblMsg.Location    = new Point(12, this.lblTitle.Height + 12);
            lblMsg.Size        = new Size(this.ClientSize.Width - 24, this.ClientSize.Height - this.btnCancel.Height - this.lblTitle.Height - 30);
            lblMsg.Anchor      = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Bottom | AnchorStyles.Right;

            if (this.mEntity != null)
            {
                this.Text = this.mEntity.GetType().Name;
            }
            this.btnCancel.Text = "&Close";

            this.Controls.Add(lblMsg);
            this.ResumeLayout(false);
        }
Exemplo n.º 12
0
        public static void Remove(Control.ControlCollection coll, Control item)
        {
            if ((coll != null) && (item != null))
            {
                Button tempButton = null;
                Form   parentForm = item.FindForm();

                if (parentForm != null)
                {
                    // Create a hidden, temporary button
                    tempButton         = new Button();
                    tempButton.Visible = false;

                    // Add this temporary button to the parent form
                    parentForm.Controls.Add(tempButton);

                    // Must ensure that temp button is the active one
                    parentForm.ActiveControl = tempButton;
                }

                // Remove our target control
                coll.Remove(item);

                if (parentForm != null)
                {
                    // Remove the temporary button
                    tempButton.Dispose();
                    parentForm.Controls.Remove(tempButton);
                }
            }
        }
Exemplo n.º 13
0
 public void ClearRedGhost()
 {
     lock (this)
     {
         c.Remove(redGhost);
     }
 }
Exemplo n.º 14
0
        public UserControl UcSetting = new UserControl(); // holds current settings user control

        private void treeView1_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)
        {
            if (e.Button != MouseButtons.Left)
            {
                return;
            }

            var tmp = new UserControl();

            switch (e.Node.Name)
            {
            case "General":     // General
                tmp = new General();
                break;

            case "AutoPos":     // Auto postion
                tmp = new AutoPosition();
                break;

            case "PingCheck":
            case "ConnectionCheck":
                tmp = new SettingsTree.ConnectionCheck();
                break;

            case "IpHostCheck":
                tmp = new IpHostCheck();
                break;

            case "AntiIdle":
                tmp = new AntiIdle();
                break;

            case "ProfileKickstart":
                tmp = new ProfileKickstart();
                break;

            case "HotKeys":
                tmp = new HotKeys();
                break;

            case "Stats":
                tmp = new Stats();
                break;
            }

            // Check if new user control should be displayed
            if (!tmp.Name.Equals(UcSetting.Name))
            {
                //var c = tabControl1.TabPages[1].Controls;
                Control.ControlCollection c = SettingsPanel.Controls;
                if (c.Contains(UcSetting))
                {
                    c.Remove(UcSetting);
                }

                UcSetting = tmp;
                //_ucSetting.Left = 180;
                c.Add(UcSetting);
            }
        }
Exemplo n.º 15
0
 public static void Remove(this Control.ControlCollection c, params Control[] controls)
 {
     foreach (Control thing in controls)
     {
         c.Remove(thing);
     }
 }
Exemplo n.º 16
0
        protected override void AddFilterPanel(string text, object viewSiteControl)
        {
            Control.ControlCollection controlCollection = ((Control)viewSiteControl).Controls;
            if (string.IsNullOrEmpty(text))
            {
                FilterPanel filterPanel = controlCollection.OfType <FilterPanel>().FirstOrDefault();
                if (filterPanel != null)
                {
                    controlCollection.Remove(filterPanel);
                }
            }
            else
            {
                var filterPanel = new FilterPanel {
                    BackColor   = Color.LightGoldenrodYellow,
                    Dock        = DockStyle.Bottom,
                    MaxRows     = 25,
                    TabIndex    = 0,
                    TabStop     = false,
                    MinimumSize = new Size(350, 33),
                    Text        = text
                };

                Control.ControlCollection collection = controlCollection;
                collection.Add(filterPanel);
            }
        }
Exemplo n.º 17
0
 public void CleanTable <TGroupsLabels>(Control.ControlCollection Controls, TGroupsLabels labels) where TGroupsLabels : IEnumerable <Control>
 {
     foreach (var groupLabel in labels)
     {
         Controls.Remove(groupLabel);
     }
 }
Exemplo n.º 18
0
 private static void RemoveCardButtons(Control.ControlCollection controls)
 {
     foreach (var control in controls.Find(CardButtonName, true))
     {
         controls.Remove(control);
     }
 }
Exemplo n.º 19
0
        private void DoHideProgress()
        {
            ProgressFrame ef = FindFrame();

            if (ef != null)
            {
                Collection.Remove(ef);
                ef.Dispose();
            }

            foreach (Control ctrl in Collection)
            {
                if (ctrl is ToolStrip)
                {
                    continue;
                }
                bool?vis = null;
                if (m_forceVisibility != null)
                {
                    vis = m_forceVisibility(ctrl);
                }
                ctrl.Visible = vis ?? true;
            }

            ProgressVisible = false;
        }
Exemplo n.º 20
0
 /// <summary>
 /// Remove specified child item from the provided control collection.
 /// </summary>
 /// <param name="coll">Control collection that child item needs to be removed from.</param>
 /// <param name="item">Child control to remove from collection.</param>
 public static void Remove(Control.ControlCollection coll, Control item)
 {
     if ((coll != null) && (item != null))
     {
         // Remove our target control
         coll.Remove(item);
     }
 }
Exemplo n.º 21
0
 public void RemoveAll(PictureBox[] enemies, Control.ControlCollection Controls)
 {
     foreach (var i in enemies)
     {
         Controls.Remove(i);
     }
     foreach (Control x in Controls)
     {
         if ((string)x.Tag == "peas" || (string)x.Tag == "enemyPeas" || (string)x.Tag == "peasLeft" ||
             (string)x.Tag == "peasCenter" || (string)x.Tag == "peasRight" || (string)x.Tag == "peasCenter" ||
             (string)x.Tag == "explosion" || (string)x.Tag == "bonusTriple" || (string)x.Tag == "bonusBomb" ||
             (string)x.Tag == "3")
         {
             Controls.Remove(x);
         }
     }
 }
Exemplo n.º 22
0
 static public void MeDelete(Control.ControlCollection cons, WizItemSelect cmb)
 {
     if (cons.Count <= 0)
     {
         return;
     }
     cons.Remove(cmb);
     cmb.Dispose();
 }
Exemplo n.º 23
0
 static public void ClearContainer(Control.ControlCollection controls)
 {
     while (controls.Count > 0)
     {
         Control c = controls[0];
         controls.Remove(c);
         c.Dispose();
     }
 }
Exemplo n.º 24
0
 public static void DeletePictureBox(Control.ControlCollection controlCol, string type)
 {
     foreach (Control control in controlCol)
     {
         if (control.Name.Contains("createPicBox_" + type))
         {
             controlCol.Remove(control);
         }
     }
 }
Exemplo n.º 25
0
 private void RemoveControlFrom(Control.ControlCollection controls, string controlname)
 {
     foreach (Control control in controls)
     {
         if (control.Name.ToLower() == controlname.ToLower())
         {
             controls.Remove(control); controls.Owner.Update();
         }
     }
 }
Exemplo n.º 26
0
 private void RemoveView(int uid)
 {
     foreach (Kitbox.GUI.ViewCupboard view in ViewCupboardList)
     {
         if (view.Uid == uid)
         {
             ViewCupboardList.Remove(view);
             break;
         }
     }
 }
Exemplo n.º 27
0
 void RemoveControlTaoGuan(Control.ControlCollection list)
 {
     //套管减少的函数
     foreach (Control ctrl in list)
     {
         if (ctrl is Label)
         {
             if (string.Equals(ctrl.Text, "套管" + TaoGuan))
             {
                 list.Remove(ctrl);
                 TaoGuan--;
                 break;
             }
         }
     }
     foreach (Control ctrl in list)
     {
         if (ctrl is HZH_Controls.Controls.UCTextBoxEx)
         {
             if (string.Equals(ctrl.Name, "ucTextBoxEx" + FirstTextBoxTaoGuan))
             {
                 list.Remove(ctrl);
                 FirstTextBoxTaoGuan = FirstTextBoxTaoGuan - 5;;
                 break;
             }
         }
     }
     foreach (Control ctrl in list)
     {
         if (ctrl is HZH_Controls.Controls.UCTextBoxEx)
         {
             if (string.Equals(ctrl.Name, "ucTextBoxEx" + SecondTextBoxTaoGuan))
             {
                 list.Remove(ctrl);
                 SecondTextBoxTaoGuan = SecondTextBoxTaoGuan - 5;
                 break;
             }
         }
     }
 }
Exemplo n.º 28
0
        /// <summary>
        /// 퍼즐 조각을 삭제 합니다.
        /// </summary>
        /// <param name="controls">삭제할 컨트롤의 모임</param>
        public void RemovePiece(Control.ControlCollection controls)
        {
            int n = 0;

            for (int i = 0; i < pieceNum; i++)
            {
                for (int j = 0; j < pieceNum; j++)
                {
                    n++;

                    controls.Remove(this.piece[i, j]);
                }
            }
        }
Exemplo n.º 29
0
        public void MoveTriple(Control.ControlCollection Controls, Game game)
        {
            foreach (Control x in Controls)
            {
                if ((string)x.Tag == "peasLeft")
                {
                    x.Top  -= 20;
                    x.Left += 10; //5
                    if (x.Top < 15)
                    {
                        Controls.Remove(x);
                        game.Shooting = false;
                    }
                }

                if ((string)x.Tag == "peasCenter")
                {
                    x.Top -= 20;
                    if (x.Top < 15)
                    {
                        Controls.Remove(x);
                        game.Shooting = false;
                    }
                }

                if ((string)x.Tag == "peasRight")
                {
                    x.Top  -= 20;
                    x.Left -= 10; //5
                    if (x.Top < 15)
                    {
                        Controls.Remove(x);
                        game.Shooting = false;
                    }
                }
            }
        }
Exemplo n.º 30
0
        //metoda do uzupelnienia brakujacych BoxPointow
        public void addBoxPoints(Map map, Control.ControlCollection Controls)
        {
            foreach (Point p in map.getPointList())
            {
                if (map.getPart(p.X, p.Y).GetType() == typeof(Floor))
                {
                    int  x        = map.getPart(p.X, p.Y).getX();
                    int  y        = map.getPart(p.X, p.Y).getY();
                    Part toRemove = map.getPart(p.X, p.Y);

                    map.setPart(Factory.produceBoxPoint(x, y, map.getStyle()), p.X, p.Y);
                    Controls.Add(map.getPart(p.X, p.Y).picturebox);
                    Controls.Remove(toRemove.picturebox);
                }
            }
        }