Esempio n. 1
0
        public ClientWizard(string clientKind, EnvDTE.Project project, IVsUIShell uiShell, IVsPackageInstaller packageInstaller, IVsPackageInstallerServices packageInstallerServices)
        {
            InitializeComponent();

            _clientKind               = clientKind;
            _dte                      = project.DTE;
            _project                  = project;
            _uiShell                  = uiShell;
            _packageInstaller         = packageInstaller;
            _packageInstallerServices = packageInstallerServices;

            var edmxs = _dte.GetSolutionEdmx(_project).ToList();

            edmx.ItemsSource  = edmxs;
            edmx.SelectedItem = edmxs.FirstOrDefault();

            var services = _dte.GetSolutionSvc(_project).ToList();

            service.ItemsSource  = services;
            service.SelectedItem = services.FirstOrDefault();

            generationOptions.ItemsSource   = new[] { GenerationOptions.GetViewModel(GenerationOptions.Kind.All), GenerationOptions.GetViewModel(GenerationOptions.Kind.WithoutGlobalWithoutFramework), GenerationOptions.GetViewModel(GenerationOptions.Kind.FrameworkOnly), GenerationOptions.GetViewModel(GenerationOptions.Kind.GlobalOnly) };
            generationOptions.SelectedIndex = edmxs.Count == 0 || services.Count == 0 ? 2 : 0;

            if (!GenerationOptions.CanBeRunnedWithNoCopy(_dte))
            {
                copyTemplates.IsChecked = true;
                copyTemplates.IsEnabled = false;
            }
        }
Esempio n. 2
0
        public ViewModelWizard(EnvDTE.DTE dte, EnvDTE.ProjectItem viewModel, IVsPackageInstallerServices packageInstallerServices)
        {
            InitializeComponent();

            _dte = dte;
            _viewModel = viewModel;
            _packageInstallerServices = packageInstallerServices;

            var edmxs = _dte.GetSolutionEdmx(_viewModel.ContainingProject, skipWaqsAlreadyUsed: false).ToList();
            edmx.ItemsSource = edmxs;
            edmx.SelectedItem = edmxs.FirstOrDefault();

            var views = _dte.GetSolutionXaml(_viewModel.ContainingProject).ToList();
            views.Insert(0, new DTEExtensions.FilePathes { DisplayPath = "", FullPath = null });
            view.ItemsSource = views;
            view.SelectedItem = views.FirstOrDefault();
        }
Esempio n. 3
0
        public ViewModelWizard(EnvDTE.DTE dte, EnvDTE.ProjectItem viewModel, IVsPackageInstallerServices packageInstallerServices)
        {
            InitializeComponent();

            _dte       = dte;
            _viewModel = viewModel;
            _packageInstallerServices = packageInstallerServices;

            var edmxs = _dte.GetSolutionEdmx(_viewModel.ContainingProject, skipWaqsAlreadyUsed: false).ToList();

            edmx.ItemsSource  = edmxs;
            edmx.SelectedItem = edmxs.FirstOrDefault();

            var views = _dte.GetSolutionXaml(_viewModel.ContainingProject).ToList();

            views.Insert(0, new DTEExtensions.FilePathes {
                DisplayPath = "", FullPath = null
            });
            view.ItemsSource  = views;
            view.SelectedItem = views.FirstOrDefault();
        }
Esempio n. 4
0
        public ServerWizard(EnvDTE.Project project, IVsUIShell uiShell, IVsPackageInstaller packageInstaller, IVsPackageInstallerServices packageInstallerServices)
        {
            InitializeComponent();

            _dte = project.DTE;
            _project = project;
            _uiShell = uiShell;
            _packageInstaller = packageInstaller;
            _packageInstallerServices = packageInstallerServices;

            var edmxs = _dte.GetSolutionEdmx(_project).ToList();
            edmx.ItemsSource = edmxs;
            edmx.SelectedItem = edmxs.FirstOrDefault();

            generationOptions.ItemsSource = new[] { GenerationOptions.GetViewModel(GenerationOptions.Kind.All), GenerationOptions.GetViewModel(GenerationOptions.Kind.WithoutGlobalWithoutFramework), GenerationOptions.GetViewModel(GenerationOptions.Kind.FrameworkOnly), GenerationOptions.GetViewModel(GenerationOptions.Kind.GlobalOnly) };
            generationOptions.SelectedIndex = edmxs.Count == 0 ? 2 : 0;

            if (! GenerationOptions.CanBeRunnedWithNoCopy(_dte))
            {
                copyTemplates.IsChecked = true;
                copyTemplates.IsEnabled = false;
            }
        }