Ejemplo n.º 1
0
 public IWindowImpl(Window b)
 {
     window_ = b;
 }
Ejemplo n.º 2
0
 public WebBrowserExtent(Window win, WebBrowser browser)
 {
     _window = win;
     _browser = browser;
 }
Ejemplo n.º 3
0
        public Menu(Control browser, object config)
        {
            object ownerform = Utility.GetProperty(config, "OwnerForm");
            form_ = (ownerform != null && ownerform.GetType() != typeof(DBNull)) ? (ownerform as Window.IWindowImpl).Form : null;

            menu_ = new ContextMenu();
            object items = Utility.GetProperty(config, "Items");
            int length = Convert.ToInt32(Utility.GetProperty(items, "length"));
            List<MenuItem> menuItems = new List<MenuItem>();
            for (int i = 0; i < length; i++)
            {
                MenuItem menuItem = new MenuItem();
                object item = Utility.GetProperty(items, i.ToString());
                string id = Utility.GetProperty(item, "ID").ToString();
                object data = Convert.ToBoolean(Utility.InvokeMethod(item, "hasOwnProperty", "Data")) ? Utility.GetProperty(item, "Data") : null;
                menuItem.Index = i;
                MenuTag tag = new MenuTag();
                tag.ID = id;
                tag.Data = data;
                if (String.IsNullOrEmpty(id))
                {
                    menuItem.Text = "-";
                    menuItem.Tag = tag;
                }
                else
                {
                    string text = Utility.GetProperty(item, "Text").ToString();
                    menuItem.Text = text;
                    menuItem.Tag = tag;
                }
                menuItem.Click += new System.EventHandler(this.menuItem_Click);
                menuItems.Add(menuItem);
            }
            menu_.MenuItems.AddRange(menuItems.ToArray());
        }