コード例 #1
0
        //This event handler function stops a task by passing the schema name and task name to the EAWS Service
        //and calling RequestStopTask()
        private void IDC_STOP_TASK_BUT_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                if (IDC_SCHEMA_COMBO.SelectedItem != null && IDC_TASK_COMBO.SelectedItem != null &&
                    IDC_SCHEMA_COMBO.SelectedItem.ToString() != "" && IDC_TASK_COMBO.SelectedItem.ToString() != "")
                {
                    //Create a new TaskRequest Object and create a new message GUID
                    EAWSService.StopTaskRequest rStopTaskRequest = new StopTaskRequest();
                    rStopTaskRequest.itemID = Guid.NewGuid();

                    //Set schma name and task name
                    rStopTaskRequest.SchemaName = IDC_SCHEMA_COMBO.SelectedItem.ToString();
                    rStopTaskRequest.TaskName   = IDC_TASK_COMBO.SelectedItem.ToString();

                    //Store Job GUID for Callback
                    m_JobsRunning[rStopTaskRequest.itemID] = rStopTaskRequest;

                    //  Call RequestStopTask passing rStopTaskRequest as a parameter
                    m_EAWSClient.ControlRequest(rStopTaskRequest);
                }
            }
            catch (Exception eException)
            {
                MessageBox.Show(eException.Message);
            }
        }
コード例 #2
0
        internal StopTaskResponse StopTask(StopTaskRequest request)
        {
            var marshaller   = new StopTaskRequestMarshaller();
            var unmarshaller = StopTaskResponseUnmarshaller.Instance;

            return(Invoke <StopTaskRequest, StopTaskResponse>(request, marshaller, unmarshaller));
        }
コード例 #3
0
        /// <summary>
        /// Initiates the asynchronous execution of the StopTask operation.
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the StopTask operation.</param>
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
        /// <returns>The task object representing the asynchronous operation.</returns>
        public Task <StopTaskResponse> StopTaskAsync(StopTaskRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller   = new StopTaskRequestMarshaller();
            var unmarshaller = StopTaskResponseUnmarshaller.Instance;

            return(InvokeAsync <StopTaskRequest, StopTaskResponse>(request, marshaller,
                                                                   unmarshaller, cancellationToken));
        }