public void runWizard()
 {
 	var o2Wizard = new O2Wizard("Enable/Disable Network Adapters", 500, 500);		
 	if (false == Netsh.isAvailable())
 		o2Wizard.Steps.add_Message("Error onEnable/Disable Network Adapters","no NetSh found on this system");
 	else
 	{        	
 		// step 1
 		var step1Message = string.Format("This wizard will allow the enable or disable the following Windows Network adapters: \r\n {0}\r\n{1}", 
 									 	Netsh.interfaces_getDetails(),
 									 	Netsh.interfaces_getIPConfig());
 		o2Wizard.Steps.add_Message("Current Network Adapter details", step1Message);        		        		
 		// step 2
 		o2Wizard.Steps.add_Action("Disabling Network Adapters", disableNetworkAdapters);
 		// step 3
 		o2Wizard.Steps.add_Action("Ping www.google.com", (step) => pingAddress(step,"www.google.com"));
 		// step 4
 		o2Wizard.Steps.add_Action("Enabling Network Adapters", enableNetworkAdapters);        		
 		// step 5
 		o2Wizard.Steps.add_Action("Ping www.google.com", (step) => pingAddress(step,"www.google.com"));
 		// step 6
 		o2Wizard.Steps.add_Action("All Done", endOfWizard);
 	}        	
 	o2Wizard.start();
 }    	    	    	    	    
 public string runWizard_BackupFolder(string startFolder, string targetFolder)
 {
     var o2Wizard = new O2Wizard("Backup folder: " + startFolder);            
     o2Wizard.Steps.add_Directory("Choose Directory To Backup", startFolder);
     o2Wizard.Steps.add_Directory("Choose Directory To Store Zip file", targetFolder);
     o2Wizard.Steps.add_Action("Confirm backup action", confirmBackupAction);
     o2Wizard.Steps.add_Action("Backing up files", executeTask);
     o2Wizard.start();            
     return "ok";
 }
		public void runWizard()
		{
	        var o2Wizard = new O2Wizard("Setup AppScan Source Edition (OunceLabs) MySql database");
	        	        
	        addStep_WelcomeMessage(o2Wizard);	        
	        addStep_EnterMySqlDetails(o2Wizard);	        
	        addStep_ShowMySqlDetails(o2Wizard);
	        addStep_TestMySqlDetails(o2Wizard);
	        
	        o2Wizard.start();		
        }
        public string runWizard(string startFolder)
        {                                     	
        	var o2Wizard = new O2Wizard("Search Engine - Use Case 1"); 

        	o2Wizard.Steps.add_Control(new FileMappings(),
        							  "Search Targets", 
        							  "Drag and Drop target folder with source files and Select files to index", step0_loadDefaultValues);        	
			o2Wizard.Steps.add_Action("Confirm files to index", confirmFilesToIndex);
        	o2Wizard.Steps.add_Control(typeof(ascx_SearchTargets),"Loading search targets", "Click next once loading is complete", step2_loadFiles);        	
        	o2Wizard.Steps.add_Control(typeof(ascx_SearchResults),"Search loaded targets", "Search Indexed files", step3_SearchResults);
        	        	         	        	         	
            o2Wizard.start();
            return "ok";
        }		
        private void add_StepExecuteScript(O2Wizard o2Wizard, Assembly assemblyToExecute)
        {
        	PublicDI.log.error("in add_StepExecuteScript: {0}", assemblyToExecute.Location);        	
        	o2Wizard.Steps.add_Control(
        		typeof(ascx_AssemblyInvoke),
        		"Execute Assembly",
                assemblyToExecute.Location,
        		step => onStepLoad(step, assemblyToExecute));
        	//var step = o2Wizard.Steps.createStepWith_TextBox("Executing Script","");
        	
        	/*var step = o2Wizard.Steps.add_Panel("Executing Script");
        	step.add_TextBox("Executing assembly:" +  assemblyToExecute.Location, 10);
        	PublicDI.log.error("done...");*/
			//step.add_ExecuteAssembly();
        }
        public Thread runWizard(string startFolder, string targetFolder)
        {
            var o2Wizard = new O2Wizard("Backup folder: " + startFolder);
            
            //var steps = new List<IStep>();
            o2Wizard.Steps.add_Directory("Choose Directory To Backup", startFolder);
            o2Wizard.Steps.add_Directory("Choose Directory To Store Zip file", targetFolder);
            o2Wizard.Steps.add_Action("Confirm backup action", confirmBackupAction);
            o2Wizard.Steps.add_Action("Backing up files", executeTask);
            //steps.add_Message("All OK", "This is a message and all is OK");
            //steps.add_Message("Problem", "Something went wrong");

            //return steps.startWizard("Backup folder: " + startFolder);            
            o2Wizard.start();
            return null;
        }
