상속: MonoBehaviour
예제 #1
0
 public void OpenMultiplayerMenu()
 {
     ChangeVisibleMenu(this.multiplayerMenu);
     this.currentSelection = 0;
     multi_ipInput.Select();
     MainMenu.code = MenuCode.MULTIPLAYER;
 }
예제 #2
0
 public MenuItemDataModel(MenuCode code, string display, object iconSource)
 {
     this.Code       = code;
     this.Display    = display;
     this.IconSource = iconSource;
     this.Padding    = "5,5";
 }
예제 #3
0
 public void GetMenuItemDataModel(
     MenuCode menuCode,
     MsgCode msgCode,
     UIIcon iconCode,
     string padding,
     Action <MenuItemDataModel> onSuccess,
     Action <MenuItemDataModel> onError)
 {
     WrapErr.ToErrReport(9999, () => {
         ErrReport report;
         WrapErr.ToErrReport(out report, 9999, () => {
             onSuccess(new MenuItemDataModel()
             {
                 Code       = menuCode,
                 Display    = this.GetText(msgCode),
                 IconSource = this.IconSource(iconCode),
                 Padding    = padding,
             });
         });
         if (report.Code != 0)
         {
             WrapErr.SafeAction(() => {
                 onError.Invoke(new MenuItemDataModel()
                 {
                     Code       = menuCode,
                     Display    = "**NA**",
                     IconSource = "",
                     Padding    = padding,
                 });
             });
         }
     });
 }
예제 #4
0
 public void OpenOptionsMenu()
 {
     SetFullBrightColor();
     ChangeVisibleMenu(this.optionsMenu);
     this.currentSelection            = 0;
     this.renderDistanceSlider.value  = World.renderDistance;
     this.options_accountIDInput.text = Configurations.accountID.ToString();
     MainMenu.code = MenuCode.OPTIONS;
 }
예제 #5
0
 public void OpenSingleplayerNewMenu()
 {
     ChangeVisibleMenu(this.singleplayerNewMenu);
     single_nameInput.text = "";
     single_seedInput.text = "";
     single_nameInput.Select();
     this.currentSelection = 0;
     MainMenu.code         = MenuCode.SINGLEPLAYER_NEW;
 }
예제 #6
0
    public void OpenSingleplayerMenu()
    {
        ChangeVisibleMenu(this.singleplayerMenu);
        singleplayerNewButton.Select();
        this.currentSelection = 0;
        MainMenu.code         = MenuCode.SINGLEPLAYER;

        ListWorldFolders();
    }
