示例#1
0
        internal static void SetIntervalSchedule(ref ManagementPackDataSourceModule module, string unit, int interval)
        {
            try
            {
                if (unit == ServiceManagerLocalization.GetStringFromManagementPack("strHours"))
                {
                    unit = "Hours";
                }
                else
                {
                    unit = "Minutes";
                }

                string sScheduleXML = String.Format(@"
                              <Scheduler>
                                 <SimpleReccuringSchedule>
                                     <Interval Unit=""{0}"">{1}</Interval>
                                 </SimpleReccuringSchedule>
                                <ExcludeDates />
                            </Scheduler>", unit, interval);
                module.Configuration = sScheduleXML;
            }
            catch { }
        }
示例#2
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);
            }
        }