Beispiel #1
0
 /// <summary>
 /// Constructs a sheet by calling <see cref="M:Northwoods.Go.GoSheet.CreatePaper" />,
 /// <see cref="M:Northwoods.Go.GoSheet.CreateBackgroundImage" />, and <see cref="M:Northwoods.Go.GoSheet.CreateGrid" />.
 /// </summary>
 public GoSheet()
 {
     base.Initializing = true;
     myPaper           = CreatePaper();
     Add(myPaper);
     myBackgroundImage = CreateBackgroundImage();
     Add(myBackgroundImage);
     myGrid = CreateGrid();
     Add(myGrid);
     myLeft = MakeBoundary();
     Add(myLeft);
     myRight = MakeBoundary();
     Add(myRight);
     myTop = MakeBoundary();
     Add(myTop);
     myBottom = MakeBoundary();
     Add(myBottom);
     base.Initializing = false;
     LayoutChildren(null);
 }
Beispiel #2
0
        /// <summary>
        /// Update the internal reference fields when a child object is removed.
        /// </summary>
        /// <param name="obj"></param>
        public override bool Remove(GoObject obj)
        {
            bool result = base.Remove(obj);

            if (obj == myPaper)
            {
                myPaper = null;
                return(result);
            }
            if (obj == myBackgroundImage)
            {
                myBackgroundImage = null;
                return(result);
            }
            if (obj == myGrid)
            {
                myGrid = null;
                return(result);
            }
            if (obj == myLeft)
            {
                myLeft = null;
                return(result);
            }
            if (obj == myRight)
            {
                myRight = null;
                return(result);
            }
            if (obj == myTop)
            {
                myTop = null;
                return(result);
            }
            if (obj == myBottom)
            {
                myBottom = null;
            }
            return(result);
        }