コード例 #1
0
        // 05

        protected override void RegisterTypes(IContainerRegistry containerRegistry)
        {
            Int64 startTicks = Log.APPLICATION_INITIALIZE("Enter", Common.LOG_CATEGORY);

            //containerRegistry.RegisterSingleton<ICustomerDataService, CustomerDataServiceMock>();
            //containerRegistry.RegisterSingleton<IMaterialDataService, MaterialDataServiceMock>();

            // TODO(crhodes)
            // Think this is where we switch to using the Generic Repository.
            // But how to avoid pulling knowledge of EF Context in.  Maybe Service hides details
            // of
            //containerRegistry.RegisterSingleton<IAddressDataService, AddressDataService>();
            // AddressDataService2 has a constructor that takes a CustomPoolAndSpaDbContext.

            //containerRegistry.RegisterSingleton<ICatLookupDataService, CatLookupDataService>();

            // Common Dialogs used by most applications.

            containerRegistry.RegisterDialog <NotificationDialog, NotificationDialogViewModel>("NotificationDialog");
            containerRegistry.RegisterDialog <OkCancelDialog, OkCancelDialogViewModel>("OkCancelDialog");
            containerRegistry.RegisterDialog <ExportGridDialog, ExportGridDialogViewModel>("ExportGridDialog");

            // Add the new UI elements

            Log.APPLICATION_INITIALIZE("Exit", Common.LOG_CATEGORY, startTicks);
        }
コード例 #2
0
        // 06

        //protected override void ConfigureServiceLocator()
        //{
        //    Int64 startTicks = Log.APPLICATION_INITIALIZE("Enter", Common.LOG_CATEGORY);

        //    base.ConfigureServiceLocator();

        //    Log.APPLICATION_INITIALIZE("Exit", Common.LOG_CATEGORY, startTicks);
        //}

        // 07 - Configure the catalog of modules
        // Modules are loaded at Startup and must be a project reference

        protected override void ConfigureModuleCatalog(IModuleCatalog moduleCatalog)
        {
            Int64 startTicks = Log.APPLICATION_INITIALIZE("Enter", Common.LOG_CATEGORY);

            //NOTE(crhodes)
            // Order matters here.

            moduleCatalog.AddModule(typeof(AZDORestApiExplorerModule));

            moduleCatalog.AddModule(typeof(HTTPExchangeModule));

            // These come from other assemblies

            moduleCatalog.AddModule(typeof(AccountsModule));

            moduleCatalog.AddModule(typeof(ArtifactsModule));

            moduleCatalog.AddModule(typeof(BuildModule));

            moduleCatalog.AddModule(typeof(DashboardModule));

            moduleCatalog.AddModule(typeof(GitModule));

            moduleCatalog.AddModule(typeof(GraphModule));

            moduleCatalog.AddModule(typeof(TestModule));

            moduleCatalog.AddModule(typeof(TokensModule));

            moduleCatalog.AddModule(typeof(WorkItemTrackingModule));

            moduleCatalog.AddModule(typeof(WorkItemTrackingProcessModule));

            Log.APPLICATION_INITIALIZE("Exit", Common.LOG_CATEGORY, startTicks);
        }
