Exemple #1
0
        /// <summary>
        /// Pushes a task to execute instantly on the given scheduler
        /// </summary>
        /// <param name="schedulerName">the scheduler on which to push the given request</param>
        /// <param name="requestId">the id of the request that needs to be executed instantly</param>
        /// <returns>a value indicating whether the request could be activated</returns>
        public bool PushRequest(string schedulerName, string requestId)
        {
            return(proxy.PushRequest(schedulerName, requestId));

            /*Future<object> retVal = client.CallRemoteMethod(managementObjectName, "PushRequest",
             *                                              new[] { schedulerName, requestId });
             * object obj = retVal.Result;
             * if (retVal.Success)
             * {
             *  return (bool)obj;
             * }
             *
             * return false;*/
        }
        /// <summary>
        /// Pushes the selected task
        /// </summary>
        /// <param name="requestId">the id of the task that must be pushed</param>
        public void Push(string requestId)
        {
            bool ok = client.PushRequest(schedulerName, requestId);

            if (ok)
            {
                MessageBox.Show("Task successfully started");
            }
            else
            {
                MessageBox.Show("Unable to push task!");
            }

            Refresh();
        }