Пример #1
0
        /// <summary>
        /// Builds the buttons for the main menu.
        /// </summary>
        private void BuildButtons()
        {
            var navigateCommand = new RelayCommand(() => this.Navigate(), () => this.CanNavigate());

            var navigateButton = new RibbonButtonData(Messages.Title_DbConvertManager
                    , imgUri.FormatWith("Source")
                    , navigateCommand) { Order = 4 };

            PluginContext.Host.AddToApplicationMenu(navigateButton);
        }
Пример #2
0
        /// <summary>
        /// Builds the buttons for the main menu.
        /// </summary>
        private void BuildButtons()
        {
            this.navigateCommand = new RelayCommand(() => this.Navigate(), () => this.CanNavigate());

            var navigateButton = new RibbonButtonData(Messages.Title_PathologyManager
                , imgUri.FormatWith("PathologyManager")
                , navigateCommand) { Order = 3 };

            PluginContext.Host.AddInHome(navigateButton, Groups.Managers);
        }
Пример #3
0
        /// <summary>
        /// Builds the buttons for the main menu.
        /// </summary>
        private void BuildButtons()
        {
            this.navigateCommand = new RelayCommand(() => this.Navigate(), () => this.CanNavigate());

            var navigateButton = new RibbonButtonData(Messages.Title_Calendar
                , imgUri.FormatWith("Calendar")
                , navigateCommand);

            PluginContext.Host.AddInHome(navigateButton, Groups.GlobalTools);
        }
Пример #4
0
        private void BuildButtons()
        {
            #region Add
            var splitterExist = true;
            var splitter = PluginContext.Host.GetMenuInHome("add", Groups.Tools);
            if (splitter == null || splitter.GetType() != typeof(RibbonMenuButtonData))
            {
                splitterExist = false;
                splitter = new RibbonMenuButtonData(Messages.Btn_Add, uriPng.FormatWith("Add"), null)
                {
                    Order = 1,
                    Name = "add",
                };
            }

            var addButton = new RibbonMenuItemData(Messages.Title_ButtonAddPatient, uriPng.FormatWith("Add"), this.AddCommand)
            {
                Order = 2,
            };

            (splitter as RibbonMenuButtonData).Command = AddCommand;
            (splitter as RibbonMenuButtonData).ControlDataCollection.Add(addButton);
            if (!splitterExist) PluginContext.Host.AddInHome((splitter as RibbonMenuButtonData), Groups.Tools);
            #endregion

            #region Search
            var searchButton = new RibbonButtonData(Messages.Title_SearchPatient, this.SearchCommand)
            {
                SmallImage = new Uri(uriPng.FormatWith("SearchSmall"), UriKind.Relative),
                Order = 0,
            };

            var extendedSerchButton = new RibbonButtonData(Messages.Title_ExtendedSearchPatient, this.ExtendedSearchCommand)
            {
                SmallImage = new Uri(uriPng.FormatWith("SearchSmall"), UriKind.Relative),
                Order = 0,
            };

            var topTenButton = new RibbonButtonData(Messages.Title_MostUsed, this.ShowTopTenCommand)
            {
                SmallImage = new Uri(uriPng.FormatWith("SearchSmall"), UriKind.Relative),
                Order = 0,
            };

            var searchByTagButton = new RibbonSplitButtonData(Messages.Title_SearchByTag, uriPng.FormatWith("SearchSmall"), this.SearchByTagCommand)
            {
                Order = 0,
            };

            var searchSplitButton = new RibbonSplitButtonData(Messages.Title_ButtonSearch, uriIco.FormatWith("Search"), this.SearchCommand)
            {
                Order = 0,
            };

            searchSplitButton.ControlDataCollection.Add(searchButton);
            searchSplitButton.ControlDataCollection.Add(extendedSerchButton);
            searchSplitButton.ControlDataCollection.Add(topTenButton);
            searchSplitButton.ControlDataCollection.Add(searchByTagButton);

            PluginContext.Host.AddInHome(searchSplitButton, Groups.Tools);
            #endregion
        }
