private void UpdateJobEvents_JobTransferred(object sender, UpdateJobEventArgs e) { if (job.State == UpdateJobState.Transferred) { job.Complete(); UpdateClient.IsIdle = true; DownloadItem(); } }
public void updateJob(NbtAuth auth, string jobKey, bool success, string errorMsg) { NbtPublicClient NbtClient = _getClient(auth); UpdateJobEventArgs e = new UpdateJobEventArgs(); CswNbtLabelJobUpdateRequest Request = new CswNbtLabelJobUpdateRequest(); Request.JobKey = jobKey; Request.Succeeded = success; Request.ErrorMessage = errorMsg; CswNbtLabelJobUpdateResponse Ret; using (OperationContextScope Scope = new OperationContextScope(NbtClient.InnerChannel)) { WebOperationContext.Current.OutgoingRequest.Headers.Add("X-NBT-SessionId", auth.sessionId); Ret = NbtClient.LpcUpdateJob(Request); } if (Ret.Authentication.AuthenticationStatus == "NonExistentSession") { //the old session has timed out, and we need to authenticate again CswNbtWebServiceSessionCswNbtAuthReturn authAttempt = _Authenticate(auth, e, NbtClient); if (authAttempt.Authentication.AuthenticationStatus == "Authenticated") { updateJob(auth, jobKey, success, errorMsg); } } else if (Ret.Authentication.AuthenticationStatus == "Authenticated") { if (Ret.Status.Success) { e.Succeeded = true; } else { e.Message = "Error updating job: "; if (Ret.Status.Errors.Length > 0) { e.Message += Ret.Status.Errors[0].Message; } } if (OnUpdateJob != null) { OnUpdateJob(e); } } } // updateJob()
private void UpdateJobEvents_JobModification(object sender, UpdateJobEventArgs e) { }