public void Start(ParameterDelegate method, object parameter) { SynchronizationContext context = SynchronizationContext.Current; // if there is no synchronization, don't launch a new thread if ( context != null ) { // new thread to execute the Load() method for the layer new Thread( ( object args ) => { method.DynamicInvoke( args ); //// fire the OnLoadComplete event on the original thread //context.Post( new SendOrPostCallback( ( obj ) => //{ // add callback method call here if needed in future //} ), null ); } ).Start( parameter ); } else { method.DynamicInvoke( parameter ); } }
/// <summary> /// Starts a new thread invoking the specified method with the parameter provided. /// </summary> /// <param name="method">The method to invoke.</param> /// <param name="parameter">The method parameter.</param> public void Start(ParameterDelegate method, object parameter) { SynchronizationContext context = SynchronizationContext.Current; // if there is no synchronization, don't launch a new thread if (context != null) { // new thread to execute the Load() method for the layer new Thread(() => method.DynamicInvoke(parameter)).Start(); } else { method.DynamicInvoke(parameter); } }
public void Start(ParameterDelegate method, object parameter) { SynchronizationContext context = SynchronizationContext.Current; // if there is no synchronization, don't launch a new thread if (context != null) { // new thread to execute the Load() method for the layer new Thread(( object args ) => { method.DynamicInvoke(args); //// fire the OnLoadComplete event on the original thread //context.Post( new SendOrPostCallback( ( obj ) => //{ // add callback method call here if needed in future //} ), null ); }).Start(parameter); } else { method.DynamicInvoke(parameter); } }
/// <summary> /// Queues a new worker thread invoking the specified method with the parameter provided. /// </summary> /// <param name="method">The method to invoke.</param> /// <param name="parameter">The method parameter.</param> public void QueueWorker(ParameterDelegate method, object parameter) { method.DynamicInvoke(parameter); }
/// <summary> /// Queues a new worker thread invoking the specified method. /// </summary> /// <param name="method">The method to invoke.</param> public void QueueWorker(ParameterDelegate method) { method.DynamicInvoke(); }
/// <summary> /// Starts a new thread invoking the specified method with the parameter provided. /// </summary> /// <param name="method">The method to invoke.</param> /// <param name="parameter">The method parameter.</param> public void Start(ParameterDelegate method, object parameter) { method.DynamicInvoke(parameter); }
public void QueueWorker(ParameterDelegate method, object parameter) { method.DynamicInvoke(parameter); }
public void QueueWorker(ParameterDelegate method) { method.DynamicInvoke(); }
public void Start(ParameterDelegate method, object parameter) { method.DynamicInvoke(parameter); }