Пример #5
0
 public RibbonGroupData(string name, RibbonButtonData buttonData)
     : this(name, new ObservableCollection <RibbonButtonData>() { buttonData })
 {
 }
Пример #6
0
 private void InitialiseParagraphButtons()
 {
     this.boldButton = new RibbonToggleButtonData()
     {
         Label = Messages.Edition_Bold,
         SmallImage = new Uri(imgUri.FormatWith("Bold"), UriKind.Relative),
         Command = EditingCommands.ToggleBold,
     };
     this.italicButton = new RibbonToggleButtonData()
     {
         Label = Messages.Edition_Italic,
         SmallImage = new Uri(imgUri.FormatWith("Italic"), UriKind.Relative),
         Command = EditingCommands.ToggleItalic,
     };
     this.underlineButton = new RibbonToggleButtonData()
     {
         Label = Messages.Edition_Underline,
         SmallImage = new Uri(imgUri.FormatWith("Underline"), UriKind.Relative),
         Command = EditingCommands.ToggleUnderline,
     };
     this.bulletsButton = new RibbonButtonData()
     {
         Label = Messages.Edition_Bullets,
         SmallImage = new Uri(imgUri.FormatWith("Bullets"), UriKind.Relative),
         Command = EditingCommands.ToggleBullets,
     };
     this.numberingButton = new RibbonButtonData()
     {
         Label = Messages.Edition_Numbering,
         SmallImage = new Uri(imgUri.FormatWith("Numbering"), UriKind.Relative),
         Command = EditingCommands.ToggleNumbering,
     };
 }
Пример #7
0
        private void ConfigureSaveMenu(RibbonTabData tab)
        {
            var revisionsButton = new RibbonButtonData(Messages.Btn_Revisions, imgUri.FormatWith("Undo"), this.View.As<WorkbenchViewModel>().ShowRevisionsCommand);
            var saveButton = new RibbonButtonData(Messages.Title_Save, imgUri.FormatWith("Save"), this.View.As<WorkbenchViewModel>().SaveCommand);
            var splitButton = this.ConfigureSplitButton();
            var macroButton = new RibbonButtonData(Messages.Title_Macro, imgUri.FormatWith("Edit"), new RelayCommand(
                () => this.EditMacro(), () => PluginContext.DoorKeeper.IsUserGranted(To.Write)));

            var cgroup = new RibbonGroupData(Messages.Menu_Actions, 1);
            cgroup.ButtonDataCollection.Add(saveButton);
            cgroup.ButtonDataCollection.Add(revisionsButton);
            cgroup.ButtonDataCollection.Add(splitButton);
            cgroup.ButtonDataCollection.Add(macroButton);
            tab.GroupDataCollection.Add(cgroup);
        }
Пример #8
0
        private void BuildButtons()
        {
            var navigateButton = new RibbonButtonData(Messages.Title_MedicalRecord
                , imgUri.FormatWith("MedicalRecord")
                , this.NavigateWorkbenchCommand) { Order = 2 };

            PluginContext.Host.AddInHome(navigateButton, Groups.Managers);
        }
