コード例 #1
0
        public void CreateFoldersLayoutsMenuTest()
        {
            List <AvrTreeElement> layouts = LoadLayouts();
            List <AvrTreeElement> folders = LoadFolders();

            BaseMenuReportRegistrator.DeleteAvrEmptyFolders(layouts, folders);

            var queryMenuAction = new MenuAction(null, null, "query", 1);

            WinMenuReportRegistrator registrator = FakeMenuregistrator.GetRegistrator();

            registrator.CreateAvrFoldersLayoutsMenu(queryMenuAction, layouts, folders);
            Assert.AreEqual(2, queryMenuAction.Items.Count);
        }
コード例 #2
0
        public void WintMenuReportTest()
        {
            var barManager1   = new BarManager();
            var tbToolbar     = new Bar();
            var actionManager = new MenuActionManager(new Form(), barManager1, tbToolbar, EidssUserContext.User)
            {
                ItemsStorage = EidssMenu.Instance
            };

            Assert.AreEqual(0, actionManager.Reports.Items.Count);

            WinMenuReportRegistrator.RegisterAllStandartReports(actionManager, new ReportFactory());

            AssertMenuActionManager(actionManager);
        }
コード例 #3
0
        public void RegisterDefaultActions()
        {
            new MenuAction(CallApp_Idle, m_MenuManager, m_MenuManager.File, "MenuLockApp", 100, false,
                           (int)MenuIconsSmall.Permissions);
            new MenuAction(ChangeUser, m_MenuManager, m_MenuManager.File, "MenuChangeUser", 101, false,
                           (int)MenuIconsSmall.SwitchUser);
            if (BaseFormManager.ArchiveMode || EidssUserContext.User.HasPermission(PermissionHelper.ExecutePermission(EIDSSPermissionObject.CanReadArchivedData)))
            {
                var archiveConnectionCredentials = new ConnectionCredentials(null, "Archive");
                if (BaseFormManager.ArchiveMode || archiveConnectionCredentials.IsCorrect)
                {
                    new MenuAction(ConnectToArchive, m_MenuManager, m_MenuManager.File, "MenuConnectToArchive", 111)
                    {
                        IsCheckBoxAction = true
                    }
                }
                ;
            }
            new MenuAction(m_MenuManager, m_MenuManager.File, "MenuSeparator", 113);
            new MenuAction(CloseForm, m_MenuManager, m_MenuManager.File, "MenuExit", 114, false,
                           (int)MenuIconsSmall.Exit);
            new MenuAction(HelpContext, m_MenuManager, m_MenuManager.Help, "MenuContents", 1000, false,
                           (int)MenuIconsSmall.Help, (int)MenuIconsSmall.Help)
            {
                BeginGroup = true
            };
            new MenuAction(HelpContext, m_MenuManager, m_MenuManager.System, "MenuHelp", 100410, true,
                           (int)MenuIcons.Help, (int)MenuIcons.Help)
            {
                ShowInMenu = false
            };
            new MenuAction(About, m_MenuManager, m_MenuManager.Help, "MenuHelpAbout", 100010); //

            if (BaseForm.ReplicationNeeded)
            {
                new MenuAction(ReplicationRequested, m_MenuManager, m_MenuManager.System, "MenuRequestReplication",
                               900, false, (int)MenuIconsSmall.ReplicateData, -1)
                {
                    SelectPermission = PermissionHelper.ExecutePermission(EIDSSPermissionObject.ReplicateData)
                };
            }
            new MenuAction(m_MenuManager, m_MenuManager.System, "MenuReferencies", 950, false, (int)MenuIconsSmall.References)
            {
                BeginGroup = true
            };
            new MenuAction(m_MenuManager, m_MenuManager.System, "MenuAdministration", 970)
            {
                BeginGroup = true
            };
            //Toolbar menu
            m_LanguageMenu = new MenuAction(m_MenuManager, m_MenuManager.System, "MenuLanguage", 100400, true)
            {
                BeginGroup = true
            };

            bool bWithouFlags = IsLangMenuWithoutFlags;

            foreach (var lang in Localizer.SupportedLanguages)
            {
                if (lang.Key == Localizer.lngEn)
                {
                    new MenuAction(SetEnglishLanguage, m_MenuManager, m_LanguageMenu, "MenuEnglish",
                                   900, false, bWithouFlags ? -1 : (int)MenuIconsSmall.English, bWithouFlags ? -1 : (int)MenuIcons.English)
                    {
                        Caption = Localizer.GetMenuLanguageName(Localizer.lngEn)
                    };
                }
                else if (lang.Key == Localizer.lngRu)
                {
                    new MenuAction(SetRussianLanguage, m_MenuManager, m_LanguageMenu, "MenuRussian",
                                   925, false, bWithouFlags ? -1 : (int)MenuIconsSmall.Russian, bWithouFlags ? -1 : (int)MenuIcons.Russian)
                    {
                        Caption = Localizer.GetMenuLanguageName(Localizer.lngRu)
                    };
                }
                else if (lang.Key == Localizer.lngGe)
                {
                    new MenuAction(SetGeorgianLanguage, m_MenuManager, m_LanguageMenu, "MenuGeorgian",
                                   915, false, bWithouFlags ? -1 : (int)MenuIconsSmall.Georgian, bWithouFlags ? -1 : (int)MenuIcons.Georgian)
                    {
                        Caption = Localizer.GetMenuLanguageName(Localizer.lngGe)
                    };
                }
                else if (lang.Key == Localizer.lngAzLat)
                {
                    new MenuAction(SetAzeriLanguageLat, m_MenuManager, m_LanguageMenu, "MenuAzeriLat", 910,
                                   false, bWithouFlags ? -1 : (int)MenuIconsSmall.Azery, bWithouFlags ? -1 : (int)MenuIcons.Azery)
                    {
                        Caption = Localizer.GetMenuLanguageName(Localizer.lngAzLat)
                    };
                }
                else if (lang.Key == Localizer.lngKz)
                {
                    new MenuAction(SetKazakhLanguage, m_MenuManager, m_LanguageMenu, "MenuKazakh", 920,
                                   false, bWithouFlags ? -1 : (int)MenuIconsSmall.Kazakhstan, bWithouFlags ? -1 : (int)MenuIcons.Kazakhstan)
                    {
                        Caption = Localizer.GetMenuLanguageName(Localizer.lngKz)
                    };
                }
                else if (lang.Key == Localizer.lngUk)
                {
                    new MenuAction(SetUkrainianLanguage, m_MenuManager, m_LanguageMenu,
                                   "MenuUkrainian", 930, false, bWithouFlags ? -1 : (int)MenuIconsSmall.Ukrainian, bWithouFlags ? -1 : (int)MenuIcons.Ukrainian)
                    {
                        Caption = Localizer.GetMenuLanguageName(Localizer.lngUk)
                    };
                }
                else if (lang.Key == Localizer.lngAr)
                {
                    new MenuAction(SetArmenianLanguage, m_MenuManager, m_LanguageMenu, "MenuArmenian",
                                   905, false, bWithouFlags ? -1 : (int)MenuIconsSmall.Armenian, bWithouFlags ? -1 : (int)MenuIcons.Armenian)
                    {
                        Caption = Localizer.GetMenuLanguageName(Localizer.lngAr)
                    };
                }
                else if (lang.Key == Localizer.lngIraq)
                {
                    new MenuAction(SetIraqLanguage, m_MenuManager, m_LanguageMenu, "MenuIraq",
                                   901, false, bWithouFlags ? -1 : (int)MenuIconsSmall.Iraq, bWithouFlags ? -1 : (int)MenuIcons.Iraq)
                    {
                        Caption = Localizer.GetMenuLanguageName(Localizer.lngIraq)
                    };
                }
                else if (lang.Key == Localizer.lngVietnam)
                {
                    new MenuAction(SetVietnamLanguage, m_MenuManager, m_LanguageMenu, "MenuVietnam",
                                   901, false, -1, -1)
                    {
                        Caption = Localizer.GetMenuLanguageName(Localizer.lngVietnam)
                    };
                }
                else if (lang.Key == Localizer.lngLaos)
                {
                    new MenuAction(SetLaosLanguage, m_MenuManager, m_LanguageMenu, "MenuLaos",
                                   901, false, -1, -1)
                    {
                        Caption = Localizer.GetMenuLanguageName(Localizer.lngLaos)
                    };
                }
                else if (lang.Key == Localizer.lngThai)
                {
                    new MenuAction(SetThaiLanguage, m_MenuManager, m_LanguageMenu, "MenuThai",
                                   901, false, bWithouFlags ? -1 : (int)MenuIconsSmall.Thailand, bWithouFlags ? -1 : (int)MenuIcons.Thailand)
                    {
                        Caption = Localizer.GetMenuLanguageName(Localizer.lngThai)
                    };
                }
            }

            new MenuAction(RunEpiInfo, MenuActionManager.Instance, MenuActionManager.Instance.Reports,
                           "MenuLaunchEpiInfo", 1000000, false, (int)MenuIconsSmall.EpiInfo)
            {
                Name       = "btnEpiInfo",
                BeginGroup = true,
            };

            WinMenuReportRegistrator.RegisterAllStandartReports(m_MenuManager, EidssSiteContext.ReportFactory);
        }