Exemplo n.º 1
0
        /// <summary>
        /// Builds the context menu of this plugin.
        /// </summary>
        private void BuildContextMenu()
        {
            var counter = 0;
            var cgroup = new RibbonGroupData(Messages.Menu_Actions, 1);
            var tab = new RibbonTabData() { Header = Messages.Menu_File, ContextualTabGroupHeader = Messages.Title_PathologyManager };

            tab.GroupDataCollection.Add(cgroup);
            this.ContextualMenu = new RibbonContextualTabGroupData(Messages.Title_PathologyManager, tab) { Background = Brushes.OrangeRed, IsVisible = false, };
            PluginContext.Host.AddContextualMenu(this.ContextualMenu);
            PluginContext.Host.AddTab(tab);

            ICommand addPeriodCommand = new RelayCommand(() => ViewService.Manager.ShowDialog<AddPeriodViewModel>()
                , () => PluginContext.DoorKeeper.IsUserGranted(To.Write));
            cgroup.ButtonDataCollection.Add(new RibbonButtonData(Messages.Title_AddPeriods, imgUri.FormatWith("Add"), addPeriodCommand) { Order = counter++ });

            ICommand addPathologyCategory = new RelayCommand(() => ViewService.Manager.ShowDialog<AddPathologyCategoryViewModel>()
                , () => PluginContext.DoorKeeper.IsUserGranted(To.Write));
            cgroup.ButtonDataCollection.Add(new RibbonButtonData(Messages.Title_AddPathologyCategory, imgUri.FormatWith("PathologyType"), addPathologyCategory) { Order = counter++ });

            ICommand addPathologyCommand = new RelayCommand(() => ViewService.Manager.ShowDialog<AddPathologyViewModel>()
                , () => PluginContext.DoorKeeper.IsUserGranted(To.Write));
            cgroup.ButtonDataCollection.Add(new RibbonButtonData(Messages.Title_AddPathology, imgUri.FormatWith("Pathology"), addPathologyCommand) { Order = counter++ });
        }
Exemplo n.º 2
0
        /// <summary>
        /// Builds the context menu of this plugin.
        /// </summary>
        private void BuildContextMenu()
        {
            var tab = new RibbonTabData() { Header = BaseText.Menu_File, ContextualTabGroupHeader = Messages.Title_AdministratorManager };
            this.ContextualMenu = new RibbonContextualTabGroupData(Messages.Title_AdministratorManager, tab) { Background = Brushes.OrangeRed, IsVisible = false, };
            var cgroup = new RibbonGroupData(Messages.Group_Add, 1);

            tab.GroupDataCollection.Add(cgroup);
            PluginContext.Host.AddContextualMenu(this.ContextualMenu);
            PluginContext.Host.AddTab(tab);

            int i = 0;
            var buttons = new List<RibbonButtonData>();

            buttons.Add(new RibbonButtonData(Messages.Title_AddInsurance, imgUri.FormatWith("Insurance")
                , new RelayCommand(() => ViewService.Manager.ShowDialog<AddInsuranceViewModel>(), () => PluginContext.DoorKeeper.IsUserGranted(To.Write))) { Order = i++ });

            buttons.Add(new RibbonButtonData(Messages.Title_AddPractice, imgUri.FormatWith("Practice")
                , new RelayCommand(() => ViewService.Manager.ShowDialog<AddPracticeViewModel>(), () => PluginContext.DoorKeeper.IsUserGranted(To.Write))) { Order = i++ });

            buttons.Add(new RibbonButtonData(Messages.Title_AddDrugType, imgUri.FormatWith("DrugType")
                , new RelayCommand(() => ViewService.Manager.ShowDialog<AddDrugTypeViewModel>(), () => PluginContext.DoorKeeper.IsUserGranted(To.Write))) { Order = i++ });

            buttons.Add(new RibbonButtonData(Messages.Title_AddDrug, imgUri.FormatWith("Drug")
                , new RelayCommand(() => ViewService.Manager.ShowDialog<AddDrugViewModel>(), () => PluginContext.DoorKeeper.IsUserGranted(To.Write))) { Order = i++ });

            buttons.Add(new RibbonButtonData(Messages.Title_AddPathologyType, imgUri.FormatWith("PathologyType")
                , new RelayCommand(() => ViewService.Manager.ShowDialog<AddPathologyTypeViewModel>(), () => PluginContext.DoorKeeper.IsUserGranted(To.Write))) { Order = i++ });

            buttons.Add(new RibbonButtonData(Messages.Title_AddPathology, imgUri.FormatWith("Pathology")
                , new RelayCommand(() => ViewService.Manager.ShowDialog<AddPathologyViewModel>(), () => PluginContext.DoorKeeper.IsUserGranted(To.Write))) { Order = i++ });

            buttons.Add(new RibbonButtonData(Messages.Title_AddProfession, imgUri.FormatWith("Job")
                , new RelayCommand(() => ViewService.Manager.ShowDialog<AddProfessionViewModel>(), () => PluginContext.DoorKeeper.IsUserGranted(To.Write))) { Order = i++ });

            buttons.Add(new RibbonButtonData(Messages.Title_AddReputation, imgUri.FormatWith("Reputation")
                , new RelayCommand(() => ViewService.Manager.ShowDialog<AddReputationViewModel>(), () => PluginContext.DoorKeeper.IsUserGranted(To.Write))) { Order = i++ });

            buttons.Add(new RibbonButtonData(Messages.Title_AddPictureType, imgUri.FormatWith("PictureType")
                , new RelayCommand(() => ViewService.Manager.ShowDialog<AddPictureTypeViewModel>(), () => PluginContext.DoorKeeper.IsUserGranted(To.Write))) { Order = i++ });

            buttons.Add(new RibbonButtonData(Messages.Title_AddSpecialisation, imgUri.FormatWith("Specialisation")
                , new RelayCommand(() => ViewService.Manager.ShowDialog<AddSpecialisationViewModel>(), () => PluginContext.DoorKeeper.IsUserGranted(To.Write))) { Order = i++ });

            buttons.Add(new RibbonButtonData(Messages.Title_AddDoctor, imgUri.FormatWith("Doctor")
                , new RelayCommand(() => ViewService.Manager.ShowDialog<AddDoctorViewModel>(), () => PluginContext.DoorKeeper.IsUserGranted(To.Write))) { Order = i++ });

            buttons.Add(new RibbonButtonData(Messages.Title_AddSearchTag, imgUri.FormatWith("SearchTag")
                , new RelayCommand(() => ViewService.Manager.ShowDialog<AddSearchTagViewModel>(), () => PluginContext.DoorKeeper.IsUserGranted(To.Write))) { Order = i++ });

            foreach (var button in buttons) { cgroup.ButtonDataCollection.Add(button); }
        }
