/// <summary> /// Start the thread with a standard parameters object which help passing your params. /// </summary> /// <param name="sparam">Standard sparam</param> public void Run(StandardParameters sparam) { if (this.Process != null) { if (sparam.CancelSignal != null) { this.CancelSignal = sparam.CancelSignal; } threadProcess.Start(sparam); threadMonitor.Start(); this.State = ThreadHelperState.Processing; } }
/// <summary> /// Is standard parameters contains current parameters. /// </summary> /// <param name="isRequiredParameters">Is command required parameters.</param> protected bool IsCorrectParameters(bool isRequiredParameters = false) { if (Parameters.Length > 0) { for (int i = 0; i < Parameters.Length; i++) { Type parameterType = Parameters[i].GetType(); if (!typeof(IAttrib).IsAssignableFrom(parameterType))//define: is parameter constant attribute or attribute. { if (StandardParameters == null && !StandardParameters.Select(sp => sp.GetType()).Contains(parameterType)) { return(false); } } } return(true); } if (isRequiredParameters) { SetParametersAbsenceError(); return(false); } return(true); }
/// <summary> /// Start the thread. /// </summary> public void Run() { StandardParameters sParams = new StandardParameters(); this.Run(sParams); }
/// <summary> /// Start the thread with a standard parameters object which help passing your params. /// </summary> /// <param name="sparam">Standard sparam</param> public void Run(StandardParameters sparam) { if (this.Process != null) { if (sparam.CancelSignal != null) this.CancelSignal=sparam.CancelSignal; threadProcess.Start(sparam); threadMonitor.Start(); this.State = ThreadHelperState.Processing; } }