/// <summary>
        /// Shows the options.
        /// </summary>
        public void ShowOptions()
        {
            TraceService.WriteLine("ApplicationController::ShowOptions");

            OptionsView view = new OptionsView();

            ResourceDictionary resourceDictionary = this.GetLanguageDictionary();

            OptionsViewModel viewModel = this.ResolverService.Resolve <OptionsViewModel>();

            viewModel.LanguageDictionary = resourceDictionary;

            view.DataContext = viewModel;

            view.ShowDialog();

            //// in case any of the setting have changed to do with logging reset them!
            TraceService.Initialize(
                this.SettingsService.LogToTrace,
                false,  //// log to console.
                this.SettingsService.LogToFile,
                this.SettingsService.ExtendedLogging,
                this.SettingsService.LogFilePath,
                this.SettingsService.DisplayErrors,
                this.SettingsService.ErrorFilePath);
        }
Esempio n. 2
0
        private void ShowOptionsViewCommand_OnExecute()
        {
            var optionsWindow = new OptionsView(this);

            optionsWindow.WindowStyle           = System.Windows.WindowStyle.ToolWindow;
            optionsWindow.WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen;
            optionsWindow.ShowDialog();
        }
        private void ShowOptions(OptionsViewModel vm)
        {
            var view = new OptionsView
            {
                DataContext = vm
            };

            view.ShowDialog();
        }
Esempio n. 4
0
        private void OptionsCommandExecuted(object obj)
        {
            OptionsViewModel model = new OptionsViewModel();
            OptionsView      view  = new OptionsView {
                DataContext = model
            };

            view.ShowDialog();
        }
Esempio n. 5
0
 private void Button_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         var optionsWindow = new OptionsView(Window.GetWindow(this));
         optionsWindow.DataContext = new OptionsViewModel();
         optionsWindow.ShowDialog();
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex);
     }
 }
Esempio n. 6
0
        private void OpenOptions()
        {
            Logger.Log.Debug("Opened");

            OptionsView optionsView = new OptionsView();

            optionsView.DataContext           = OptionsViewModel;
            optionsView.WindowStartupLocation = WindowStartupLocation.CenterOwner;
            optionsView.Owner = Application.Current.MainWindow;

            optionsView.ShowDialog();

            Logger.Log.Debug("Closed");
        }
Esempio n. 7
0
        public void Execute(object parameter)
        {
            string param = (string)parameter;

            switch (param)
            {
            case "Options":
                var view      = new OptionsView();
                var viewModel = ViewModelLocater.OptionsViewModel;
                viewModel.BackupValues();
                view.DataContext           = viewModel;
                view.WindowStartupLocation = WindowStartupLocation.CenterOwner;
                view.WindowStyle           = WindowStyle.ToolWindow;
                view.Owner = App.Current.MainWindow;
                ViewModelLocater.MainWindowViewModel.OptionsWindow = view;
                view.ShowDialog();
                break;
            }
        }
Esempio n. 8
0
        private static void Main(string[] args)
        {
            var projects = new List <Project>();

            projects.Add(CreateSolutionFolder("UnitTests",
                                              CreateProject(@"UnitTests\Company.Project.Assembly1\Company.Project.Assembly1.UnitTests.csproj"),
                                              CreateProject(@"UnitTests\Company.Project.Assembly2\Company.Project.Assembly2.UnitTests.csproj"),
                                              CreateProject(@"UnitTests\Company.Project.Assembly3\Company.Project.Assembly3.UnitTests.csproj")));

            projects.Add(CreateProject(@"Company.Project.Assembly1\Company.Project.Assembly1.csproj"));
            projects.Add(CreateProject(@"Company.Project.Assembly3\Company.Project.Assembly3.csproj"));
            projects.Add(CreateProject(@"Company.Project.Assembly2\Company.Project.Assembly2.csproj"));

            var configuration = new SolutionConfiguration();

            configuration.TargetDirectory = @"C:\Temp";
            configuration.IsEnabled       = true;
            configuration.Projects.Add(CreateProjectConfiguration(@"Company.Project.Assembly1\Company.Project.Assembly1.csproj", true, false));
            configuration.Projects.Add(CreateProjectConfiguration(@"Company.Project.Assembly3\Company.Project.Assembly3.csproj", false, true));

            var dteMock = new Mock <DTE2> {
                DefaultValue = DefaultValue.Mock
            };

            Mock.Get(dteMock.Object.Solution.Projects)
            .As <IEnumerable>()
            .Setup(p => p.GetEnumerator())
            .Returns(() => projects.GetEnumerator());

            Mock.Get(dteMock.Object.Solution.SolutionBuild)
            .Setup(p => p.StartupProjects)
            .Returns(new object[] { projects[1].UniqueName });

            var optionsViewModel = new OptionsViewModel(dteMock.Object, configuration);
            var optionsView      = new OptionsView(optionsViewModel);

            optionsView.ShowDialog();
        }
        /// <summary>
        /// Shows the options.
        /// </summary>
        public void ShowOptions()
        {
            TraceService.WriteLine("ApplicationController::ShowOptions");

            OptionsView view = new OptionsView();

            ResourceDictionary resourceDictionary = this.GetLanguageDictionary();

            OptionsViewModel viewModel = this.ResolverService.Resolve<OptionsViewModel>();
            viewModel.LanguageDictionary = resourceDictionary;

            view.DataContext = viewModel;

            view.ShowDialog();

            //// in case any of the setting have changed to do with logging reset them!
            TraceService.Initialize(
                this.SettingsService.LogToTrace,
                false,  //// log to console.
                this.SettingsService.LogToFile,
                this.SettingsService.ExtendedLogging,
                this.SettingsService.LogFilePath,
                this.SettingsService.DisplayErrors,
                this.SettingsService.ErrorFilePath);
        }
        /// <summary>
        /// Shows the options.
        /// </summary>
        public void ShowOptions()
        {
            TraceService.WriteLine("ApplicationController::ShowOptions");

            OptionsView view = new OptionsView();

            ResourceDictionary resourceDictionary = this.GetLanguageDictionary();

            view.SetLanguageDictionary(resourceDictionary);

            OptionsViewModel viewModel = this.ResolverService.Resolve<OptionsViewModel>();
            viewModel.LanguageDictionary = resourceDictionary;

            view.DataContext = viewModel;

            viewModel.VisualViewModel.Colors = translator.Translate(view.Colors);

            //// use weak references.
            WeakEventManager<VisualViewModel, ThemeChangedEventArgs>
                .AddHandler(viewModel.VisualViewModel, "ThemeChanged", view.ThemeChanged);

            //// set the theme.
            view.ChangeTheme(
                this.CurrentTheme,
                this.SettingsService.ThemeColor);

            view.ShowDialog();

            WeakEventManager<VisualViewModel, ThemeChangedEventArgs>
                    .RemoveHandler(viewModel.VisualViewModel, "ThemeChanged", view.ThemeChanged);

            //// in case any of the setting have changed to do with logging reset them!
            TraceService.Initialize(
                this.SettingsService.LogToTrace,
                false,  //// log to console.
                this.SettingsService.LogToFile,
                this.SettingsService.LogFilePath,
                this.SettingsService.DisplayErrors);
        }