public void FailedToUpload(string contactId, FailedContactDatum failedContactDatum) { this.failedContactCount++; if (contactId == null || contactId.Length == 0) { return; } if (this.contactUploadData.ContainsKey(contactId)) { return; } this.contactUploadData.Add(contactId, failedContactDatum); }
/// <summary> /// Loads the selection state of the contacts in the given store. /// </summary> void LoadContactsState(XmlElement contactsXmlElement, StoreModel storeModel) { if (contactsXmlElement.GetAttribute( LKGStatePersistor.SelectionStateAttrName) == bool.FalseString) { storeModel.IsContactSelected = false; } else { storeModel.IsContactSelected = true; } foreach (XmlNode childXmlNode in contactsXmlElement.ChildNodes) { XmlElement childXmlElement = childXmlNode as XmlElement; if (childXmlElement == null) { continue; } if (childXmlElement.Name != LKGStatePersistor.ContactElementName) { continue; } string contactId = childXmlElement.GetAttribute(LKGStatePersistor.ContactIdAttrName); if (contactId == null || contactId.Length == 0) { continue; } string failureReason = childXmlElement.GetAttribute( LKGStatePersistor.FailureReasonAttrName); if (failureReason == null || failureReason.Length == 0) { storeModel.SuccessfullyUploaded(contactId); } else { FailedContactDatum failedContactDatum = new FailedContactDatum(childXmlElement.InnerText, failureReason); storeModel.FailedToUpload(contactId, failedContactDatum); } } }
void ProcessUploadContactEntry(ContactEntry contactEntry) { Debug.Assert(this.modelState == ModelState.UploadingPause || this.modelState == ModelState.Uploading); if (contactEntry.Uploaded) { contactEntry.StoreModel.SuccessfullyUploaded(contactEntry.ContactId); this.uploadedContactCount++; } else { FailedContactDatum failedContactDatum = new FailedContactDatum(contactEntry.ContactName, contactEntry.FailedReason); contactEntry.StoreModel.FailedToUpload(contactEntry.ContactId, failedContactDatum); this.failedContactCount++; } this.lkgStatePersistor.SaveLKGState(this); }