Пример #9
0
        /// <summary>
        /// Shows the debug menu.
        /// </summary>
        public void ShowDebugMenu(bool showAdminTool)
        {
            if (!this.isDebugMenuVisible)
            {
                if (showAdminTool)
                {
                    var debugButton = new RibbonButtonData(Messages.Btn_Tools
                        , "/Images/Debug.png"
                        , new RelayCommand(() => ViewService.Manager.Show<DebugViewModel>()));

                    var checkVersionButton = new RibbonButtonData(Messages.Btn_CheckNewVersion
                        , "/Images/CheckVersion.png"
                        , new RelayCommand(() => DebugCheckNewVersion()));

                    PluginContext.Host.AddInHome(debugButton, Groups.DebugTools);
                    PluginContext.Host.AddInHome(checkVersionButton, Groups.DebugTools);
                }

                var statisticsButton = new RibbonButtonData(Messages.Btn_UsageStat
                    , "/Images/DebugStat.png"
                    , new RelayCommand(() => PluginContext.Host.Navigate(this.StatisticsPage)));

                PluginContext.Host.AddInHome(statisticsButton, Groups.DebugTools);

                var logButton = new RibbonButtonData(Messages.Btn_Logs
                    , "/Images/ActivityReports.png"
                    , new RelayCommand(() =>
                    {
                        var view = new LogPage();
                        view.As<LogViewModel>().Refresh();

                        PluginContext.Host.Navigate(view);
                    }));

                PluginContext.Host.AddInHome(logButton, Groups.DebugTools);

                this.isDebugMenuVisible = true;
            }
        }
Пример #10
0
        /// <summary>
        /// Builds the buttons for the main menu.
        /// </summary>
        private void BuildButtons()
        {
            this.navigateCommand = new RelayCommand(() => this.NavigateRole(), () => PluginContext.Host.ConnectedUser != null && PluginContext.DoorKeeper.IsUserGranted(To.Administer));

            var navigateButton = new RibbonButtonData(Messages.Title_AuthorisationManager
                    , imgUri.FormatWith("Admin")
                    , navigateCommand) { Order = 4 };

            PluginContext.Host.AddToApplicationMenu(navigateButton);
        }
Пример #11
0
        /// <summary>
        /// Builds the context menu of this plugin.
        /// </summary>
        private void BuildContextMenu()
        {
            var navAddPrescriptionButton = new RibbonButtonData(Messages.Title_AddPrescription
                , imgUri.FormatWith("Add")
                , new RelayCommand(() => this.NavigateAddPrescription(), () => CanNavigateToAddPrescription()));

            var navWorkbenchButton = new RibbonButtonData(Messages.Title_PrescriptionManager
                , imgUri.FormatWith("Prescription")
                , new RelayCommand(() => this.NavigateWorkbench(), () => this.CanNavigatePrescription()));

            var saveButton = new RibbonButtonData(Messages.Btn_Save
                , imgUri.FormatWith("Save")
                , new RelayCommand(() => this.Save(), () => CanSave()));

            var navSearchButton = new RibbonButtonData(Messages.Btn_Search
                , icoUri.FormatWith("Search")
                , new RelayCommand(() => ViewService.Manager.ShowDialog<SearchPrescriptionViewModel>(), () => this.CanNavigateSearch()));

            var addDrugButton = new RibbonButtonData(Messages.Btn_AddDrug
                , imgUri.FormatWith("Drug")
                , new RelayCommand(() => ViewService.Manager.ShowDialog<AddDrugViewModel>()
                    , () => this.lastNavigation == LastNavigation.AddPrescription && PluginContext.DoorKeeper.IsUserGranted(To.Write)));

            var addDrugTypeButton = new RibbonButtonData(Messages.Btn_AddDrugType
                , imgUri.FormatWith("DrugType")
                , new RelayCommand(() => ViewService.Manager.ShowDialog<AddDrugTypeViewModel>()
                    , () => this.lastNavigation == LastNavigation.AddPrescription && PluginContext.DoorKeeper.IsUserGranted(To.Write)));

            var cgroup = new RibbonGroupData(Messages.Menu_Actions);
            var ngroup = new RibbonGroupData(Messages.Menu_Navigation);
            var mgroup = new RibbonGroupData(Messages.Menu_Manage);

            cgroup.ButtonDataCollection.Add(saveButton);
            cgroup.ButtonDataCollection.Add(navSearchButton);

            ngroup.ButtonDataCollection.Add(navWorkbenchButton);
            ngroup.ButtonDataCollection.Add(navAddPrescriptionButton);

            mgroup.ButtonDataCollection.Add(addDrugButton);
            mgroup.ButtonDataCollection.Add(addDrugTypeButton);

            var tab = new RibbonTabData(Messages.Menu_File) { ContextualTabGroupHeader = Messages.Title_PrescriptionManager };
            tab.GroupDataCollection.Add(cgroup);
            tab.GroupDataCollection.Add(ngroup);
            tab.GroupDataCollection.Add(mgroup);

            PluginContext.Host.AddTab(tab);

            this.ContextualMenu = new RibbonContextualTabGroupData(Messages.Title_PrescriptionManager, tab) { Background = Brushes.OrangeRed, IsVisible = false };
            PluginContext.Host.AddContextualMenu(this.ContextualMenu);
        }