Exemplo n.º 7
0
        public Thread runWizard(string svnUrl, string targetFolder)
        {
            var o2Wizard = new O2Wizard("Sync Rules Database via SVN");
        	//var steps = new List<IStep>();
        	var message = string.Format("This workflow will Syncronize the local copy of O2's Rule Database with the lastest version at O2's SVN code repository" + 
        								"{0}{0}SVN Url = {1}" + 
        								"{0}{0}Local Folder = {2}" + 
        								"{0}{0}Note that the local O2 Rule Database will be deleted!", Environment.NewLine, svnUrl.Replace("%20"," ") , targetFolder);
            o2Wizard.Steps.add_Message("Confirm", message);
            o2Wizard.Steps.add_Action("Download Files", (step) => downloadFiles(step, svnUrl, targetFolder));
            //o2Wizard.Steps.add_Directory("Downloaded Files", targetFolder);
            return o2Wizard.start();
            //return o2Wizard.start();

        	//return steps.startWizard("Sync Rules Database via SVN");            
        }
        public void addStep_EnterMySqlDetails(O2Wizard o2Wizard)
        {        
        	// add step
			var step = o2Wizard.Steps.add_Panel("Enter MySql connection details");

			// add labels and position them 20 pixel apart
			var serverIP_Label = step.add_Label("MySql IP address:", 10);			
			var serverPort_Label = step.add_Label("MySql IP Port:",30);
			var userName_Label = step.add_Label("MySql UserName:"******"MySql Password:",70);
			
			// add the textBoxes
			serverIP_Label	.append_TextBox(OunceMySql.MySqlServerIP, 		(newValue)=> OunceMySql.MySqlServerIP = newValue);
			serverPort_Label.append_TextBox(OunceMySql.MySqlServerPort, 	(newValue)=> OunceMySql.MySqlServerPort = newValue);
			userName_Label	.append_TextBox(OunceMySql.MySqlLoginUsername, 	(newValue)=> OunceMySql.MySqlLoginUsername = newValue);
			password_Label	.append_TextBox(OunceMySql.MySqlLoginPassword, 	(newValue)=> OunceMySql.MySqlLoginPassword = newValue);						
        }
 public void startWizard()
 {			
     var o2Wizard = new O2Wizard("Execute XRule",500,400);
     scriptToExecute = getClickOnceScriptPath();
     
     //scriptToExecute = @"C:\O2\XRulesDatabase\_Rules\HelloWorld.cs.o2";
     if (File.Exists(scriptToExecute))
     {           
    		var compiledAssembly = new CompileEngine().compileSourceFile(scriptToExecute);
    		if (compiledAssembly != null)
    		{
     		add_StepExecuteScript(o2Wizard,compiledAssembly);            
     		o2Wizard.start();
     		return;
     	}
     }
     
     addStep_SelectXRuleToExecute(o2Wizard);
     addStep_CompileScript(o2Wizard);            	
     o2Wizard.start();         
 }
 public void addStep_TestMySqlDetails(O2Wizard o2Wizard)
 {
 	o2Wizard.Steps.add_Action("Testing MySql connection details", testMySqlDetails);
 }
 public void addStep_ShowMySqlDetails(O2Wizard o2Wizard)
 {        	
 	o2Wizard.Steps.add_Action("Confirm connection details", showMySqlDetails);
 }
        public void addStep_WelcomeMessage(O2Wizard o2Wizard)
        {
			o2Wizard.Steps.add_Message("Welcome to this Wizard", "The next steps will take you over the process of configuring the\r\nIBM AppScan Source Edition (ex OunceLabs)\r\nMySql Services");
        }
 public void addStep_CompileScript(O2Wizard o2Wizard)
 {			
     var panel = o2Wizard.Steps.add_Panel("Compiling and Executing script","",onCompileScript);																			
 }
        public void addStep_SelectXRuleToExecute(O2Wizard o2Wizard)
        {
            TextBox textboxWithFileName = null;
            IStep step = null;
            step = o2Wizard.Steps.add_SelectFile("Chose XRule File to Execute",scriptToExecute, 30,20,70,
                                                 (newText)=> {setScriptToExecute(step, newText);},
                                                 (textBox, Button) => textboxWithFileName = textBox );
        	 	
            step.AllowNextStrategy = () => {return false;};
        	 
            //var panel = (Panel)step.FirstControl;
            var firstLabel = step.add_Label("You can select a local XRule file to execute", 5,5);
            firstLabel.AutoSize = true;
            step.add_Label("Or you can drop a script to execute on the drop area below", 70,5).AutoSize = true;
            //var step = o2Wizard.Steps.add_Panel("Select XRule to execute");
			 			 
            step.add_DropArea(20, 90, 165,10, 
                              (fileName) => {
                                                setScriptToExecute(step, fileName);
                                                if (textboxWithFileName != null)
                                                    textboxWithFileName.set_Text(scriptToExecute);
                              });
            step.add_Link("download test file", 5, firstLabel.Width + 30, 
                          ()=> textboxWithFileName.set_Text(testFileToUse()));			 				 
			 	
            step.OnComponentAction= (_step) =>
                                        {
                                            if (File.Exists(scriptToExecute))
                                                _step.allowNext(true);		
                                        };
        }