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 override void ExecuteCommand(IList <NavigationModelNodeBase> nodes, NavigationModelNodeTask task, ICollection <string> parameters) { try { EnterpriseManagementGroup emg = ConsoleContext.GetConsoleEMG(); // (Cireson.ProjectAutomation.Library) (Microsoft.SystemCenter.Connector.ProjectServer.Settings) (5a49b80c-4c34-d189-ca94-a591580f1995) ManagementPackClass mpcSettings = emg.EntityTypes.GetClass(new Guid("5a49b80c-4c34-d189-ca94-a591580f1995")); //get the settings class. EnterpriseManagementObject emoSettings = emg.EntityObjects.GetObject <EnterpriseManagementObject>(mpcSettings.Id, ObjectQueryOptions.Default); //get the settings class instance. //somewhere here we will have a container for our class data to feed the consoleWizard obj. AdminSettingsData admData = new AdminSettingsData(emoSettings); WizardStory consoleWizard = new WizardStory(); consoleWizard.WizardData = admData; consoleWizard.AddLast(new WizardStep(ServiceManagerLocalization.GetStringFromManagementPack("strGroomingSettings"), typeof(AdminSettingsGroomingForm), admData)); consoleWizard.AddLast(new WizardStep(ServiceManagerLocalization.GetStringFromManagementPack("strStatusSettings"), typeof(AdminSettingsStatusForm), admData)); consoleWizard.AddLast(new WizardStep(ServiceManagerLocalization.GetStringFromManagementPack("strProjectTasksSettings"), typeof(AdminSettingsProjectTasksForm), admData)); consoleWizard.AddLast(new WizardStep(ServiceManagerLocalization.GetStringFromManagementPack("strProjectLicensingSettings"), typeof(AdminSettingsLicensingForm), admData)); PropertySheetDialog propertyDialog = new PropertySheetDialog(consoleWizard); propertyDialog.Width = 800; propertyDialog.Height = 700; propertyDialog.WindowStartupLocation = WindowStartupLocation.CenterOwner; propertyDialog.Title = ServiceManagerLocalization.GetStringFromManagementPack("strSettings"); propertyDialog.ShowInTaskbar = true; propertyDialog.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); propertyDialog.ShowDialog(); } catch (Exception ex) { ConsoleContextHelper.Instance.ShowErrorDialog(ex, string.Empty, ConsoleJobExceptionSeverity.Error); } }
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(); }
public AdminSettingsProjectTasksForm(WizardData _data) { InitializeComponent(); this.data = _data as AdminSettingsData; this.DataContext = this.data; //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.TaskEvalFrequencyUnit; }
private void tabProjectSite_MouseUp(object sender, MouseButtonEventArgs e) { try { wbProjectSite.Navigate(new Uri(dataInstance["ProjectWebUrl"].ToString())); } catch (UriFormatException ex) { Microsoft.EnterpriseManagement.UI.Extensions.Shared.ConsoleContextHelper.Instance.ShowErrorDialog( ex, ServiceManagerLocalization.GetStringFromManagementPack("strInvalidProjectURI"), ConsoleFramework.ConsoleJobExceptionSeverity.Warning); } }
public ResultsWizardPage(WizardData wizardData) { base.Title = ServiceManagerLocalization.GetStringFromManagementPack("strResults"); if (wizardData is ProjectConnectorData) { this.DataContext = wizardData as ProjectConnectorData; } //else if (wizardData is ProjectConfigurationWizardData) // this.DataContext = wizardData as ProjectConfigurationWizardData; this.FinishButtonText = ServiceManagerLocalization.GetStringFromManagementPack("strClose"); this.IsFinishButtonEnabled = true; InitializeComponent(); }
private void btnTestConnection_Click(object sender, RoutedEventArgs e) { try { X1 x = new X1(ConsoleContext.GetConsoleEMG(), new Guid("5a49b80c-4c34-d189-ca94-a591580f1995"), "Project Connector"); x.CheckLicense(); credsControl.SetCredentials(); Type type = Type.GetTypeFromProgID("Microsoft.EnterpriseManagement.ServiceManager.ProjectServer.Adapter.ProjectAdapter"); object inst = Activator.CreateInstance(type); IProjectAdapter projAdapter = (IProjectAdapter)inst; if (data.IsO365) { projAdapter.Connect(data.PwaUrl, credsControl.UserName, PasswordHepler.ConvertSecureStringToString(credsControl.Password)); } else { projAdapter.Connect(data.PwaUrl, credsControl.UserName, PasswordHepler.ConvertSecureStringToString(credsControl.Password), credsControl.Domain); } var success = projAdapter.IsConnected(); using (new WaitCursor()) { if (success) { MessageBox.Show(ServiceManagerLocalization.GetStringFromManagementPack("strConnectSuccess"), ServiceManagerLocalization.GetStringFromManagementPack("strConnectorTitle"), MessageBoxButton.OK, MessageBoxImage.Information); this.IsNextButtonEnabled = true; } else { MessageBox.Show(ServiceManagerLocalization.GetStringFromManagementPack("strConnectFailed"), ServiceManagerLocalization.GetStringFromManagementPack("strConnectorTitle"), MessageBoxButton.OK, MessageBoxImage.Error); } } } catch (Exception ex) { ConsoleContextHelper.Instance.ShowErrorDialog(ex, ex.Message, ConsoleFramework.ConsoleJobExceptionSeverity.Error); } }
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; }
private void licenseCheckThread_RunWorkerCompleted(object sender, System.ComponentModel.RunWorkerCompletedEventArgs e) { if (e.Error != null) { lblLicenseStatus.Visibility = System.Windows.Visibility.Visible; grid1.IsEnabled = false; Microsoft.EnterpriseManagement.UI.Extensions.Shared.ConsoleContextHelper.Instance.ShowErrorDialog(e.Error, ServiceManagerLocalization.GetStringFromManagementPack("strInvalidLicense"), ConsoleFramework.ConsoleJobExceptionSeverity.Error); } }