Esempio n. 1
0
        public Document(IWindow parentWindow)
            : base("document", (UserControl)parentWindow)
        {
            _parentWindow = parentWindow;

            Visible = true;

            //init body
            body = new HTMLElement("body", this);
            //init sizes
            ((UserControl) body).Width = this.Width = parentWindow.innerWidth;
            ((UserControl) body).Height = this.Height = parentWindow.innerHeight;
            appendChild(body);
            //(body as UserControl).BackColor = Color.Yellow;

            Name = "document";
            this.ControlAdded += new ControlEventHandler(Document_ControlAdded);
            this.Resize += new EventHandler(Document_Resize);
        }
Esempio n. 2
0
 public object createElement(string tagName)
 {
     tagName = tagName.ToUpper();
     object element;
     switch (tagName)
     {
         case "CANVAS":
             {
                 element = new CanvasProxy();
                 //CloneEvents(element, this._events);
                 break;
             }
         case "WINDOW":
             {
                 element = new WindowProxy(this);
                 break;
             }
         case "IFRAME":
             {
                 element = new IFrame(this._parentWindow);
                 break;
             }
         default:
             {
                 element = new HTMLElement(tagName, this);
                 ((HTMLElement)element).SetParent(this);
                 //this.appendChild((HTMLElement)element);
                 break;
             }
     }
     return element;
 }