TSVCEO.CloudPrint.Proxy.CloudPrintProxy.UpdatePrintJob C# (CSharp) Method

UpdatePrintJob() public method

public UpdatePrintJob ( CloudPrintJob job ) : void
job CloudPrintJob
return void
        public void UpdatePrintJob(CloudPrintJob job)
        {
            Logger.Log(LogLevel.Debug, "Updated job {0} with status {1}", job.JobID, job.Status.ToString());

            var reqdata = new
            {
                jobid = job.JobID,
                status = job.Status.ToString(),
                code = job.ErrorCode,
                message = job.ErrorMessage
            };

            HTTPHelper.PostCloudPrintUrlEncodedRequest(OAuthTicket, "control", reqdata);

            if (job.Status == CloudPrintJobStatus.DONE)
            {
                CloudPrintJob _job;
                _PrintJobs.TryRemove(job.JobID, out _job);
            }
        }

Usage Example

Example #1
0
        public override void SetStatus(CloudPrintJobStatus status)
        {
            this.Status       = status;
            this.ErrorCode    = null;
            this.ErrorMessage = null;
            _Proxy.UpdatePrintJob(this);
            WriteJobJson();
            WriteJobXml();

            if (status == CloudPrintJobStatus.DONE)
            {
                if (!Config.KeepPrintFile)
                {
                    File.Delete(_PrintDataFileName);
                }
            }
        }