Пример #12
0
        /// <summary>
        /// Builds the buttons for the main menu.
        /// </summary>
        private void BuildButtons()
        {
            #region Navigate

            var navigateButton = new RibbonButtonData(Messages.Title_PrescriptionManager
                    , imgUri.FormatWith("Prescription")
                    , new RelayCommand(() => this.NavigateWorkbench(), () => this.CanNavigateWorkbench())) { Order = 4 };
            PluginContext.Host.AddInHome(navigateButton, Groups.Managers);
            #endregion
        }
Пример #13
0
        private void BuildContextMenu()
        {
            var addPicButton = new RibbonButtonData(Messages.Title_BtnAddPic, imgUri.FormatWith("Add"), this.GetAddPicCommand());
            var addTypeButton = new RibbonButtonData(Messages.Title_AddPicType, imgUri.FormatWith("Add"), this.GetAddCategoryCommand());
            var cgroup = new RibbonGroupData(Messages.Menu_Actions);

            cgroup.ButtonDataCollection.Add(addPicButton);
            cgroup.ButtonDataCollection.Add(addTypeButton);

            var tab = new RibbonTabData(Messages.Menu_File, cgroup) { ContextualTabGroupHeader = Messages.Title_Pictures };
            PluginContext.Host.AddTab(tab);

            this.ContextualMenu = new RibbonContextualTabGroupData(Messages.Title_Pictures, tab) { Background = Brushes.OrangeRed, IsVisible = false };
            PluginContext.Host.AddContextualMenu(this.ContextualMenu);
        }
Пример #14
0
        /// <summary>
        /// Initialises this plugin. Basicaly it should configure the menus into the PluginHost
        /// Every task that could throw exception should be in this method and not in the ctor.
        /// </summary>
        public override void Initialise()
        {
            this.ConfigureAutoMapper();
            this.ConfigureViewService();

            this.component = PluginContext.ComponentFactory.GetInstance<IUserSessionComponent>();

            TranslateExtension.ResourceManager = Messages.ResourceManager;

            var splitter = PluginContext.Host.GetMenuInHome("add", Groups.Tools);
            var splitterExist = true;
            if (splitter == null || splitter.GetType() != typeof(RibbonMenuButtonData))
            {
                splitterExist = false;
                splitter = new RibbonMenuButtonData(Messages.Btn_Add, uri.FormatWith("Add"), null)
                {
                    Order = 1,
                    Name = "add",
                };
            }

            var addButton = new RibbonMenuItemData(Messages.Title_ButtonAddUser, uri.FormatWith("Add"), this.addUserCommand) { Order = 3, };
            (splitter as RibbonMenuButtonData).ControlDataCollection.Add(addButton);
            if (!splitterExist) PluginContext.Host.AddInHome((splitter as RibbonMenuButtonData), Groups.Tools);

            var navigateButton = new RibbonButtonData(Messages.Title_Deconnection
                , uri.FormatWith("Administration")
                , this.DisconnectCommand) { Order = int.MaxValue - 1 };

            PluginContext.Host.AddToApplicationMenu(navigateButton);

            this.InitialiseConnectionPage();
            this.InitialiseUpdateUserPage();
        }
Пример #15
0
 public RibbonGroupData(string name, RibbonButtonData buttonData)
     : this(name, new ObservableCollection<RibbonButtonData>() { buttonData })
 {
 }