예제 #1
0
 public override void Add(Widget widget)
 {
     if (this.widget != null) {
         throw new Exception("SimplePanel can only contain one child widget");
     }
     this.Widget = widget;
 }
예제 #2
0
파일: Panel.cs 프로젝트: JimmyJune/DotWeb
 protected void Orphan(Widget child)
 {
     //assert (child.getParent() == this);
     child.Parent = null;
 }
예제 #3
0
파일: Panel.cs 프로젝트: JimmyJune/DotWeb
 protected void Adopt(Widget child)
 {
     //assert(child.getParent() == null);
     child.Parent = this;
 }
예제 #4
0
파일: Panel.cs 프로젝트: JimmyJune/DotWeb
 public abstract bool Remove(Widget widget);
예제 #5
0
파일: Panel.cs 프로젝트: JimmyJune/DotWeb
 public virtual void Add(Widget widget)
 {
     throw new NotImplementedException();
 }
예제 #6
0
        public override bool Remove(Widget widget)
        {
            if (this.widget != widget) {
                return false;
            }

            Orphan(widget);

            this.Element.removeChild(widget.Element);

            this.widget = null;

            return true;
        }
예제 #7
0
        protected virtual void InitWidget(Widget widget)
        {
            if (this.Widget != null) {
                throw new /*IllegalState*/Exception("Composite.initWidget() may only be called once.");
            }

            //widget.removeFromParent();

            // Use the contained widget's element as the composite's element,
            // effectively merging them within the DOM.
            this.Element = widget.Element;

            this.Widget = widget;

            widget.Parent = this;
        }