Ejemplo n.º 1
0
 //ReinsertPiece
 /// <summary>
 /// When a piece is displayed in a screen, the related controls are removed from the VisualPart that contained the piece
 /// This method adds the said removed controls in the right place anew
 /// </summary>
 /// <param name="name">the name of the piece that had been displayed</param>
 public void ReinsertPiece(string name)
 {
     VisualPart piece = Pieces[name].Item1;
     foreach(string container in Pieces[name].Item2.Keys)
     {
         VPPanel master = GetPanel(container);
         VPPanel slave = piece.GetPanel(Pieces[name].Item2[container]);
         if(!master.Controls.Contains(slave))
         {
             master.Controls.Add(slave);
         }
     }
 }