コード例 #1
0
ファイル: GUIGroup.cs プロジェクト: weimingtom/OtterUI
        /// <summary>
        /// Clones (deep copies) the GUI Window
        /// </summary>
        /// <returns></returns>
        public override object Clone()
        {
            GUIGroup ret = new GUIGroup();

            if (ret == null)
            {
                throw new OutOfMemoryException("GUIGroup.Clone() failed its allocation.");
            }

            // GUIControl level copy
            ret.ID          = this.ID;
            ret.Name        = this.Name;
            ret.Layout      = this.Layout.Clone() as GroupLayout;
            ret.Scene       = this.Scene;
            ret.Parent      = this.Parent;
            ret.AnchorFlags = this.AnchorFlags;
            ret.Mask        = this.Mask;

            // GUIWindow level copy
            ret.Color = this.Color;

            foreach (GUIControl control in Controls)
            {
                ret.Controls.Add((GUIControl)control.Clone());
            }

            return(ret);
        }
コード例 #2
0
ファイル: GUIGroup.cs プロジェクト: RasterCode/OtterUI
        /// <summary>
        /// Clones (deep copies) the GUI Window
        /// </summary>
        /// <returns></returns>
        public override object Clone()
        {
            GUIGroup ret = new GUIGroup();
            if (ret == null)
                throw new OutOfMemoryException("GUIGroup.Clone() failed its allocation.");

            // GUIControl level copy
            ret.ID              = this.ID;
            ret.Name            = this.Name;
            ret.Layout          = this.Layout.Clone() as GroupLayout;
            ret.Scene           = this.Scene;
            ret.Parent          = this.Parent;
            ret.AnchorFlags     = this.AnchorFlags;
            ret.Mask            = this.Mask;

            // GUIWindow level copy
            ret.Color           = this.Color;

            foreach (GUIControl control in Controls)
            {
                ret.Controls.Add((GUIControl)control.Clone());
            }

            return ret;
        }