예제 #7
0
        public static List<MenuItems> GetMenuItems(MenuCode MenuCode)
        {
            string _HomeBackground = "Transparent"; string _HomeForeground = "white";
            if (MenuCode == MenuCode.Home)
            {
                  _HomeBackground = "black";   _HomeForeground = "Green";
            }
            string _SaleBackground = "Transparent"; string _SaleForeground = "white";
            if (MenuCode == MenuCode.Sale)
            {
                _SaleBackground = "black"; _SaleForeground = "Green";
            }
            string _CatMngtBackground = "Transparent"; string _CatMngtForeground = "white";
            if (MenuCode == MenuCode.CatMngt)
            {
                _CatMngtBackground = "black"; _CatMngtForeground = "Green";
            }
            string _ProdMgntBackground = "Transparent"; string _ProdMgntForeground = "white";
            if (MenuCode == MenuCode.ProdMgnt)
            {
                _ProdMgntBackground = "black"; _ProdMgntForeground = "Green";
            }
            string _InvtMgntBackground = "Transparent"; string _InvtMgntForeground = "white";
            if (MenuCode == MenuCode.InvtMgnt)
            {
                _InvtMgntBackground = "black"; _InvtMgntForeground = "Green";
            }
            string _EmpMgntBackground = "Transparent"; string _EmpMgntForeground = "white";
            if (MenuCode == MenuCode.EmpMgnt)
            {
                _EmpMgntBackground = "black"; _EmpMgntForeground = "Green";
            }
            string _CustMgntBackground = "Transparent"; string _CustMgntForeground = "white";
            if (MenuCode == MenuCode.CustMgnt)
            {
                _CustMgntBackground = "black"; _CustMgntForeground = "Green";
            }
            string _DiscMgntBackground = "Transparent"; string _DiscMgntForeground = "white";
            if (MenuCode == MenuCode.DiscMgnt)
            {
                _DiscMgntBackground = "black"; _DiscMgntForeground = "Green";
            }

            List<MenuItems> MenuItemsList = new List<MenuItems>();

            MenuItemsList.Add(new MenuItems { Text = "Dashboard", code = MenuCode.Home.ToString(), redirecturl = "/Views/HomePage.xaml", iconsrc = "/Assets/MenuIcon/Home.png", count = "0", selectedBgColor = _HomeBackground, selectedTextColor = _HomeForeground });
            MenuItemsList.Add(new MenuItems { Text = "Make a Sale", code = MenuCode.Sale.ToString(), redirecturl = "/Views/HomePage.xaml", iconsrc = "/Assets/MenuIcon/Make_sale.png", count = "0", selectedBgColor = _SaleBackground, selectedTextColor = _SaleForeground });
            MenuItemsList.Add(new MenuItems { Text = "Category Management", code = MenuCode.CatMngt.ToString(), redirecturl = "/Views/CategoryListPage.xaml", iconsrc = "/Assets/MenuIcon/CatMgnt.png", count = "0", selectedBgColor = _CatMngtBackground, selectedTextColor = _CatMngtForeground });
            MenuItemsList.Add(new MenuItems { Text = "Product Management", code = MenuCode.ProdMgnt.ToString(), redirecturl = "/Views/HomePage.xaml", iconsrc = "/Assets/MenuIcon/ProductMgnt.png", count = "0", selectedBgColor = _ProdMgntBackground, selectedTextColor = _ProdMgntForeground });
            MenuItemsList.Add(new MenuItems { Text = "Inventory Management", code = MenuCode.InvtMgnt.ToString(), redirecturl = "/Views/HomePage.xaml", iconsrc = "/Assets/MenuIcon/InventoryMgnt.png", count = "0", selectedBgColor = _InvtMgntBackground, selectedTextColor = _InvtMgntForeground });
            MenuItemsList.Add(new MenuItems { Text = "Employee Management", code = MenuCode.EmpMgnt.ToString(), redirecturl = "/Views/EmployeeListPage.xaml", iconsrc = "/Assets/MenuIcon/EmpMgnt.png", count = "0", selectedBgColor = _EmpMgntBackground, selectedTextColor = _EmpMgntForeground });
            MenuItemsList.Add(new MenuItems { Text = "Customer Management", code = MenuCode.CustMgnt.ToString(), redirecturl = "/Views/HomePage.xaml", iconsrc = "/Assets/MenuIcon/CustMgnt.png", count = "0", selectedBgColor = _CustMgntBackground, selectedTextColor = _CustMgntForeground });
            MenuItemsList.Add(new MenuItems { Text = "Discount Management", code = MenuCode.DiscMgnt.ToString(), redirecturl = "/Views/HomePage.xaml", iconsrc = "/Assets/MenuIcon/appbar.warning.circle.png", count = "0", selectedBgColor = _DiscMgntBackground, selectedTextColor = _DiscMgntForeground });

            return MenuItemsList;
        }
