private void DirtyControl_TextChanged(object sender, EventArgs e)
        {
            //' Validate controls
            ControlsValidator.ValidateAll();

            this.SetDirty(true);
        }
        public override void InitializePageControl()
        {
            base.InitializePageControl();

            browseFolderControlSource.Controls.OfType <SmsOsdTextBox>().First().Text  = registry.ReadString("DriverSourceFolder");
            browseFolderControlPackage.Controls.OfType <SmsOsdTextBox>().First().Text = registry.ReadString("DriverPackageFolder");

            //checkBoxQuickMerge.Checked = registry.ReadBool("DriverPackageQuickMerge");
            textBoxConsoleFolder.Text = registry.ReadString("DriverPackageConsoleFolder");

            checkBoxLegacyFolder.Checked = registry.ReadBool("LegacyFolderStructure");

            ControlsInspector = new ControlsInspector();
            controlsValidator = new ControlsValidator(ControlsInspector);

            browseFolderControlSource.SetErrorMessageFolderPath("Specify a valid UNC path");
            browseFolderControlSource.SetCustomValidateFilePath(new ControlDataStateEvaluator(ValidateSourceDirectory));
            browseFolderControlSource.SetValidator(controlsValidator);

            browseFolderControlPackage.SetErrorMessageFolderPath("Specify a valid UNC path");
            browseFolderControlPackage.SetCustomValidateFilePath(new ControlDataStateEvaluator(ValidatePackageDirectory));
            browseFolderControlPackage.SetValidator(controlsValidator);

            ControlsInspector.InspectAll();

            Dirty = false;

            Initialized = true;
        }
Exemplo n.º 3
0
        public void CheckStarHandler()
        {
            var str          = "[1][15][6][4]";
            var result       = ControlsValidator.StarHandler(str);
            var assertString = "[1][15][6]";

            Assert.AreEqual(assertString, result);
        }
Exemplo n.º 4
0
        public void CheckDash()
        {
            var str          = "1-6,45,2";
            var result       = ControlsValidator.Dash(str);
            var assertString = "1,2,3,4,5,6,45,2";

            Assert.AreEqual(assertString, result);
        }
Exemplo n.º 5
0
        public void CheckStarHandlerWithStar()
        {
            SectionsList = StructureSections;
            var str          = "[1][*][3][4]";
            var result       = ControlsValidator.StarHandler(str);
            var assertString = "[1][1,2,3][3]";

            Assert.AreEqual(assertString, result);
        }
Exemplo n.º 6
0
        public override void InitializePageControl()
        {
            base.InitializePageControl();

            if (string.IsNullOrEmpty(registry.ReadString("DellCatalogURI")))
            {
                registry.Write("DellCatalogURI", "http://downloads.dell.com/catalog/DriverPackCatalog.cab");
            }

            if (string.IsNullOrEmpty(registry.ReadString("HPCatalogURI")))
            {
                registry.Write("HPCatalogURI", "https://ftp.hp.com/pub/caps-softpaq/cmit/HPClientDriverPackCatalog.cab");
            }

            if (string.IsNullOrEmpty(registry.ReadString("TempDownloadPath")))
            {
                registry.Write("TempDownloadPath", Path.GetTempPath());
            }

            if (string.IsNullOrEmpty(registry.ReadString("DellFolderPrefix")))
            {
                registry.Write("DellFolderPrefix", "Dell");
            }

            if (string.IsNullOrEmpty(registry.ReadString("HPFolderPrefix")))
            {
                registry.Write("HPFolderPrefix", "HP");
            }

            checkBoxWipeSource.Checked = registry.ReadString("WipeSource") == "" ? true : registry.ReadBool("WipeSource");

            textBoxDellCatalogUri.Text = registry.ReadString("DellCatalogURI");
            textBoxDellPrefix.Text     = registry.ReadString("DellFolderPrefix");

            textBoxHPCatalogUri.Text = registry.ReadString("HPCatalogURI");
            textBoxHPPrefix.Text     = registry.ReadString("HPFolderPrefix");

            browseFolderControlDownload.Controls.OfType <SmsOsdTextBox>().First().Text = registry.ReadString("TempDownloadPath");

            ControlsInspector = new ControlsInspector();
            controlsValidator = new ControlsValidator(ControlsInspector);

            browseFolderControlDownload.SetErrorMessageFolderPath("Specify a valid path");
            browseFolderControlDownload.SetCustomValidateFilePath(new ControlDataStateEvaluator(ValidateDownloadDirectory));
            browseFolderControlDownload.SetValidator(controlsValidator);

            ControlsInspector.InspectAll();

            Dirty = false;

            Initialized = true;
        }
        /// <summary>
        /// Custom action constructor
        /// </summary>
        public WebServiceControl(SmsPageData data) : base(data)
        {
            this.Initialized = false;
            InitializeComponent();

            //' Set action name
            PropertyManager["Name"].StringValue = "Invoke Web Service Method";

            //' Initialize default values for controls in the property manager
            LoadDefaultPropertyValues();

            //' Load existing values from property manager
            LoadControlsFromProperty();

            ControlsValidator.AddControl((Control)textBoxURL, new ControlDataStateEvaluator(ValidateURL), "Enter a valid URL for the web service. Should start with 'http://' or 'https://' and end with '.asmx'");
            ControlsValidator.AddControl((Control)textBoxMethod, new ControlDataStateEvaluator(ValidateMethod), "Empty method selection, validate the URL, load methods from web service and make a selection");
            ControlsValidator.AddControl((Control)textBoxParam, new ControlDataStateEvaluator(ValidateParams), "Invalid format input detected, supported input could be e.g. 'param1','param2' with the following special characters '_-.' allowed");
            ControlsValidator.ValidateAll();

            this.Initialized = true;
        }