コード例 #3
0
        /// <summary>
        /// LoadXamlApplicationResources
        ///
        /// Creates Xaml Resources collection in System.Windows.Application
        /// for use in Hosted applications without App.Xaml
        /// </summary>
        ///

        private static void CreateXamlApplication()
        {
            long startTicks = Log.APPLICATION_INITIALIZE("Enter", Common.PROJECT_NAME);

            Common.DeveloperMode = true;
            Common.WriteToDebugWindow("CreateXamlApplication()");
            Common.DeveloperMode = false;

            try
            {
                // TODO(crhodes)
                // Can we just create a PrismApplication?

                // Create a WPF Application
                Common.XamlApplication = new System.Windows.Application();

                var defaultThemes = Theme.Themes;
                ApplicationThemeHelper.ApplicationThemeName = "MetropolisDark";

                // Load the resources

                // This works

                //var resources = System.Windows.Application.LoadComponent(
                //    new Uri("SupportTools_Excel;component/Resources/Xaml/Brushes.xaml", UriKind.Relative)) as System.Windows.ResourceDictionary;

                // Now lets try with

                var resources = System.Windows.Application.LoadComponent(
                    new Uri("SupportTools_Excel;component/Resources/Xaml/Application.xaml", UriKind.Relative)) as System.Windows.ResourceDictionary;

                //var resources = System.Windows.Application.LoadComponent(
                //    new Uri("pack:/SupportTools_Excel;:,,/Resources/Xaml/Application.xaml")) as System.Windows.ResourceDictionary;

                // Merge it on application level

                Common.XamlApplication.Resources.MergedDictionaries.Add(resources);

                // Wire in Prism Bootstrapper

                //try
                //{
                //    var bootstrapper = new Bootstrapper();
                //    bootstrapper.Run();
                //}
                //catch (Exception ex)
                //{
                //    MessageBox.Show(ex.ToString());
                //}
            }
            catch (Exception ex)
            {
                Common.DeveloperMode = true;
                Common.WriteToDebugWindow(ex.ToString());
                Common.DeveloperMode = false;
            }

            Log.APPLICATION_INITIALIZE("Exit", Common.PROJECT_NAME, startTicks);
        }
コード例 #4
0
ファイル: App.xaml.cs プロジェクト: chrhodes/VisualStudio
        // 04

        protected override void RegisterRequiredTypes(IContainerRegistry containerRegistry)
        {
            Int64 startTicks = Log.APPLICATION_INITIALIZE("Enter", Common.LOG_CATEGORY);

            base.RegisterRequiredTypes(containerRegistry);

            Log.APPLICATION_INITIALIZE("Exit", Common.LOG_CATEGORY, startTicks);
        }
コード例 #5
0
        //protected override RegionAdapterMappings ConfigureRegionAdapterMappings()
        //{
        //    long startTicks = Log.APPLICATION_INITIALIZE("Enter", Common.PROJECT_NAME);

        //    RegionAdapterMappings mappings = base.ConfigureRegionAdapterMappings();

        //    mappings.RegisterMapping(typeof(StackPanel), Container.TryResolve<StackPanelRegionAdapter>());

        //    Log.APPLICATION_INITIALIZE("Exit", Common.PROJECT_NAME, startTicks);

        //    return mappings;
        //}

        protected override IContainerExtension CreateContainerExtension()
        {
            Int64 startTicks = Log.APPLICATION_INITIALIZE("Enter", Common.LOG_CATEGORY);

            Log.APPLICATION_INITIALIZE("Exit", Common.LOG_CATEGORY, startTicks);

            return(new UnityContainerExtension());
        }
コード例 #6
0
ファイル: App.xaml.cs プロジェクト: chrhodes/VisualStudio
        // 13

        protected override void InitializeModules()
        {
            Int64 startTicks = Log.APPLICATION_INITIALIZE("Enter", Common.LOG_CATEGORY);

            base.InitializeModules();

            Log.APPLICATION_INITIALIZE("Exit", Common.LOG_CATEGORY, startTicks);
        }
コード例 #7
0
ファイル: App.xaml.cs プロジェクト: chrhodes/VisualStudio
        // 12

        protected override void InitializeShell(Window shell)
        {
            Int64 startTicks = Log.APPLICATION_INITIALIZE("Enter", Common.LOG_CATEGORY);

            base.InitializeShell(shell);

            Log.APPLICATION_INITIALIZE("Exit", Common.LOG_CATEGORY, startTicks);
        }