Exemplo n.º 3
0
        /// <summary>
        /// Builds the context menu of this plugin.
        /// </summary>
        private void BuildContextMenu()
        {
            var cgroup = new RibbonGroupData(Messages.Menu_Actions, 1);
            var tab = new RibbonTabData() { Header = Messages.Menu_File, ContextualTabGroupHeader = Messages.Title_MeetingsManager };

            tab.GroupDataCollection.Add(cgroup);
            this.ContextualMenu = new RibbonContextualTabGroupData(Messages.Title_MeetingsManager, tab) { Background = Brushes.OrangeRed, IsVisible = false, };
            PluginContext.Host.AddContextualMenu(this.ContextualMenu);
            PluginContext.Host.AddTab(tab);

            ICommand addCommand = new RelayCommand(() => ViewService.Manager.ShowDialog<AddMeetingViewModel>(), () => IsCalendatEditor);
            cgroup.ButtonDataCollection.Add(new RibbonButtonData(Messages.Title_AddMeeting, imgUri.FormatWith("Add"), addCommand) { Order = 1, });

            ICommand removeCommand = new RelayCommand(() => ViewService.Manager.ShowDialog<RemoveMeetingViewModel>(), () => IsCalendatEditor);
            cgroup.ButtonDataCollection.Add(new RibbonButtonData(Messages.Title_RemoveMeeting, imgUri.FormatWith("Delete"), removeCommand) { Order = 2, });

            ICommand addCategoryCommand = new RelayCommand(() => ViewService.Manager.ShowDialog<AddCategoryViewModel>(), () => IsCalendatEditor);
            cgroup.ButtonDataCollection.Add(new RibbonButtonData(Messages.Msg_AddCategory, imgUri.FormatWith("AddCategory"), addCategoryCommand) { Order = 3, });
        }
Exemplo n.º 4
0
 /// <summary>
 /// Adds the specified tab.
 /// </summary>
 /// <param name="tab">The tab.</param>
 public void AddTab(RibbonTabData tab)
 {
     this.Dispatcher.Invoke((Action)delegate { App.RibbonData.TabDataCollection.Add(tab); });
 }
Exemplo n.º 5
0
        private void AddButton(RibbonTabData tab, string goupName, RibbonControlData button)
        {
            var group = (from g in tab.GroupDataCollection
                         where g.Header == goupName
                         select g).FirstOrDefault();

            if (group == null) throw new PluginException(Messages.PluginException_HomeMenuVoid);

            group.ButtonDataCollection.Add(button);
            // I use ToList() because it makes a copy of the list. Otherwise, clearing the ObservableCollection
            // clears the linq result.
            group.ButtonDataCollection.Refill(group.ButtonDataCollection.OrderBy(e => e.Order).ToList());
        }
Exemplo n.º 6
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);
        }
Exemplo n.º 7
0
 /// <summary>
 /// Initializes a new instance of the <see cref="RibbonContextualTabGroupData"/> class.
 /// </summary>
 /// <param name="header">The header.</param>
 /// <param name="tabData">The tab data.</param>
 public RibbonContextualTabGroupData(string header, RibbonTabData tabData)
     : this(header, new ObservableCollection <RibbonTabData>() { tabData })
 {
 }
