Esempio n. 1
0
        public override void Initialize(EditorService service)
        {
            base.Initialize(service);

            MenuModule menuModule = EditorService.Instance.QueryModule<MenuModule>();
            Menu.MenuItem catalog = new Menu.MenuItem();
            catalog.Name = "资源";
            catalog.Index = 3;
            menuModule.AddMenuItem("", catalog);
            Menu.MenuItem item1 = new Menu.MenuItem();
            item1.Name = "图片";
            item1.Index = 0;
            item1.Command = menuCommand_Image;
            menuModule.AddMenuItem("资源", item1);
            Menu.MenuItem item2 = new Menu.MenuItem();
            item2.Name = "声音";
            item2.Index = 1;
            item2.Command = menuCommand_Sound;
            menuModule.AddMenuItem("资源", item2);
            Menu.MenuItem item3 = new Menu.MenuItem();
            item3.Name = "自动编译资源";
            item3.Index = 0;
            item3.StateChanged = menuState_ResAutoCompile;
            menuModule.AddMenuItem("资源", item3);
        }
Esempio n. 2
0
 private Menu.MenuItem GetSubMenu(MenuList parent, string[] paths)
 {
     if (paths != null && paths.Length > 0)
     {
         var subMenu = parent.Where(m => string.Equals(m.path, paths[0], StringComparison.OrdinalIgnoreCase)).FirstOrDefault();
         if (subMenu == null)
         {
             subMenu = new Menu.MenuItem {
                 path = paths[0]
             };
             parent.Add(subMenu);
         }
         if (paths.Length > 2 /*&& !string.Equals(paths[1], "list", StringComparison.OrdinalIgnoreCase)*/)
         {
             return(GetSubMenu(subMenu.children, paths.Skip(1).ToArray()));
         }
         else
         {
             if (paths.Length > 1)
             {
                 subMenu.path = string.Join("/", paths);
             }
             return(subMenu);
         }
     }
     return(null);
 }
Esempio n. 3
0
 public ForecastViewConext(IDBContext db)
 {
     this.menuitempoint = menuitemgeop;
     this.Regim         = REGIM.INIT;
     if (!Helper.GetListPetrochemicalType(db, ref petrochemicaltypelist))
     {
         this.Regim = REGIM.RUNERROR;
     }
     this.incidenttypelist = new EGH01DB.Types.IncidentTypeList(db);
     if (this.incidenttypelist == null)
     {
         this.Regim = REGIM.RUNERROR;
     }
 }
Esempio n. 4
0
        public NodeTreeView()
        {
            Label = Resources.GetString("NodeTree") + "###NodeTree";

            Core.OnAfterNew        += OnRenew;
            Core.OnAfterLoad       += OnRenew;
            Core.OnAfterSelectNode += OnAfterSelect;

            Func <Func <bool>, Menu.MenuItem> create_menu_item_from_commands = (a) =>
            {
                var item       = new Menu.MenuItem();
                var attributes = a.Method.GetCustomAttributes(false);
                var uniquename = UniqueNameAttribute.GetUniqueName(attributes);
                item.Label    = NameAttribute.GetName(attributes);
                item.Shortcut = Shortcuts.GetShortcutText(uniquename);
                item.Clicked += () =>
                {
                    a();
                };

                return(item);
            };

            menuItems.Add(create_menu_item_from_commands(Commands.AddNode));
            menuItems.Add(create_menu_item_from_commands(Commands.InsertNode));
            menuItems.Add(create_menu_item_from_commands(Commands.RemoveNode));

            menuItems.Add(new Menu.MenuSeparator());

            menuItems.Add(create_menu_item_from_commands(Commands.Copy));
            menuItems.Add(create_menu_item_from_commands(Commands.Paste));
            menuItems.Add(create_menu_item_from_commands(Commands.PasteInfo));

            menuItems.Add(new Menu.MenuSeparator());

            menuItems.Add(create_menu_item_from_commands(Commands.Undo));
            menuItems.Add(create_menu_item_from_commands(Commands.Redo));

            Renew();

            Icon       = Images.GetIcon("PanelNodeTree");
            IconSize   = new swig.Vec2(24, 24);
            TabToolTip = Resources.GetString("NodeTree");
        }
Esempio n. 5
0
        /// <summary>
        ///     The function to call when the twitter application is selected.
        /// </summary>
        /// <param name="name"> "Twitter app" </param>
        void ITvApp.ItemCallback(string name)
        {
            // Deactivate menu.
            menuFact.SetActiveMenu(null);

            Menu tweets = menuFact.CreateMenu(TvMenuFactory.Type.SOCIAL_MENU, "TwitterMenu");

            if (tweets != null)
            {
                // Show twitters
                TwitterInterface.GetTwitters(display.transform.parent.GetComponent <SmartTv>(), 20, (bool success, string response) => {
                    if (success)
                    {
                        TwitterResponse tresponse = JsonUtility.FromJson <TwitterResponse> (response);

                        // Print the tweets and their author.
                        for (int i = 0; i < tresponse.items.Length; ++i)
                        {
                            // display.transform.parent.GetComponent<SmartTv>().StartCoroutine(DownloadImage(tresponse.items[i].user.profile_background_image_url, image));

                            string [] fields   = { tresponse.items[i].user.name, tresponse.items[i].text };
                            Menu.MenuItem item = new Menu.MenuItem();
                            item.name          = "tweet" + i;
                            item.fields        = fields;
                            tweets.AddMenuItem(item, (string nm) => {});
                        }

                        menuFact.SetActiveMenu("TwitterMenu");
                    }
                    else
                    {
                        Debug.Log(response);
                    }
                });
            }
            else
            {
                menuFact.SetActiveMenu("TwitterMenu");
            }
        }
Esempio n. 6
0
        private void OnMenuClicked(Menu.MenuItem item)
        {
            switch (item)
            {
            case Menu.MenuItem.LOGOUT:
                Logout();
                break;

            case Menu.MenuItem.REQUESTS:
                GoToPendingSignatureList();
                break;

            case Menu.MenuItem.SIGNED:
                GoToFinishedSignatureRequests();
                break;

            case Menu.MenuItem.CONFIG:
                GoToConfig();
                break;
            }
            IsPresented = false;
        }
Esempio n. 7
0
 public OrderItem(Menu.MenuItem item, int quantity)
 {
     this.item       = item;
     this.quantity   = quantity;
     this.itemString = item.BuildMenuItem();
 }