コード例 #8
0
ファイル: Bootstrapper.cs プロジェクト: chrhodes/Office
        //protected override RegionAdapterMappings ConfigureRegionAdapterMappings()
        //{
        //    Log.Trace("Enter", Common.LOG_CATEGORY);
        //    RegionAdapterMappings mappings = base.ConfigureRegionAdapterMappings();

        //    mappings.RegisterMapping(typeof(StackPanel), Container.TryResolve<StackPanelRegionAdapter>());

        //    Log.Trace("Exit", Common.LOG_CATEGORY);
        //    return mappings;
        //}

        //protected override IContainerExtension CreateContainerExtension()
        //{
        //    Int64 startTicks = Log.APPLICATION_INITIALIZE("Enter", Common.LOG_CATEGORY);

        //    Log.APPLICATION_INITIALIZE("Exit", Common.LOG_CATEGORY, startTicks);

        //}

        protected override void ConfigureDefaultRegionBehaviors(IRegionBehaviorFactory regionBehaviors)
        {
            Int64 startTicks = Log.APPLICATION_INITIALIZE("Enter", Common.LOG_CATEGORY);

            base.ConfigureDefaultRegionBehaviors(regionBehaviors);

            Log.APPLICATION_INITIALIZE("Exit", Common.LOG_CATEGORY, startTicks);
        }
コード例 #9
0
ファイル: App.xaml.cs プロジェクト: chrhodes/VisualStudio
        // 10

        protected override void RegisterFrameworkExceptionTypes()
        {
            Int64 startTicks = Log.APPLICATION_INITIALIZE("Enter", Common.LOG_CATEGORY);

            base.RegisterFrameworkExceptionTypes();

            Log.APPLICATION_INITIALIZE("Exit", Common.LOG_CATEGORY, startTicks);
        }
コード例 #10
0
ファイル: App.xaml.cs プロジェクト: chrhodes/VisualStudio
        // 08

        protected override void ConfigureRegionAdapterMappings(RegionAdapterMappings regionAdapterMappings)
        {
            Int64 startTicks = Log.APPLICATION_INITIALIZE("Enter", Common.LOG_CATEGORY);

            base.ConfigureRegionAdapterMappings(regionAdapterMappings);

            Log.APPLICATION_INITIALIZE("Exit", Common.LOG_CATEGORY, startTicks);
        }
コード例 #11
0
ファイル: Bootstrapper.cs プロジェクト: chrhodes/Office
        // Step 1a - Create the catalog of Modules

        protected override IModuleCatalog CreateModuleCatalog()
        {
            Int64 startTicks = Log.APPLICATION_INITIALIZE("Enter", Common.LOG_CATEGORY);

            Log.APPLICATION_INITIALIZE("Exit", Common.LOG_CATEGORY, startTicks);

            return(new ConfigurationModuleCatalog());
        }
コード例 #12
0
        // 11

        protected override Window CreateShell()
        {
            Int64 startTicks = Log.APPLICATION_INITIALIZE("Enter", Common.LOG_CATEGORY);

            Log.APPLICATION_INITIALIZE("Exit", Common.LOG_CATEGORY, startTicks);

            return(Container.Resolve <MainWindow>());
        }
コード例 #13
0
        // Step 1a - Create the catalog of Modules

        protected override IModuleCatalog CreateModuleCatalog()
        {
            long startTicks = Log.APPLICATION_INITIALIZE("Enter", Common.PROJECT_NAME);

            Log.APPLICATION_INITIALIZE("Exit", Common.PROJECT_NAME, startTicks);

            return(new ConfigurationModuleCatalog());
        }
コード例 #14
0
ファイル: App.xaml.cs プロジェクト: chrhodes/VisualStudio
        // 01

        protected override void ConfigureViewModelLocator()
        {
            Int64 startTicks = Log.APPLICATION_INITIALIZE("Enter", Common.LOG_CATEGORY);

            base.ConfigureViewModelLocator();

            Log.APPLICATION_INITIALIZE("Exit", Common.LOG_CATEGORY, startTicks);
        }