예제 #8
0
        private void AddItem(MenuCode menuCode, string display, UIIcon uIIcon, string padding)
        {
            MenuItemDataModel dataModel = new MenuItemDataModel()
            {
                Code       = menuCode,
                Display    = display,
                IconSource = IconBinder.Source(uIIcon),
                Padding    = padding,
            };

            this.items.Add(dataModel);
        }
 public virtual void SetUp()
 {
     context = ShimsContext.Create();
     SetECNCurrentSession();
     SetShimsCommunicator();
     currentMenuCode            = MenuCode.BASECHANNEL;
     heading                    = string.Empty;
     helpContent                = string.Empty;
     helpTitle                  = string.Empty;
     subMenu                    = string.Empty;
     roleAccessExceptionOccured = false;
     QueryString                = new System.Collections.Specialized.NameValueCollection();
     InitTestObject();
 }
 protected void SetShimsCommunicator()
 {
     SetECNCurrentSession();
     ShimPage.AllInstances.MasterGet = (obj) => new ShimCommunicator();
     ShimCommunicator.AllInstances.UserSessionGet = (obj) => new ShimECNSession().Instance;
     ShimCommunicator.AllInstances.SetValuesEnumsMenuCodeStringStringStringString = (obj, value1, value2, value3, value4, value5)
                                                                                    =>
     {
         currentMenuCode = value1;
         subMenu         = value2;
         heading         = value3;
         helpContent     = value4;
         helpTitle       = value5;
     };
 }
예제 #11
0
 private void InitTest_Menu_MenuItemDataBound(out MenuItem menuItem, MenuCode currentMenuCode, string itemText, bool hasServiceFeature = false, bool isChannelAdmin = false, bool hasSiteMapNode = false, string menuItemNavigateUrl = "", bool menuItemWithParent = true, bool isAdmin = false)
 {
     SetPageProperties_Menu_MenuItemDataBound();
     SetPageControls_Menu_MenuItemDataBoun();
     ShimUser.HasAccessUserEnumsServicesEnumsServiceFeaturesEnumsAccess = (u, service, feature, access) => false;
     ShimUser.IsChannelAdministratorUser = (u) => isChannelAdmin;
     ShimUser.IsAdministratorUser        = (u) => isAdmin;
     ShimUser.IsSystemAdministratorUser  = (u) => false;
     KMPlatform.BusinessLogic.Fakes.ShimClient.HasServiceFeatureInt32EnumsServicesEnumsServiceFeatures = (user, service, feature) => hasServiceFeature;
     ShimMenuItem.AllInstances.ParentGet = (mi) => menuItemWithParent ? new MenuItem()
     {
         Selectable = true, NavigateUrl = MID_ItemParentNavigateUrl
     } : null;
     menuItem             = new MenuItem();
     menuItem.Text        = itemText;
     menuItem.Value       = itemText;
     menuItem.NavigateUrl = menuItemNavigateUrl;
     ShimSiteMapNode.AllInstances.UrlGet = (siteMap) => MID_SiteMapCurrentNodeURL;
     ShimSiteMap.CurrentNodeGet          = () => hasSiteMapNode ? new ShimSiteMapNode() : null;
     ShimCommunicator.AllInstances.CurrentMenuCodeGet = (c) => currentMenuCode;
 }
예제 #12
0
        public void Menu_MenuItemDataBound_NoCurrentNode_NodeUrlInitialized(MenuCode menuCode, string itemText)
        {
            // Arrange
            InitTest_Menu_MenuItemDataBound(
                hasSiteMapNode: false,
                menuItem: out MenuItem menuItem,
                currentMenuCode: menuCode,
                itemText: itemText,
                menuItemNavigateUrl: MID_CommunicatorPageName);
            var expectedUrl = string.Empty;

            switch (menuCode)
            {
            case MenuCode.GROUPS: expectedUrl = "/ecn.communicator/main/lists/"; break;

            case MenuCode.CONTENT: expectedUrl = "/ecn.communicator/main/content/"; break;

            case MenuCode.BLASTS: expectedUrl = "/ecn.communicator/main/ecnwizard/"; break;

            case MenuCode.EVENTS: expectedUrl = "/ecn.communicator/main/events/messagetriggers.aspx"; break;

            case MenuCode.INDEX: expectedUrl = "~/ecn.accounts/main/"; break;

            case MenuCode.PAGEKNOWTICE: expectedUrl = "/ecn.communicator/main/PageWatch/PageWatchEditor.aspx"; break;

            case MenuCode.REPORTS: expectedUrl = "/ecn.communicator/main/Reports/SentCampaignsReport.aspx#"; break;

            case MenuCode.SALESFORCE: expectedUrl = "/ecn.communicator/main/SalesForce/ECN_SF_Integration.aspx"; break;

            case MenuCode.OMNITURE: expectedUrl = "/ecn.communicator/main/Omniture/OmnitureCustomerSetup.aspx"; break;
            }

            // Act
            _communicatorPrivateObject.Invoke("Menu_MenuItemDataBound", new object[] { null, new MenuEventArgs(menuItem) });

            // Assert
            _siteMapSecondLevel.StartingNodeUrl.ShouldBe(expectedUrl);
        }
