예제 #1
0
        private void WAQSInitVMCallback(object sender, EventArgs e)
        {
            var dte       = GetService(typeof(DTE)) as DTE;
            var viewModel = dte.SelectedItems.Item(1).ProjectItem;

            if (!viewModel.Name.EndsWith(".cs"))
            {
                MessageBox.Show(Application.Current.MainWindow, "The view model must be a C# file", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
                return;
            }
            var componentModel    = (IComponentModel)GetService(typeof(SComponentModel));
            var installerServices = componentModel.GetService <IVsPackageInstallerServices>();
            var wizard            = new ViewModelWizard(dte, viewModel, installerServices);

            wizard.Owner = Application.Current.MainWindow;
            wizard.WindowStartupLocation = WindowStartupLocation.CenterOwner;
            wizard.ShowModal();
        }
예제 #2
0
 private void WAQSInitVMCallback(object sender, EventArgs e)
 {
     var dte = GetService(typeof(DTE)) as DTE;
     var viewModel = dte.SelectedItems.Item(1).ProjectItem;
     if (! viewModel.Name.EndsWith(".cs"))
     {
         MessageBox.Show(Application.Current.MainWindow, "The view model must be a C# file", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
         return;
     }
     var componentModel = (IComponentModel)GetService(typeof(SComponentModel));
     var installerServices = componentModel.GetService<IVsPackageInstallerServices>();
     var wizard = new ViewModelWizard(dte, viewModel, installerServices);
     wizard.Owner = Application.Current.MainWindow;
     wizard.WindowStartupLocation = WindowStartupLocation.CenterOwner;
     wizard.ShowModal();
 }