コード例 #15
0
        // Step 5 - Show the MainWindow

        //protected override void InitializeShell()
        //{
        //    var regionManager = RegionManager.GetRegionManager(Shell);
        //    RegionManagerAware.SetRegionManagerAware(Shell, regionManager);

        //    Application.Current.MainWindow.Show();

        protected override void ConfigureRegionAdapterMappings(RegionAdapterMappings regionAdapterMappings)
        {
            Int64 startTicks = Log.APPLICATION_INITIALIZE("Enter", Common.LOG_CATEGORY);

            base.ConfigureRegionAdapterMappings(regionAdapterMappings);
            regionAdapterMappings.RegisterMapping(typeof(StackPanel), Container.Resolve <StackPanelRegionAdapter>());

            Log.APPLICATION_INITIALIZE("Exit", Common.LOG_CATEGORY, startTicks);
        }
コード例 #16
0
ファイル: Bootstrapper.cs プロジェクト: chrhodes/Office
        //protected override void ConfigureContainer()
        //{
        //    Log.Trace("Enter", Common.LOG_CATEGORY);
        //    Container.RegisterType<IEditTextViewModel, EditTextViewModel>();
        //    Container.RegisterType<EditText>();

        //    Container.RegisterType<EditParagraphViewModel>();
        //    Container.RegisterType<EditParagraph>();


        //    Container.RegisterType<EditControlRowsViewModel>();
        //    Container.RegisterType<EditControlRows>();

        //    base.ConfigureContainer();
        //    Log.Trace("Exit", Common.LOG_CATEGORY);

        //    // Create a Singleton ShellService (DialogService)
        //    //Container.RegisterType<IShellService, ShellService>(new ContainerControlledLifetimeManager());
        //}

        // Step 3 - Configure the RegionAdapters if any custom ones have been created

        // Step 4 - Create the Shell that will hold the modules in designated regions.

        protected override DependencyObject CreateShell()
        {
            Int64 startTicks = Log.APPLICATION_INITIALIZE("Enter", Common.LOG_CATEGORY);

            Log.APPLICATION_INITIALIZE("Exit (null)", Common.LOG_CATEGORY, startTicks);
            return(null);
            //return Container.Resolve<Views.MainWindow>();
            //return Container.TryResolve<Views.MainWindow>();
        }
コード例 #17
0
        //protected override void ConfigureContainer()
        //{
        //    long startTicks = Log.APPLICATION_INITIALIZE("Enter", Common.PROJECT_NAME);
        //    //Container.RegisterType<IEditTextViewModel, EditTextViewModel>();
        //    //Container.RegisterType<EditText>();

        //    Container.RegisterType<CatViewModel>();
        //    Container.RegisterType<Cat>();
        //    Container.RegisterType<Cat3>();

        //    base.ConfigureContainer();


        //    // Create a Singleton ShellService (DialogService)
        //    //Container.RegisterType<IShellService, ShellService>(new ContainerControlledLifetimeManager());

        //    Log.APPLICATION_INITIALIZE("Exit", Common.PROJECT_NAME, startTicks);
        //}

        // Step 3 - Configure the RegionAdapters if any custom ones have been created

        // Step 4 - Create the Shell that will hold the modules in designated regions.

        protected override DependencyObject CreateShell()
        {
            long startTicks = Log.APPLICATION_INITIALIZE("Enter", Common.PROJECT_NAME);

            Log.APPLICATION_INITIALIZE($"Exit (null)", Common.PROJECT_NAME, startTicks);

            return(null);
            //return Container.Resolve<Views.MainWindow>();
            //return Container.TryResolve<Views.MainWindow>();
        }
