Example #1
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,
     };
 }
Example #2
0
        private void BuildContextMenu()
        {
            var saveButton = new RibbonButtonData(Messages.Title_Save, imgUri.FormatWith("Save"), this.View.As <WorkbenchViewModel>().SaveCommand);

            var splitter = new RibbonMenuItemData(Messages.Btn_Add, imgUri.FormatWith("Add"), null);

            splitter.ControlDataCollection.Add(new RibbonMenuItemData(Messages.Title_AddDoctor, imgUri.FormatWith("Add"), this.addDoctorCommand));
            splitter.ControlDataCollection.Add(new RibbonMenuItemData(Messages.Title_AddSpecialisation, imgUri.FormatWith("Add"), this.addSpecialisationCommand));
            splitter.ControlDataCollection.Add(new RibbonMenuItemData(Messages.Title_AddInsurance, imgUri.FormatWith("Add"), this.addInsuranceCommand));
            splitter.ControlDataCollection.Add(new RibbonMenuItemData(Messages.Title_AddReputation, imgUri.FormatWith("Add"), this.addReputationCommand));
            splitter.ControlDataCollection.Add(new RibbonMenuItemData(Messages.Title_AddPractice, imgUri.FormatWith("Add"), this.addPracticeCommand));
            splitter.ControlDataCollection.Add(new RibbonMenuItemData(Messages.Title_AddProfession, imgUri.FormatWith("Add"), this.addProfessionCommand));

            var cgroup = new RibbonGroupData(Messages.Menu_Actions);

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

            var tab = new RibbonTabData(Messages.Menu_File)
            {
                ContextualTabGroupHeader = Messages.Title_ContextMenu
            };

            tab.GroupDataCollection.Add(cgroup);
            PluginContext.Host.AddTab(tab);

            this.ContextualMenu = new RibbonContextualTabGroupData(Messages.Title_ContextMenu, tab)
            {
                Background = Brushes.OrangeRed, IsVisible = false
            };
            PluginContext.Host.AddContextualMenu(this.ContextualMenu);
        }
Example #3
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);
        }
Example #4
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);
        }
Example #5
0
        private void BuildButtons()
        {
            var navigateButton = new RibbonButtonData(Messages.Title_MedicalRecord
                                                      , imgUri.FormatWith("MedicalRecord")
                                                      , this.NavigateWorkbenchCommand)
            {
                Order = 2
            };

            PluginContext.Host.AddInHome(navigateButton, Groups.Managers);
        }
Example #6
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_FamilyManager
                                                      , imgUri.FormatWith("Users")
                                                      , navigateCommand)
            {
                Order = 7
            };

            PluginContext.Host.AddInHome(navigateButton, Groups.Managers);
        }
        /// <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_AdministratorManager
                                                      , imgUri.FormatWith("Administration")
                                                      , navigateCommand)
            {
                Order = 4
            };

            PluginContext.Host.AddToApplicationMenu(navigateButton);
        }
Example #8
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
        }
Example #9
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);
        }
Example #10
0
        /// <summary>
        /// Builds the buttons for the main menu.
        /// </summary>
        private void BuildButtons()
        {
            this.navigateCommand = new RelayCommand(() => this.Navigate());

            var navigateButton = new RibbonButtonData(Messages.Title_FirstAidManager
                                                      , imgUri.FormatWith("FirstAidKit")
                                                      , navigateCommand)
            {
                Order = 999
            };

            PluginContext.Host.AddToApplicationMenu(navigateButton);

            //PluginContext.Host.AddInHome(navigateButton, Groups.GlobalTools);
        }
Example #11
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);
        }
Example #12
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();
        }
Example #13
0
        private void BuildButtons()
        {
            this.navigateCommand = new RelayCommand(() => this.Navigate(), () => this.CanNavigate());

            this.addDoctorCommand         = new RelayCommand(() => ViewService.Manager.ShowDialog <CreateDoctorViewModel>(), () => this.IsGrantedToWrite());
            this.addSpecialisationCommand = new RelayCommand(() => ViewService.Manager.ShowDialog <AddSpecialisationViewModel>(), () => this.IsGrantedToWrite());
            this.addInsuranceCommand      = new RelayCommand(() => ViewService.Manager.ShowDialog <AddInsuranceViewModel>(), () => this.IsGrantedToWrite());
            this.addReputationCommand     = new RelayCommand(() => ViewService.Manager.ShowDialog <AddReputationViewModel>(), () => this.IsGrantedToWrite());
            this.addPracticeCommand       = new RelayCommand(() => ViewService.Manager.ShowDialog <AddPracticeViewModel>(), () => this.IsGrantedToWrite());
            this.addProfessionCommand     = new RelayCommand(() => ViewService.Manager.ShowDialog <AddProfessionViewModel>(), () => this.IsGrantedToWrite());

            var navigateButton = new RibbonButtonData(Messages.Title_PatientDataManager
                                                      , imgUri.FormatWith("Properties")
                                                      , navigateCommand)
            {
                Order = 1
            };

            PluginContext.Host.AddInHome(navigateButton, Groups.Managers);
        }
Example #14
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);
        }
Example #15
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;
            }
        }
Example #16
0
        /// <summary>
        /// Builds the context menu the ribbon for this plugin.
        /// </summary>
        private void BuildContextMenu()
        {
            var vacuumButton = new RibbonButtonData(Messages.Btn_Vacuum
                                                    , imgUri.FormatWith("Vacuum")
                                                    , new RelayCommand(() => VacuumDatabase()));
            var cgroup = new RibbonGroupData(Messages.Menu_Actions);

            cgroup.ButtonDataCollection.Add(vacuumButton);

            var tab = new RibbonTabData(Messages.Menu_File)
            {
                ContextualTabGroupHeader = Messages.Title_FirstAidManager
            };

            tab.GroupDataCollection.Add(cgroup);

            PluginContext.Host.AddTab(tab);

            this.ContextualMenu = new RibbonContextualTabGroupData(Messages.Title_FirstAidManager, tab)
            {
                Background = Brushes.OrangeRed, IsVisible = false
            };
            PluginContext.Host.AddContextualMenu(this.ContextualMenu);
        }
Example #17
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
        }