Пример #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); }