コード例 #18
0
        //protected override void ConfigureModuleCatalog()
        //{
        //    long startTicks = Log.APPLICATION_INITIALIZE("Enter", Common.PROJECT_NAME);

        //    var moduleCatalog = (ModuleCatalog)ModuleCatalog;
        //    moduleCatalog.AddModule(typeof(ModuleAModule));

        //    //moduleCatalog.AddModule(typeof(EditTextModule));

        //    //Type moduleAType = typeof(ModuleAModule);

        //    //moduleCatalog.AddModule(new ModuleInfo()
        //    //{
        //    //    ModuleName = moduleAType.Name,
        //    //    ModuleType = moduleAType.AssemblyQualifiedName,
        //    //    InitializationMode = InitializationMode.WhenAvailable
        //    //    // InitializationMode = InitializationMode.OnDemand
        //    //});

        //    Log.APPLICATION_INITIALIZE("Exit", Common.PROJECT_NAME, startTicks);
        //}

        // Step 2 - Configure the container

        protected override void RegisterRequiredTypes(IContainerRegistry containerRegistry)
        {
            Int64 startTicks = Log.APPLICATION_INITIALIZE("Enter", Common.LOG_CATEGORY);

            // Registers all types that are required by Prism to function with the container.

            base.RegisterRequiredTypes(containerRegistry);

            Log.APPLICATION_INITIALIZE("Exit", Common.LOG_CATEGORY, startTicks);
        }
コード例 #19
0
ファイル: App.xaml.cs プロジェクト: chrhodes/VisualStudio
        //NOTE(crhodes)
        // This has been removed in Prism 8.0

        // 06

        // protected override void ConfigureServiceLocator()
        // {
        // Int64 startTicks = Log.APPLICATION_INITIALIZE("Enter", Common.LOG_CATEGORY);

        // base.ConfigureServiceLocator();

        // Log.APPLICATION_INITIALIZE("Exit", Common.LOG_CATEGORY, startTicks);
        // }

        // 07 - Configure the catalog of modules
        // Modules are loaded at Startup and must be a project reference

        protected override void ConfigureModuleCatalog(IModuleCatalog moduleCatalog)
        {
            Int64 startTicks = Log.APPLICATION_INITIALIZE("Enter", Common.LOG_CATEGORY);

            //NOTE(crhodes)
            // Order matters here.  Application depends on types in $xxxTYPExxx$
            moduleCatalog.AddModule(typeof($xxxTYPExxx$Module));
            moduleCatalog.AddModule(typeof($xxxAPPLICATIONxxx$Module));

            Log.APPLICATION_INITIALIZE("Exit", Common.LOG_CATEGORY, startTicks);
        }
コード例 #20
0
        // Step 1b - Configure the catalog of modules
        // Modules are loaded at Startup and must be a project reference

        protected override void ConfigureModuleCatalog(IModuleCatalog moduleCatalog)
        {
            Int64 startTicks = Log.APPLICATION_INITIALIZE("Enter", Common.LOG_CATEGORY);

            moduleCatalog.AddModule(typeof(ModuleAModule));

            base.ConfigureModuleCatalog(moduleCatalog);

            moduleCatalog.AddModule(typeof(SupportTools_ExcelModule));

            Log.APPLICATION_INITIALIZE("Exit", Common.LOG_CATEGORY, startTicks);
        }
