Ejemplo n.º 1
0
        public WizardResult EditProjectConnector(IDataItem item)
        {
            try
            {
                WizardStory wizard = new WizardStory();
                wizard.WizardWindowTitle = ServiceManagerLocalization.GetStringFromManagementPack("strEditConnector");
                ProjectConnectorData data = new ProjectConnectorData(item);

                //setup wizard
                data.WizardMode   = WizardMode.Wizard;
                wizard.WizardData = data;

                //add the wizard pages here...
                wizard.AddLast(new WizardStep(ServiceManagerLocalization.GetStringFromManagementPack("strGeneral"), typeof(GeneralWizardPage), wizard.WizardData));
                wizard.AddLast(new WizardStep(ServiceManagerLocalization.GetStringFromManagementPack("strPWAConnectionPage"), typeof(PWAWizardPage), wizard.WizardData));
                wizard.AddLast(new WizardStep(ServiceManagerLocalization.GetStringFromManagementPack("strSchedulePage"), typeof(ScheduleWizardPage), wizard.WizardData));

                PropertySheetDialog psd = new PropertySheetDialog(wizard);

                //window properties
                psd.ShowInTaskbar         = true;
                psd.WindowStartupLocation = System.Windows.WindowStartupLocation.CenterOwner;
                psd.Icon = BitmapFrame.Create(System.Windows.Application.GetResourceStream(new Uri("pack://application:,,,/Microsoft.EnterpriseManagement.ServiceManager.ProjectServer.ConsoleTasks;component/Icons/Image.Cireson.16x16.ico", UriKind.RelativeOrAbsolute)).Stream);
                psd.ShowDialog();
                return(data.WizardResult);
            }
            catch (Exception ex)
            {
                ConsoleContextHelper.Instance.ShowErrorDialog(ex, string.Empty, ConsoleJobExceptionSeverity.Error);
                return(WizardResult.Failed);
            }
        }
Ejemplo n.º 2
0
        public PWAWizardPage(WizardData wizdata)
        {
            base.Title       = ServiceManagerLocalization.GetStringFromManagementPack("strPWAConnectionPage");
            this.data        = wizdata as ProjectConnectorData;
            this.DataContext = data;

            if (credsControl == null)
            {
                credsControl = new CredentialsControl(data.RunAsAccount, data.Id.ToString(), ConsoleContext.GetConsoleEMG().Name);
            }

            if (!data.IsEditMode)
            {
                if (data.PwaUrl == null)
                {
                    data.PwaUrl = "http://yourprojectserver/pwa";
                }
                this.FinishButtonText = ServiceManagerLocalization.GetStringFromManagementPack("strCreateBtn");
            }


            InitializeComponent();

            credentialsPanel.Children.Add(credsControl);
            credsControl.CredentialsChanged += credsControl_CredentailsChanged;

            this.IsFinishButtonEnabled       = false;
            this.IsNextButtonEnabled         = false;
            this.btnTestConnection.IsEnabled = false;
        }
 public GeneralWizardPage(WizardData wizardData)
 {
     base.Title       = ServiceManagerLocalization.GetStringFromManagementPack("strGeneral");
     this.data        = wizardData as ProjectConnectorData;
     this.DataContext = data;
     if (!data.IsEditMode)
     {
         this.FinishButtonText = ServiceManagerLocalization.GetStringFromManagementPack("strCreateBtn");
     }
     this.IsNextButtonEnabled = false;
     InitializeComponent();
 }
