//メインメニューの追加 protected ToolStripMenuItem AddMenu(ToolStripMenuItem parent, MenuFunc menuFunc, string title, Keys keys) { ToolStripItem item = null; if (parent == null) { item = menuStrip.Items.Add(title); } else { if (title == "-") { parent.DropDownItems.Add(new ToolStripSeparator()); } else { item = parent.DropDownItems.Add(title); } } if (item != null) { item.Click += MenuClick; item.Tag = menuFunc; if (keys != Keys.None) { ((ToolStripMenuItem)item).ShortcutKeys = keys; } } return((ToolStripMenuItem)item); }
/// <summary> /// Navigate subframe to corresponding page /// </summary> /// <param name="frame"></param> /// <param name="func"></param> public void NavigateToFunction(Frame frame, MenuFunc func) { switch (func) { case MenuFunc.Func1: { frame.Navigate(typeof(Function1Page)); break; } case MenuFunc.Func2: { frame.Navigate(typeof(Function2Page)); break; } case MenuFunc.Settings: { frame.Navigate(typeof(SettingPage)); break; } default: { frame.Navigate(typeof(Function1Page)); break; } } }
private void FunctionsListView_OnSelectionChanged(object sender, SelectionChangedEventArgs e) { if (FunctionsListView.SelectedIndex != -1) { BottomListView.SelectedIndex = -1; MenuListItem m = FunctionsListView.SelectedItem as MenuListItem; var n = Vm.TopFunctionList.Where((a) => a.MenuF == _currentFrame); var menuListItems = n as MenuListItem[] ?? n.ToArray(); if (!menuListItems.Any()) { menuListItems = Vm.BottomFunctionList.Where((a) => a.MenuF == _currentFrame).ToArray(); } var currentMenu = menuListItems[0]; currentMenu.IsEnabled = false; if (m != null) { _currentFrame = m.MenuF; m.IsEnabled = true; Debug.Assert(m != null, "m != null"); Vm.NavigateToFunction(MainFrame, m.MenuF); } MainSplitView.IsPaneOpen = false; } }
/// <summary> /// Loads tray plugin. /// </summary> /// <param name="menu">Menu reference.</param> /// <param name="rebuildMenuFunc">Rebuild menu function.</param> public void Load(Gtk.Menu menu, MenuFunc rebuildMenuFunc) { this.RebuildMenu = rebuildMenuFunc; this.indicator = new ApplicationIndicator("glippy", EnvironmentVariables.PanelIcon, Category.Other); this.indicator.Status = Status.Active; this.indicator.Menu = menu; }
//メインメニューとポップアップメニューの両方への追加 protected ToolStripMenuItem Add2(ToolStripMenuItem parent, MenuFunc menuFunc, string title, Keys keys) { //ポップアップメニューの追加 AddPopup(menuFunc, title); //メインメニューの追加 return(AddMenu(parent, menuFunc, title, keys)); }
public void NavigateToFunction(Frame frame, MenuFunc func) { switch (func) { case MenuFunc.RenderSizes: { frame.Navigate(typeof(MainPage)); break; } case MenuFunc.Settings: { frame.Navigate(typeof(SettingPage)); break; } case MenuFunc.Add: { frame.Navigate(typeof(NewSizePage)); break; } default: { frame.Navigate(typeof(PreviewPage)); break; } } }
/// <summary> /// Loads tray plugin. /// </summary> /// <param name="menu">Menu reference.</param> /// <param name="rebuildMenuFunc">Rebuild menu function.</param> public void Load(Menu menu, MenuFunc rebuildMenuFunc) { this.menu = menu; this.RebuildMenu = rebuildMenuFunc; this.statusIcon = new StatusIcon(); this.statusIcon.IconName = EnvironmentVariables.PanelIcon; this.statusIcon.Activate += this.OnStatusIconActivated; }
//ポップアップメニューの追加 protected void AddPopup(MenuFunc menuFunc, string title) { if (_popupMenu != null) { var item = _popupMenu.Items.Add(title); item.Click += MenuClick; item.Tag = menuFunc; } }
public void AddMenuItem(string name, MenuFunc callback) { if (menuItemDic.ContainsKey(name)) { throw new System.Exception("已存在相同名称的右键菜单!"); } menuItemDic.Add(name, callback); }
private void ShowMenu() { GenericMenu menu = new GenericMenu(); if (menuItemDic.Count > 0) { foreach (KeyValuePair <string, MenuFunc> kvp in menuItemDic) { MenuFunc func = kvp.Value; menu.AddItem(new GUIContent(kvp.Key), false, delegate() { func(menuNode); }); } } endRenaming = true; menu.ShowAsContext(); curNode = null; rightUp = false; }
public void NavigateToFunction(Frame frame, MenuFunc func) { switch (func) { case MenuFunc.Map: { frame.Navigate(typeof(MapPage)); break; } case MenuFunc.Settings: { frame.Navigate(typeof(SettingPage)); break; } case MenuFunc.Search: { MapPage page = frame.Content as MapPage; if (page != null) { //Navigate inside MapPage page.SecondFrame.Navigate(typeof(RouteSearchPage)); } else { frame.Navigate(typeof(MapPage)); Debug.Assert(frame.Content != null, "frame.Content != null"); ((MapPage)frame.Content).SecondFrame.Navigate(typeof(RouteSearchPage)); } break; } default: { frame.Navigate(typeof(MapPage)); break; } } }
private void MenuListItem_OnTapped(object sender, TappedRoutedEventArgs e) { MenuListItem m = ((Grid)sender).DataContext as MenuListItem; //Debug.Assert(m != null, "m != null"); if (m != null && m.MenuF != _currentFrame) { var n = Vm.FunctionItemList.Where((a) => a.MenuF == _currentFrame); var menuListItems = n as MenuListItem[] ?? n.ToArray(); if (!menuListItems.Any()) { menuListItems = Vm.BottomFunctionItemList.Where((a) => a.MenuF == _currentFrame).ToArray(); } var currentMenu = menuListItems[0]; currentMenu.IsEnabled = false; NavigateToPage(m.MenuF); _currentFrame = m.MenuF; m.IsEnabled = true; } Vm.IsSplitViewPaneOpened = false; }
public void NavigateToFunction(Frame frame, MenuFunc func) { switch (func) { case MenuFunc.MapSource: { //frame.Navigate(typeof(MapPage)); break; } case MenuFunc.UpdateDatabase: { frame.Navigate(typeof(UpdateDatabasePage)); break; } default: { frame.Navigate(typeof(UpdateDatabasePage)); break; } } }
public void NavigateToPage(MenuFunc m) { NavigateToFunction(MainFrame, m); }
private void iniPerson() { MenuFunc menuFunc = new MenuFunc("個人專區", null); myService.DaoInsert(menuFunc); MenuFunc m1 = authService.AddSubMenu(menuFunc, "使用者資訊", "admin/personal/LoginUserDetail.aspx"); MenuFunc m2 = authService.AddSubMenu(menuFunc, "工作日誌", "admin/personal/WorkDiary.aspx"); }
/// <summary> /// Navigate subframe to corresponding page /// </summary> /// <param name="frame"></param> /// <param name="func"></param> public void NavigateToFunction(Frame frame, MenuFunc func) { switch (func) { case MenuFunc.HomePage: { frame.Navigate(typeof (HomePage)); break; } case MenuFunc.Func1: { frame.Navigate(typeof (Function1Page)); break; } case MenuFunc.Func2: { frame.Navigate(typeof (Function2Page)); break; } case MenuFunc.Settings: { frame.Navigate(typeof (SettingPage)); break; } //case MenuFunc.About: //{ // frame.Navigate(typeof(AboutPage)); // break; //} default: { frame.Navigate(typeof (HomePage)); break; } } }
private void iniSystem() { MenuFunc menuFunc = new MenuFunc("系統設定", null); myService.DaoInsert(menuFunc); MenuFunc m1 = authService.AddSubMenu(menuFunc, "系統參數設定", "admin/system/SystemSettingList.aspx"); }
private void initProject() { MenuFunc menuFunc = new MenuFunc("專案管理", null); myService.DaoInsert(menuFunc); MenuFunc m1 = authService.AddSubMenu(menuFunc, "報價管理", "admin/project/QuoteList.aspx"); authService.AddOtherPath(m1, "admin/project/QuoteDetail.aspx"); authService.AddOtherPath(m1, "admin/project/QuoteDetailMain.aspx"); MenuFunc m2 = authService.AddSubMenu(menuFunc, "專案管理", "admin/project/ProjectList.aspx"); authService.AddOtherPath(m2, "admin/project/ProjectDetail.aspx"); MenuFunc m3 = authService.AddSubMenu(menuFunc, "專案類別管理", "admin/project/TypeList.aspx"); authService.AddOtherPath(m3, "admin/project/TypeDetail.aspx"); }
private void initCustomer() { MenuFunc menuFunc = new MenuFunc("客廠管理", null); myService.DaoInsert(menuFunc); MenuFunc m1 = authService.AddSubMenu(menuFunc, "類別管理", "admin/customer/TypeList.aspx"); authService.AddOtherPath(m1, "admin/customer/TypeDetail.aspx"); MenuFunc m2 = authService.AddSubMenu(menuFunc, "客廠資訊管理", "admin/customer/CustomerList.aspx"); authService.AddOtherPath(m2, "admin/customer/CustomerDetail.aspx"); }
//メインメニューの追加 protected ToolStripMenuItem AddMenu(ToolStripMenuItem parent, MenuFunc menuFunc, string title,Keys keys) { ToolStripItem item = null; if (parent == null) { item = menuStrip.Items.Add(title); } else { if(title=="-") parent.DropDownItems.Add(new ToolStripSeparator()); else item = parent.DropDownItems.Add(title); } if (item != null) { item.Click += MenuClick; item.Tag = menuFunc; if (keys != Keys.None) ((ToolStripMenuItem)item).ShortcutKeys = keys; } return (ToolStripMenuItem)item; }
//メインメニューとポップアップメニューの両方への追加 protected ToolStripMenuItem Add2(ToolStripMenuItem parent, MenuFunc menuFunc, string title,Keys keys) { //ポップアップメニューの追加 AddPopup(menuFunc, title); //メインメニューの追加 return AddMenu(parent, menuFunc, title, keys); }
private void initPersonnel() { MenuFunc menuFunc = new MenuFunc("人事管理", null); myService.DaoInsert(menuFunc); MenuFunc m1 = authService.AddSubMenu(menuFunc, "部門管理", "admin/employee/DepartmentList.aspx"); authService.AddOtherPath(m1, "admin/employee/DepartmentDetail.aspx"); MenuFunc m2 = authService.AddSubMenu(menuFunc, "專長管理", "admin/employee/ExpertList.aspx"); authService.AddOtherPath(m2, "admin/employee/ExpertDetail.aspx"); MenuFunc m3 = authService.AddSubMenu(menuFunc, "員工資訊管理", "admin/employee/EmployeeList.aspx"); authService.AddOtherPath(m3, "admin/employee/EmployeeDetail.aspx"); }
public void NavigateToFunction(Frame frame, MenuFunc func) { switch (func) { case MenuFunc.Start: { if (!(frame.Content is StartControlPage)) { frame.Navigate(typeof(StartControlPage)); } break; } case MenuFunc.ImageSource: { if (!(frame.Content is ImageSourcePage)) { frame.Navigate(typeof(ImageSourcePage)); } break; } case MenuFunc.WeatherForecast: { if (!(frame.Content is WeatherPage)) { frame.Navigate(typeof(WeatherPage)); } break; } case MenuFunc.Rss: { if (!(frame.Content is RssPage)) { frame.Navigate(typeof(RssPage)); } break; } case MenuFunc.Settings: { if (!(frame.Content is SettingPage)) { frame.Navigate(typeof(SettingPage)); } break; } case MenuFunc.Quote: { if (!(frame.Content is QuotePage)) { frame.Navigate(typeof(QuotePage)); } break; } case MenuFunc.Note: { if (!(frame.Content is NotePage)) { frame.Navigate(typeof(NotePage)); } break; } default: { if (!(frame.Content is ImageSourcePage)) { frame.Navigate(typeof(ImageSourcePage)); } break; } } }
/// <summary> /// 權限設定 /// </summary> private void initAuth() { MenuFunc menuFunc = new MenuFunc("權限管理", null); myService.DaoInsert(menuFunc); MenuFunc m1 = authService.AddSubMenu(menuFunc, "帳號管理", "admin/auth/UserList.aspx"); authService.AddOtherPath(m1, "admin/auth/UserDetail.aspx"); MenuFunc m2 = authService.AddSubMenu(menuFunc, "群組管理", "admin/auth/RoleList.aspx"); authService.AddOtherPath(m2, "admin/auth/RoleDetail.aspx"); authService.AddSubMenu(menuFunc, "帳號群組設定", "admin/auth/UserRoleSet.aspx"); authService.AddSubMenu(menuFunc, "群組權限設定", "admin/auth/RoleFuncSet.aspx"); }
private void AddOtherPath(MenuFunc m1, string p) { if (m1.FuncionPaths == null) { m1.FuncionPaths = new List<FunctionPath>(); } FunctionPath path = new FunctionPath(); path.Path = p; path.BelongMenuFunc = m1; myService.DaoInsert(path); m1.FuncionPaths.Add(path); myService.DaoUpdate(m1); }
/// <summary> /// Navigate subframe to corresponding page /// </summary> /// <param name="frame"></param> /// <param name="func"></param> public async void NavigateToFunction(Frame frame, MenuFunc func) { switch (func) { case MenuFunc.BeginPage: { frame.Navigate(typeof(BeginPage), NavigationMode.New); break; } case MenuFunc.HomePage: { frame.Navigate(typeof (HomePage), NavigationMode.New); break; } case MenuFunc.Inbox: { frame.Navigate(typeof(InboxListPage), NavigationMode.New); break; } case MenuFunc.MyPayBay: { if (MediateClass.UserVM.UserInfo != null) { frame.Navigate(typeof(MyPayBayPage), NavigationMode.New); } else await new MessageDialog("Login is required!", "Notification").ShowAsync(); break; //frame.Navigate(typeof(MarketListPage), NavigationMode.New); //break; } case MenuFunc.MyFavorites: { frame.Navigate(typeof(MyFavoritesPage), NavigationMode.New); break; } case MenuFunc.Market: { frame.Navigate(typeof (MarketManagePage), NavigationMode.New); break; } case MenuFunc.Product: { frame.Navigate(typeof (ProductManagePage), NavigationMode.New); break; } case MenuFunc.Store: { frame.Navigate(typeof(StoreManagePage), NavigationMode.New); break; } case MenuFunc.Advertise: { frame.Navigate(typeof(SaleManagePage), NavigationMode.New); break; } case MenuFunc.FreeCall: { Windows.ApplicationModel.Calls.PhoneCallManager.ShowPhoneCallUI("+84938175143", "Admin"); break; } case MenuFunc.AboutUs: { frame.Navigate(typeof(AboutUsPage), NavigationMode.New); break; } case MenuFunc.Logout: { if(MediateClass.UserVM.UserInfo != null) { MediateClass.UserVM.UserInfo = null; MediateClass.StartPage.isLoginControl(false); EnableFunction((int)USERTYPE.GUEST); BottomFunctionItemList.Remove(_logout); SettingsHelper.SetSetting("Remember", false); MediateClass.StartPage.MoveHomePage(); await new MessageDialog("You have logged out", "Notification!").ShowAsync(); } else { await new MessageDialog("You are not login!", "Notification!").ShowAsync(); } break; } case MenuFunc.FeedbackAndApps: { frame.Navigate(typeof(FeedbackAndAppsPage), NavigationMode.New); break; } case MenuFunc.Settings: { frame.Navigate(typeof (SettingPage), NavigationMode.New); break; } case MenuFunc.Suggestion: { frame.Navigate(typeof(SuggestionPage), NavigationMode.New); break; } case MenuFunc.ManageOrder: { frame.Navigate(typeof(ManageOrderPage), NavigationMode.New); break; } default: { frame.Navigate(typeof (HomePage), NavigationMode.New); break; } } }
// Use this for initialization void Start() { ParseLevels(); // Menu structure Generation menuMap = new MenuLinkedList(); MenuFunc[] funcList = new MenuFunc[5]; funcList[0] = LoadRandomPoleLevel; funcList[2] = () => LoadLevelWithString(); funcList[4] = Application.Quit; string[] names; switch (MainSettings.language) { case "RUS": names = new string[] { "Старт", "Пользовательская", "Примеры", "Настройки", "Выход" }; break; default: names = new string[] { "Start random", "Custom", "Examples", "Settings", "Exit" }; break; } menuMap.add(new MenuNode(names, funcList, 5), 0); funcList = new MenuFunc[2]; switch (MainSettings.language) { case "RUS": names = new string[] { "Язык", "Скорость" }; break; default: names = new string[] { "Language", "Game speed" }; break; } menuMap.add(new MenuNode(names, funcList, 2), 3); menuMap.go2(3); funcList = new MenuFunc[2]; funcList[0] = () => { if (MenuManager.MainSettings.language != "ENG") { MenuManager.MainSettings.language = "ENG"; SceneManager.LoadScene("MainMenu"); } }; funcList[1] = () => { if (MenuManager.MainSettings.language != "RUS") { MenuManager.MainSettings.language = "RUS"; SceneManager.LoadScene("MainMenu"); } }; names = new string[] { "English", "Russian" }; switch (MainSettings.language) { case "RUS": names = new string[] { "Английский", "Русский" }; break; default: names = new string[] { "English", "Russian" }; break; } menuMap.add(new MenuNode(names, funcList, 2), 0); names = new string[5] { "0.5x", "0.75x", "1x", "1.5x", "2x" }; funcList = new MenuFunc[5]; funcList[0] = () => MenuManager.MainSettings.speed = 0.5f; funcList[1] = () => MenuManager.MainSettings.speed = 0.75f; funcList[2] = () => MenuManager.MainSettings.speed = 1f; funcList[3] = () => MenuManager.MainSettings.speed = 1.5f; funcList[4] = () => MenuManager.MainSettings.speed = 2f; menuMap.add(new MenuNode(names, funcList, 5), 1); menuMap.back(); funcList = new MenuFunc[4]; funcList[0] = LoadPoleLevel; switch (MainSettings.language) { case "RUS": names = new string[] { "Старт", "Размер", "Длина", "Элементы" }; break; default: names = new string[] { "Start", "Size", "Complexity", "Elements" }; break; } menuMap.add(new MenuNode(names, funcList, 4), 1); funcList = new MenuFunc[4]; switch (MainSettings.language) { case "RUS": names = new string[] { "Точки", "Круги", "Еще не готово", "Фигуры" }; break; default: names = new string[] { "Points", "Circles", "Not done yet", "Shapes" }; break; } menuMap.go2(1); menuMap.add(new MenuNode(names, funcList, 4), 3); funcList = new MenuFunc[5]; funcList[0] = () => Core.PolePreferences.poleSize = 5; funcList[1] = () => Core.PolePreferences.poleSize = 6; funcList[2] = () => Core.PolePreferences.poleSize = 7; funcList[3] = () => Core.PolePreferences.poleSize = 8; funcList[4] = () => Core.PolePreferences.poleSize = 9; switch (MainSettings.language) { case "RUS": names = new string[] { "Легко", "Средне", "Сложно", "Профессионал", "Невозможно" }; break; default: names = new string[] { "Easy", "Medium", "Hard", "Pro", "Insane" }; break; } menuMap.add(new MenuNode(names, funcList, 5), 1); funcList = new MenuFunc[5]; funcList[0] = () => MenuManager.MainSettings.complexity = 0.3f; funcList[1] = () => MenuManager.MainSettings.complexity = 0.4f; funcList[2] = () => MenuManager.MainSettings.complexity = 0.5f; funcList[3] = () => MenuManager.MainSettings.complexity = 0.6f; funcList[4] = () => MenuManager.MainSettings.complexity = 0.7f; switch (MainSettings.language) { case "RUS": names = new string[] { "Легко", "Средне", "Сложно", "Профессионал", "Невозможно" }; break; default: names = new string[] { "Easy", "Medium", "Hard", "Pro", "Insane" }; break; } menuMap.add(new MenuNode(names, funcList, 5), 2); menuMap.go2(3); for (int i = 0; i < 4; i++) { funcList = new MenuFunc[5]; switch (i) { case 0: funcList = new MenuFunc[5]; funcList[0] = () => MenuManager.MainSettings.numOfPoints = 0; funcList[1] = () => MenuManager.MainSettings.numOfPoints = 0.5f; funcList[2] = () => MenuManager.MainSettings.numOfPoints = 1f; funcList[3] = () => MenuManager.MainSettings.numOfPoints = 1.5f; funcList[4] = () => MenuManager.MainSettings.numOfPoints = 2f; break; case 1: funcList = new MenuFunc[5]; funcList[0] = () => MenuManager.MainSettings.numOfCircles = 0; funcList[1] = () => MenuManager.MainSettings.numOfCircles = 0.5f; funcList[2] = () => MenuManager.MainSettings.numOfCircles = 1f; funcList[3] = () => MenuManager.MainSettings.numOfCircles = 1.5f; funcList[4] = () => MenuManager.MainSettings.numOfCircles = 2f; break; case 2: funcList = new MenuFunc[5]; funcList[0] = () => MenuManager.MainSettings.numOfStars = 0; funcList[1] = () => MenuManager.MainSettings.numOfStars = 0.5f; funcList[2] = () => MenuManager.MainSettings.numOfStars = 1f; funcList[3] = () => MenuManager.MainSettings.numOfStars = 1.5f; funcList[4] = () => MenuManager.MainSettings.numOfStars = 2f; break; case 3: funcList = new MenuFunc[5]; funcList[0] = () => MenuManager.MainSettings.numOfShapes = 0; funcList[1] = () => MenuManager.MainSettings.numOfShapes = 0.2f; funcList[2] = () => MenuManager.MainSettings.numOfShapes = 0.3f; funcList[3] = () => MenuManager.MainSettings.numOfShapes = 0.4f; funcList[4] = () => MenuManager.MainSettings.numOfShapes = 0.5f; break; } switch (MainSettings.language) { case "RUS": names = new string[] { "Нет", "Легко", "Средне", "Сложно", "Профессионал" }; break; default: names = new string[] { "Off", "Easy", "Medium", "Hard", "Pro" }; break; } menuMap.add(new MenuNode(names, funcList, 5), i); switch (MainSettings.language) { case "RUS": menuMap.pointer.next[i].MainName += ": уровень"; break; default: menuMap.pointer.next[i].MainName += " difficulty"; break; } } menuMap.back(); menuMap.back(); //names = new string[] { "1", "2" }; //funcList = new MenuFunc[2]; //funcList[0] = () => LoadLevelWithString(); //menuMap.add(new MenuNode(names, funcList, 2),2); //QualitySettings.vSyncCount = 0; //Application.targetFrameRate = 10; lastPos = Input.mousePosition; menuPole = Instantiate(PolePF, transform); menuPole.GetComponent <Pole>().InitMenuItem(menuMap.pointer.size); foreach (GameObject finish in menuPole.GetComponent <Pole>().finishes) { int index = menuPole.GetComponent <Pole>().finishes.IndexOf(finish); var item = Instantiate(MenuItemPF, finish.transform.position + new Vector3(10f, 0f, 0f), MenuItemPF.transform.rotation); item.GetComponent <MenuItem>().SetName(menuMap.pointer.Name[index]); item.GetComponentInChildren <MenuButton>().index = index; } Instantiate(MenuItemPF, menuPole.GetComponent <Pole>().starts[0].transform.position + new Vector3(10f, 5f, 0f), MenuItemPF.transform.rotation).GetComponent <MenuItem>().SetName(menuMap.pointer.MainName); Debug.Log(11); activePath = Instantiate(ActivePathPF, transform); activePath.GetComponent <ActivePath>().Init(menuPole, menuPole.GetComponent <Pole>().starts, menuPole.GetComponent <Pole>().finishes); }