コード例 #21
0
ファイル: ThisAddIn.cs プロジェクト: chrhodes/Office
        /// <summary>
        /// LoadXamlApplicationResources
        ///
        /// Creates Xaml Resources collection in System.Windows.Application
        /// for use in Hosted applications without App.Xaml
        /// </summary>

        private static void CreateXamlApplication()
        {
            Int64 startTicks = Log.APPLICATION_INITIALIZE("Enter", Common.LOG_CATEGORY);

            Common.DeveloperMode = true;
            Common.WriteToDebugWindow("CreateXamlApplication()");
            Common.DeveloperMode = false;

            try
            {
                // TODO(crhodes)

                // Can we just create a PrismApplication?
                // Create a WPF Application
                _XamlApp = new System.Windows.Application();

                //_prismApplication = new Application.PrismApp();

                var defaultThemes = Theme.Themes;
                ApplicationThemeHelper.ApplicationThemeName = "MetropolisDark";

                // Load the resources

                // This works

                //var resources = System.Windows.Application.LoadComponent(
                //    new Uri("SupportTools_Excel;component/Resources/Xaml/Brushes.xaml", UriKind.Relative)) as System.Windows.ResourceDictionary;

                // Now lets try with

                var resources = System.Windows.Application.LoadComponent(
                    new Uri("SupportTools_Visio;component/Resources/Xaml/Application.xaml", UriKind.Relative)) as System.Windows.ResourceDictionary;

                //var resources = System.Windows.Application.LoadComponent(
                //    new Uri("pack:/SupportTools_Excel;:,,/Resources/Xaml/Application.xaml")) as System.Windows.ResourceDictionary;

                // Merge it on application level

                _XamlApp.Resources.MergedDictionaries.Add(resources);

                //_prismApplication.Resources.MergedDictionaries.Add(resources);
            }
            catch (Exception ex)
            {
                Common.DeveloperMode = true;
                Common.WriteToDebugWindow(ex.ToString());
                Common.DeveloperMode = false;
            }

            Log.APPLICATION_INITIALIZE("Exit", Common.LOG_CATEGORY, startTicks);
        }
コード例 #22
0
        protected override void RegisterTypes(IContainerRegistry containerRegistry)
        {
            Int64 startTicks = Log.APPLICATION_INITIALIZE("Enter", Common.LOG_CATEGORY);

            // Used to register types with the container that will be used by your application.
            containerRegistry.Register <IMessageDialogService, MessageDialogService>();

            containerRegistry.Register <CatViewModel>();

            containerRegistry.Register <Cat>();
            containerRegistry.Register <Cat3>();

            Log.APPLICATION_INITIALIZE("Exit", Common.LOG_CATEGORY, startTicks);
        }
コード例 #23
0
ファイル: App.xaml.cs プロジェクト: chrhodes/VisualStudio
        // 11

        protected override Window CreateShell()
        {
            Int64 startTicks = Log.APPLICATION_INITIALIZE("Enter", Common.LOG_CATEGORY);

            Log.APPLICATION_INITIALIZE("Exit", Common.LOG_CATEGORY, startTicks);

            // TODO(crhodes)
            // Pick the shell to start with.
            return(Container.Resolve <Shell>());
            // return Container.Resolve<RibbonShell>();

            // NOTE(crhodes)
            // The type of view to load into the shell is handled in $xxxAPPLICATIONxxx$Module.cs
        }
コード例 #24
0
        // 06 - Removed in Prism 8.0

        //protected override void ContainerLocator()
        //{
        //    Int64 startTicks = Log.APPLICATION_INITIALIZE("Enter", Common.LOG_CATEGORY);

        //    base.ConfigureServiceLocator();

        //    Log.APPLICATION_INITIALIZE("Exit", Common.LOG_CATEGORY, startTicks);
        //}

        // 07 - Configure the catalog of modules
        // Modules are loaded at Startup and must be a project reference

        protected override void ConfigureModuleCatalog(IModuleCatalog moduleCatalog)
        {
            Int64 startTicks = Log.APPLICATION_INITIALIZE("Enter", Common.LOG_CATEGORY);

            //NOTE(crhodes)
            // Order matters here.

            moduleCatalog.AddModule(typeof(CodeChecksModule));
            moduleCatalog.AddModule(typeof(FindSyntaxModule));
            moduleCatalog.AddModule(typeof(ModifySyntaxModule));
            moduleCatalog.AddModule(typeof(VNCCodeCommandConsoleModule));

            Log.APPLICATION_INITIALIZE("Exit", Common.LOG_CATEGORY, startTicks);
        }
