Esempio n. 1
0
 /// <summary>
 /// Creates a task with delegate to perform the work for this task.
 /// </summary>
 /// <param name="actionSequence">The sequence that the task belongs to. Can be null if it does not belong to a sequence.</param>
 /// <param name="workerMethod">The task delegate that will perform the steps.</param>
 /// <param name="state">The state to be passed to the method. The method should take the parameter.</param>
 public AsyncTask(AsyncTaskMethod workerMethod, object state)
 {
     m_workerMethod = workerMethod;
     m_state        = state;
 }
Esempio n. 2
0
        private string m_name;                    // A friendly name for the task. If not set, it is inferred from the delegate.

        /// <summary>
        /// Creates a task with delegate to perform the work for this task.
        /// </summary>
        /// <param name="actionSequence">The sequence that the task belongs to. Can be null if it does not belong to a sequence.</param>
        /// <param name="workerMethod">The task delegate that will perform the steps.</param>
        /// <remarks>The state passed to the method would be null.</remarks>
        public AsyncTask(AsyncTaskMethod workerMethod) : this(workerMethod, null)
        {
        }