Exemple #1
0
        /// <summary>
        /// Request tasks xml from server
        /// </summary>
        /// <returns>
        /// The <see cref="string"/>.
        /// </returns>
        public string RequestTasks()
        {
            // it is for test
            // var taskxml = XDocument.Load(@"F:\DFLinkReload\TaskXML.xml");
            // var taskxml = AgentTask.GetStartedInstance().GetTask();
            var taskxml = WebAPIClientFactory.InstanceGetTask().GetTask();

            return(taskxml);
        }
Exemple #2
0
        /// <summary>
        /// The handle.
        /// </summary>
        /// <param name="operation">
        /// The operation information.
        /// </param>
        public void Handle(FileOperation operation)
        {
            // if there is no exception for StreamReader,
            // so it can post file to server
            using (var sr = new StreamReader(operation.FileFullName))
            {
                WebAPIClientFactory.InstanceUploadFile()
                .UploadFile(operation.Task.Id, operation.FileFullName);
            }

            // The operation result
            operation.Result = operation.FileFullName + " uploaded.";
        }