Ejemplo n.º 4
0
        public override void ExecuteCommand(IList <NavigationModelNodeBase> nodes, NavigationModelNodeTask task, ICollection <string> parameters)
        {
            try
            {
                EnterpriseManagementGroup emg = ConsoleContext.GetConsoleEMG();

                if (parameters.Contains("Create"))
                {
                    //do stuff
                    ProjectConnectorHelpers helper = new ProjectConnectorHelpers();
                    ProjectConnectorData    data   = helper.CreateProjectConnector();
                    if (data.WizardResult == WizardResult.Success)
                    {
                        this.RequestViewRefresh();
                    }
                }
                else if (parameters.Contains("Edit"))
                {
                    //do other stuff
                    ProjectConnectorHelpers helper = new ProjectConnectorHelpers();
                    WizardResult            result = helper.EditProjectConnector(nodes[0]);
                    if (result == WizardResult.Success)
                    {
                        this.RequestViewRefresh();
                    }
                }
                else if (parameters.Contains("Delete"))
                {
                    //delete stuff
                    ProjectConnectorHelpers helper = new ProjectConnectorHelpers();
                    if (helper.DeleteProjectConnector(nodes[0]))
                    {
                        this.RequestViewRefresh();
                    }
                }
            }
            catch (Exception ex)
            {
                ConsoleContextHelper.Instance.ShowErrorDialog(ex, string.Empty, ConsoleJobExceptionSeverity.Error);
            }
        }
Ejemplo n.º 5
0
        public ScheduleWizardPage(WizardData wizardData)
        {
            this.Title       = ServiceManagerLocalization.GetStringFromManagementPack("strSchedulePage");
            this.data        = wizardData as ProjectConnectorData;
            this.DataContext = this.data;

            if (!data.IsEditMode)
            {
                this.FinishButtonText = ServiceManagerLocalization.GetStringFromManagementPack("strCreateBtn");
            }

            this.IsNextButtonEnabled   = false;
            this.IsFinishButtonEnabled = false;
            InitializeComponent();

            //add interval units
            cbFrequencyUnit.Items.Add(ServiceManagerLocalization.GetStringFromManagementPack("strHours"));
            cbFrequencyUnit.Items.Add(ServiceManagerLocalization.GetStringFromManagementPack("strMinutes"));
            //set interval unit if the data has it.
            cbFrequencyUnit.Text = data.FrequencyUnit;
        }
Ejemplo n.º 6
0
        public ProjectConnectorData CreateProjectConnector()
        {
            try
            {
                WizardStory wizard = new WizardStory();
                //set the SCSM default connector icon here...
                wizard.WizardWindowTitle = ServiceManagerLocalization.GetStringFromManagementPack("strCreateConnector");
                ProjectConnectorData data = new ProjectConnectorData();

                //set the data.
                data.WizardMode   = WizardMode.Wizard;
                wizard.WizardData = data;

                //pages
                //add the connector setup pages here.
                wizard.AddLast(new WizardStep(ServiceManagerLocalization.GetStringFromManagementPack("strGeneral"), typeof(GeneralWizardPage), wizard.WizardData));
                wizard.AddLast(new WizardStep(ServiceManagerLocalization.GetStringFromManagementPack("strPWAConnectionPage"), typeof(PWAWizardPage), wizard.WizardData));
                wizard.AddLast(new WizardStep(ServiceManagerLocalization.GetStringFromManagementPack("strSchedulePage"), typeof(ScheduleWizardPage), wizard.WizardData));
                wizard.AddLast(new WizardStep(ServiceManagerLocalization.GetStringFromManagementPack("strResults"), typeof(ResultsWizardPage), wizard.WizardData));

                WizardWindow wizardWindow = new WizardWindow(wizard);
                ElementHost.EnableModelessKeyboardInterop(wizardWindow);

                //window properties
                wizardWindow.ShowInTaskbar         = true;
                wizardWindow.WindowStartupLocation = System.Windows.WindowStartupLocation.CenterOwner;
                wizardWindow.Icon = BitmapFrame.Create(System.Windows.Application.GetResourceStream(new Uri("pack://application:,,,/Microsoft.EnterpriseManagement.ServiceManager.ProjectServer.ConsoleTasks;component/Icons/Image.Cireson.16x16.ico", UriKind.RelativeOrAbsolute)).Stream);
                wizardWindow.ShowDialog();
                return(data);
            }
            catch (Exception ex)
            {
                ConsoleContextHelper.Instance.ShowErrorDialog(ex, string.Empty, ConsoleJobExceptionSeverity.Error);
                return(null);
            }
        }