コード例 #25
0
ファイル: App.xaml.cs プロジェクト: chrhodes/Applications
        //NOTE(crhodes)
        // This has been removed in Prism 8.0

        // 06

        // protected override void ConfigureServiceLocator()
        // {
        // Int64 startTicks = Log.APPLICATION_INITIALIZE("Enter", Common.LOG_APPNAME);

        // base.ConfigureServiceLocator();

        // Log.APPLICATION_INITIALIZE("Exit", Common.LOG_APPNAME, startTicks);
        // }

        // 07 - Configure the catalog of modules
        // Modules are loaded at Startup and must be a project reference

        protected override void ConfigureModuleCatalog(IModuleCatalog moduleCatalog)
        {
            Int64 startTicks = Log.APPLICATION_INITIALIZE("Enter", Common.LOG_CATEGORY);

            //NOTE(crhodes)
            // Order matters here.  Application depends on types in Cat
            moduleCatalog.AddModule(typeof(CatModule));

            moduleCatalog.AddModule(typeof(Animals.DogModule));

            // TODO(crhodes)
            // Figure out if the name of the class is acceptable.  Must be unique
            // Maybe just go with AnimalsModule or consider
            moduleCatalog.AddModule(typeof(Animals.PAEF1AnimalsModule));

            moduleCatalog.AddModule(typeof(PAEF1Module));

            Log.APPLICATION_INITIALIZE("Exit", Common.LOG_CATEGORY, startTicks);
        }
コード例 #26
0
ファイル: App.xaml.cs プロジェクト: chrhodes/VisualStudio
        // 05

        protected override void RegisterTypes(IContainerRegistry containerRegistry)
        {
            Int64 startTicks = Log.APPLICATION_INITIALIZE("Enter", Common.LOG_CATEGORY);

            //containerRegistry.RegisterSingleton<ICustomerDataService, CustomerDataServiceMock>();
            //containerRegistry.RegisterSingleton<IMaterialDataService, MaterialDataServiceMock>();

            // TODO(crhodes)
            // Think this is where we switch to using the Generic Repository.
            // But how to avoid pulling knowledge of EF Context in.  Maybe Service hides details
            // of
            //containerRegistry.RegisterSingleton<IAddressDataService, AddressDataService>();
            // AddressDataService2 has a constructor that takes a CustomPoolAndSpaDbContext.

            //containerRegistry.RegisterSingleton<I$xxxTYPExxx$LookupDataService, $xxxTYPExxx$LookupDataService>();
            containerRegistry.Register <IMessageDialogService, MessageDialogService>();

            // Add the new UI elements

            Log.APPLICATION_INITIALIZE("Exit", Common.LOG_CATEGORY, startTicks);
        }
コード例 #27
0
        private void LoadControlContents()
        {
            long startTicks = Log.APPLICATION_INITIALIZE("Enter", Common.LOG_CATEGORY);

            try
            {
                ((OptionsViewModel)azdoOptions.ViewModel).Options.XMLTemplateFilePath = Common.cEXPORT_TEMPLATE_PATH;
                //AZDOOptions.teXMLTemplateFilePath.Text = Common.cEXPORT_TEMPLATE_PATH;
                //AZDOOptions.teGoBackDays.Text = Common.cGO_BACK_DAYS;

                // Set the UI to the initial state.  Xaml has everything expanded/visible

                lgMainGroup.Visibility = Visibility.Hidden;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }

            ApplicationThemeHelper.ApplicationThemeName = "MetropolisLight";

            Log.APPLICATION_INITIALIZE("Exit", Common.LOG_CATEGORY, startTicks);
        }
コード例 #28
0
ファイル: Ribbon.cs プロジェクト: chrhodes/Office
        // NOTE(crhodes)
        // This was moved out of designer so we can call bootstrapper.

        //Prism.Ioc.IContainerProvider _container;
        public Ribbon()
            : base(Globals.Factory.GetRibbonFactory())
        {
            // HACK(crhodes)
            // If don't delay a bit here, the SignalR logging infrastructure
            // does not initialize quickly enough
            // and the first few log messages are missed.
            // NB.  All are properly recored in the log file.

            Log.APPLICATION_INITIALIZE("Initialize SignalR", Common.LOG_CATEGORY);

            Thread.Sleep(250);

            InitializeComponent();

            // NOTE(crhodes)
            // Try moving Bootstrapper to Common so we can access UnityContainer
            Common.ApplicationBootstrapper = new Application.Bootstrapper();
            Common.ApplicationBootstrapper.Run();

            //var bootstrapper = new Application.Bootstrapper();
            //bootstrapper.Run();
            //_container = bootstrapper.Container;
        }
