private TabPageInterface tabInt; //Reference to project's tab page #endregion Fields #region Constructors /// /// <summary> /// Constructor. /// </summary> /// <param name="ps">Project settings to be uploaded</param> /// <param name="tabInt">Reference to project's tab page</param> public UploadSession(ProjectSettings ps, TabPageInterface tabInt) { this.pSettings = ps; this.killAll = false; this.tabInt = tabInt; this.dicActiveUploads = new Dictionary<string, TargetUpload>(); this.lstCompleted = new List<string>(); this.lstThreads = new List<Thread>(); this.lstStopped = new List<string>(); }
private string _strOldName; //This is used so an edited project can keep it's oringinal name, and not think that it is already in use #endregion Fields #region Constructors /// /// <summary> /// Used for creating a new project. /// Sets project values to default. /// </summary> /// <param name="lstProNames">Project names already in use</param> public frmProjectSettings(List<string> lstProNames) { this.Text = "New Project"; _lstProNames = lstProNames; InitializeComponent(); _proSettings = new ProjectSettings(); _proSettings.InstallUpdate = false; _proSettings.AdvancedEnabled = false; _proSettings.Interrupt = true; //True - Continue upload from previous _proSettings.CommandLine = ""; }
/// /// <summary> /// Constructor. /// </summary> /// <param name="proSettings">Project's settings</param> /// <param name="ts">Target's settings</param> /// <param name="tabInt">Reference to TabPage Interface</param> public TargetUpload(ProjectSettings proSettings, TargetSettings ts, TabPageInterface tabInt) { _proSettings = proSettings; _strProName = proSettings.ProjectName; _tSettings = ts; DirectoryInfo d = new DirectoryInfo(proSettings.SourcePath); _numDirectorySize = this.dirSize(d); //Finds size of the directory WputOutput += new WputOutputHandler(tabInt.OnUpdateProgress); ProcessStop += new ProcessStoppedHandler(tabInt.OnProcessStopEvent); ProcessError += new ProcessErrorHandler(tabInt.OnProcessErrorEvent); _strTargetServer = _tSettings.TargetServer; }
/// /// <summary> /// Used for editing an existing project. /// Sets project values to the current settings /// </summary> /// <param name="lstProNames">Project names already in use</param> /// <param name="_proSettings">Projects old/current settigns</param> public frmProjectSettings(List<string> lstProNames, ProjectSettings proSettings) { _proSettings = new ProjectSettings(); _lstProNames = lstProNames; InitializeComponent(); _strOldName = proSettings.ProjectName; //Add text to component's fields Text = proSettings.ProjectName; txtProjectName.Text = proSettings.ProjectName; txtProjectName.Text = proSettings.ProjectName; txtAddFile.Text = proSettings.SourcePath; ckbInstall.Checked = proSettings.InstallUpdate; ckbAdvancedOptions.Checked = proSettings.AdvancedEnabled; txtProxyUser.Text = proSettings.ProxyName; txtProxyPass.Text = proSettings.ProxyPass; ckbInterrupt.Checked = proSettings.Interrupt; txtCommandLine.Text = proSettings.CommandLine; }
/// /// <summary> /// Constructor. /// Used for loading settings from file. /// Get the values from 'info' and assign them to the appropriate properties. /// Called automatically when used with BinaryFormatter.Serialize(). /// </summary> /// <param name="info"></param> /// <param name="ctxt"></param> public Project(SerializationInfo info, StreamingContext ctxt) { this._proSettings = (ProjectSettings)info.GetValue("pSettings", typeof(ProjectSettings)); this._lstTargets = (List<TargetSettings>)info.GetValue("_lstTargets", typeof(List<TargetSettings>)); }
private UploadSession _uploadSession; //Holds the upload session for the project #endregion Fields #region Constructors /// /// <summary> /// Constructor. /// Used for creating a new project. /// </summary> /// <param name="_proSettings"> The settings to be used by the project </param> public Project(ProjectSettings proSettings, TabPageInterface tabInt) { _proSettings = proSettings; _lstTargets = new List<TargetSettings>(); _uploadSession = new UploadSession(proSettings, tabInt); }
/// /// <summary> /// Constructor. /// Used for loading settings from file. /// Get the values from 'info' and assign them to the appropriate properties. /// Called automatically when used with BinaryFormatter.Serialize(). /// </summary> /// <param name="info"></param> /// <param name="ctxt"></param> public Project(SerializationInfo info, StreamingContext ctxt) { this._proSettings = (ProjectSettings)info.GetValue("pSettings", typeof(ProjectSettings)); this._lstTargets = (List <TargetSettings>)info.GetValue("_lstTargets", typeof(List <TargetSettings>)); }
private List <TargetSettings> _lstTargets; //List of all target IPs /// /// <summary> /// Constructor. /// Used for creating a new project. /// </summary> /// <param name="_proSettings"> The settings to be used by the project </param> public Project(ProjectSettings proSettings, TabPageInterface tabInt) { _proSettings = proSettings; _lstTargets = new List <TargetSettings>(); _uploadSession = new UploadSession(proSettings, tabInt); }
/// /// <summary> /// Removes old project and creates a new one with updated project settings. /// </summary> /// <param name="strOldName">Project's old name</param> /// <param name="ps">New project settings</param> public void editProject(string strOldName, ProjectSettings ps) { List<TargetSettings> lstTargets = _dicProjectList[strOldName].getTargets(); removeProject(strOldName); newPoject(ps); foreach(TargetSettings ts in lstTargets) { addTarget(ps.ProjectName, ts); } }
/// /// <summary> /// Creates a new project and adds it to the project list. /// </summary> /// <param name="pSettings"> Project Settings to be used </param> public void newPoject(ProjectSettings proSettings) { string strProName = proSettings.ProjectName; if(_dicProjectList.ContainsKey(strProName) == false) { _dicProjectList.Add(strProName, new Project(proSettings, _tabInterface)); //Adds the project name and object to list _tabInterface.addTab(proSettings); } else { //Project already exists throw new Exception(); } }
/** * Adds the project details to the ListView */ public void updateSettings(ProjectSettings proSettings) { }
/// /// <summary> /// Assigns values to components that display the project's settings. /// If advanced settings have been selected, they will be displayed. /// Else, advanced settings are hidden. /// </summary> /// <param name="pSettings">The project's settings</param> public void updateSettings(ProjectSettings pSettings) { this.splitContainer1.SplitterDistance = 65; //Hides the advanced settings this.Text = pSettings.ProjectName; this.Name = pSettings.ProjectName; this.txtProName.Text = pSettings.ProjectName; this.txtSource.Text = pSettings.SourcePath; if(pSettings.InstallUpdate == true) { this.txtInstall.Text = "Yes"; } else { this.txtInstall.Text = "No"; } if(pSettings.AdvancedEnabled == true) { this.splitContainer1.SplitterDistance = 120; //Creates space for advanced components this.txtProxyName.Visible = true; this.lblProxyName.Visible = true; //Sets the components to visible this.txtInterrupt.Visible = true; this.lblInterrupt.Visible = true; this.txtArgument.Visible = true; this.lblArgument.Visible = true; this.txtProxyName.Text = pSettings.ProxyName; if(pSettings.Interrupt == true) { this.txtInterrupt.Text = "Yes"; } else { this.txtInterrupt.Text = "No"; } this.txtArgument.Text = pSettings.CommandLine; } }