예제 #1
0
        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 );
            }
        }
예제 #2
0
        /// <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);
            }
        }
예제 #3
0
        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);
            }
        }
예제 #4
0
 /// <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);
 }
예제 #5
0
 /// <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();
 }
예제 #6
0
 /// <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);
 }
예제 #7
0
 public void QueueWorker(ParameterDelegate method, object parameter) { method.DynamicInvoke(parameter); }
예제 #8
0
 public void QueueWorker(ParameterDelegate method) { method.DynamicInvoke(); }
예제 #9
0
 public void Start(ParameterDelegate method, object parameter) { method.DynamicInvoke(parameter); }