コード例 #29
0
ファイル: ThisAddIn.cs プロジェクト: chrhodes/Office
        void InitializeWPFApplication()
        {
            Int64 startTicks = Log.APPLICATION_INITIALIZE("Enter", Common.LOG_CATEGORY);

            Common.CurrentUser = new WindowsPrincipal(WindowsIdentity.GetCurrent());

            CreateXamlApplication();

            try
            {
                if (Data.Config.ADBypass)
                {
                    Common.IsAdministrator = true;
                    Common.IsBetaUser      = true;
                    Common.IsDeveloper     = true;
                }
                //else
                //{
                //    if (!Data.Config.AD_Users_AllowAll)
                //    {
                //        bool isAuthorizedUser = ADHelper.ADHelper.CheckGroupMembership(
                //            //"maward",
                //            Common.CurrentUser.Identity.Name,
                //            SQLInformation.Data.Config.ADGroup_Users,
                //            SQLInformation.Data.Config.AD_Domain);

                //        if (!isAuthorizedUser)
                //        {
                //            MessageBox.Show(string.Format("You must be a member of {0}\\{1} to run this application.",
                //                SQLInformation.Data.Config.AD_Domain, SQLInformation.Data.Config.ADGroup_Users));
                //            return;
                //        }
                //    }

                //    Common.IsAdministrator = ADHelper.ADHelper.CheckDirectGroupMembership(
                //        Common.CurrentUser.Identity.Name,
                //        SQLInformation.Data.Config.ADGroup_Administrators,
                //        SQLInformation.Data.Config.AD_Domain);


                //    Common.IsBetaUser = ADHelper.ADHelper.CheckDirectGroupMembership(
                //        Common.CurrentUser.Identity.Name,
                //        SQLInformation.Data.Config.ADGroup_BetaUsers,
                //        SQLInformation.Data.Config.AD_Domain);

                //    Common.IsDeveloper = Common.CurrentUser.Identity.Name.Contains("crhodes") ? true : false;

                //    // Next lines are for testing UI only.  Comment out for normal operation.
                //    //Common.IsAdministrator = false;
                //    //Common.IsBetaUser = false;
                //    //Common.IsDeveloper = false;
                //}

                // Cannot do here as the Common.ApplicationDataSet has not been loaded.  Need to move here or do later.
                // For now this is in DXRibbonWindowMain();

                //var eventMessage = "Started";
                //SQLInformation.Helper.IndicateApplicationUsage(LOG_APPNAME, DateTime.Now, currentUser.Identity.Name, eventMessage);

                // Launch the main window.

                // Done from Ribbon

                //User_Interface.Windows.SplashScreen _window1 = new User_Interface.Windows.SplashScreen();
                //User_Interface.Windows.DXRibbonWindowMain _window1 = new User_Interface.Windows.DXRibbonWindowMain();

                //String windowArgs = string.Empty;
                // Check for arguments; if there are some build the path to the package out of the args.
                //if (args.Args.Length > 0 && args.Args[0] != null)
                //{
                //    for (int i = 0; i < args.Args.Length; ++i)
                //    {
                //        windowArgs = args.Args[i];
                //        switch (i)
                //        {
                //            case 0: // Patient Id
                //                //patientId = windowArgs;
                //                break;
                //        }
                //    }
                //}

                //_window1.Show();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
                MessageBox.Show(ex.InnerException.ToString());
            }

            Log.APPLICATION_INITIALIZE("Exit", Common.LOG_CATEGORY, startTicks);
        }