Exemplo n.º 8
0
 private void ConfigureFontGroup(RibbonTabData tab)
 {
     var fontGroup = new RibbonGroupData()
     {
         Header = Messages.Menu_Font,
         Order = 50,
     };
     fontGroup.ButtonDataCollection.Add(this.boldButton);
     fontGroup.ButtonDataCollection.Add(this.italicButton);
     fontGroup.ButtonDataCollection.Add(this.underlineButton);
     fontGroup.ButtonDataCollection.Add(this.bulletsButton);
     fontGroup.ButtonDataCollection.Add(this.numberingButton);
     //fontGroup.ButtonDataCollection.Add(this.fontsComboBox);
     //fontGroup.ButtonDataCollection.Add(this.fontsSizeComboBox);
     tab.GroupDataCollection.Add(fontGroup);
 }
Exemplo n.º 9
0
        private void ConfigureParagraphGroup(RibbonTabData tab)
        {
            var paragraphGroup = new RibbonGroupData()
            {
                Header = Messages.Menu_Paragraph,
                Order = 51,
            };
            paragraphGroup.ButtonDataCollection.Add(this.centerAllignButton);
            paragraphGroup.ButtonDataCollection.Add(this.justifyAllignButton);
            paragraphGroup.ButtonDataCollection.Add(this.leftAllignButton);
            paragraphGroup.ButtonDataCollection.Add(this.rightAllignButton);

            tab.GroupDataCollection.Add(paragraphGroup);
        }
Exemplo n.º 10
0
        private void BuildContextMenu()
        {
            var tab = new RibbonTabData()
            {
                Header = Messages.Menu_File,
                ContextualTabGroupHeader = Messages.Title_MedicalRecord
            };

            this.ConfigureSaveMenu(tab);
            this.ConfigureFontGroup(tab);
            this.ConfigureParagraphGroup(tab);
            PluginContext.Host.AddTab(tab);

            this.ContextualMenu = new RibbonContextualTabGroupData(Messages.Title_MedicalRecord, tab)
            {
                Background = Brushes.OrangeRed,
                IsVisible = false,
            };

            PluginContext.Host.AddContextualMenu(this.ContextualMenu);
        }
Exemplo n.º 11
0
        /// <summary>
        /// Builds the context menu the ribbon for this plugin.
        /// </summary>
        private void BuildContextMenu()
        {
            var ngroup = new RibbonGroupData(Messages.Menu_Navigation, 1);
            var cgroup = new RibbonGroupData(Messages.Menu_Actions, 2);

            var tab = new RibbonTabData() { Header = Messages.Menu_File, ContextualTabGroupHeader = Messages.Title_AuthorisationManager };
            tab.GroupDataCollection.Add(cgroup);
            tab.GroupDataCollection.Add(ngroup);

            this.ContextualMenu = new RibbonContextualTabGroupData(Messages.Title_AuthorisationManager, tab) { Background = Brushes.OrangeRed, IsVisible = false, };
            PluginContext.Host.AddContextualMenu(this.ContextualMenu);
            PluginContext.Host.AddTab(tab);

            ICommand roleCommand = new RelayCommand(() => this.NavigateRole(), () => this.CanNavigateRole());
            ngroup.ButtonDataCollection.Add(new RibbonButtonData(Messages.Title_RoleManager, imgUri.FormatWith("Admin"), roleCommand) { Order = 1, });

            ICommand userCommand = new RelayCommand(() => this.NavigateUser(), () => this.CanNavigateUser());
            ngroup.ButtonDataCollection.Add(new RibbonButtonData(Messages.Title_UserManager, imgUri.FormatWith("UserSetup"), userCommand) { Order = 2, });

            ICommand addRoleCommand = new RelayCommand(() => ViewService.Manager.ShowDialog<AddRoleViewModel>());
            cgroup.ButtonDataCollection.Add(new RibbonButtonData(Messages.Title_AddRole, imgUri.FormatWith("New"), addRoleCommand) { Order = 2, });
        }
Exemplo n.º 12
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);
        }
Exemplo n.º 13
0
        /// <summary>
        /// Builds the context menu the ribbon for this plugin.
        /// </summary>
        private void BuildContextMenu()
        {
            this.addRelationCommand = new RelayCommand(() => this.NavigateRelation(), () => this.CanNavigateRelation());

            var cgroup = new RibbonGroupData(Messages.Menu_Actions);
            cgroup.ButtonDataCollection.Add(new RibbonButtonData(Messages.Title_AddRelation, imgUri.FormatWith("Add"), addRelationCommand));

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

            this.ContextualMenu = new RibbonContextualTabGroupData(Messages.Title_FamilyManager, tab) { Background = Brushes.OrangeRed, IsVisible = false, };
            PluginContext.Host.AddContextualMenu(this.ContextualMenu);
        }
Exemplo n.º 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);
        }