예제 #13
0
        // GET: Menu
        public ActionResult Index()
        {
            MenuCode code = new MenuCode();

            return(PartialView(code.GetMenuList()));
        }
예제 #14
0
 /// <summary>
 /// 指定したメニューコードに一致するメニュー情報を取得する
 /// </summary>
 public MenuItemInfo GetMenu(MenuCode menuCode)
 {
     return(MenuList.Find(m => m.Code == menuCode));
 }
 private void AddItem(MenuCode menuCode, MsgCode msgCode, string uIIcon)
 {
     this.AddItem(menuCode, DI.W.GetText(msgCode), uIIcon, "0");
 }
예제 #16
0
 private void AddItem(MenuCode menuCode, MsgCode msgCode, UIIcon uIIcon, string padding)
 {
     this.AddItem(menuCode, DI.Wrapper.GetText(msgCode), uIIcon, padding);
 }
 private void AddItem(MenuCode menuCode, string display, string uIIcon, string padding)
 {
     this.items.Add(new MenuItemDataModel(menuCode, display, uIIcon, padding));
 }
예제 #18
0
 public void add(MenuCode code, string label)
 {
     MenuItem item = new MenuItem();
     item.code = code;
     item.label = label;
     items.Add(item);
 }
예제 #19
0
 /// <summary>
 /// 指定したメニューに割り当てられたテナント用ロールIDを取得する。
 /// 管理者ロール、および他のテナント固有の設定は含まれない。
 /// </summary>
 public IEnumerable <Role> GetAttachedRoles(MenuCode menuCode, long tenantId)
 {
     return(FindModelAll <MenuRoleMap>(map => map.MenuCode == menuCode.ToString()).Include(map => map.Role)
            .Where(map => map.Role.IsSystemRole == false && (map.Role.TenantId == null || map.Role.TenantId == tenantId)).Select(map => map.Role));
 }
예제 #20
0
 /// <summary>
 /// 指定したメニューに共通で割り当てられたロールIDを取得する。
 /// 特定のテナント固有の設定は含まれない。
 /// </summary>
 public IEnumerable <Role> GetAttachedRoles(MenuCode menuCode)
 {
     return(FindModelAll <MenuRoleMap>(map => map.MenuCode == menuCode.ToString()).Include(map => map.Role)
            .Where(map => map.Role.TenantId == null).Select(map => map.Role));
 }
예제 #21
0
        /// <summary>
        /// 指定したロールに、指定したメニューへのアクセス権限があるか、確認する
        /// </summary>
        /// <returns></returns>
        public async Task <bool> AuthorizeAsync(long roleId, MenuCode menuCode)
        {
            var roleMaps = await GetMenuRolesMapsAsync();

            return(roleMaps.FirstOrDefault(m => m.RoleId == roleId && m.MenuCode == menuCode.ToString()) != null);
        }
예제 #22
0
 public MenuItemDataModel(MenuCode code, string display, string iconSource)
 {
     this.Code       = code;
     this.Display    = display;
     this.IconSource = iconSource;
 }
예제 #23
0
 public MenuItemDataModel(MenuCode code, string display, string iconSource, string padding) :
     this(code, display, iconSource)
 {
     this.Padding = padding;
 }
예제 #24
0
 public void OpenMainMenu()
 {
     ChangeVisibleMenu(this.mainMenu);
     singleplayerButton.Select();
     MainMenu.code = MenuCode.MAIN;
 }