void SetPhotoValue(vCardPhotoCollection photos) { if (photos.Any()) { var photo = photos[0]; try { // Get the bytes of the photo if it has // not already been loaded. if (!photo.IsLoaded) { photo.Fetch(); } PhotoBox.Image = photo.GetBitmap(); } catch { //Empty image icon instead. PhotoBox.Image = ((System.Drawing.Image)(resources.GetObject("PhotoBox.Image"))); } } else { PhotoBox.Image = ((System.Drawing.Image)(resources.GetObject("PhotoBox.Image"))); } }
public static void Equals( vCardPhotoCollection pc1, vCardPhotoCollection pc2) { Assert.AreEqual( pc1.Count, pc2.Count, "The two photo collections differ in count."); for (int index = 0; index < pc1.Count; index++) { Equals(pc1[index], pc2[index]); } }
/// <summary> /// Initializes a new instance of the <see cref="vCard"/> class. /// </summary> public vCard() { // Per Microsoft best practices, string properties should // never return null. String properties should always // return String.Empty. this.additionalNames = string.Empty; this.department = string.Empty; this.displayName = string.Empty; this.familyName = string.Empty; this.formattedName = string.Empty; this.givenName = string.Empty; this.mailer = string.Empty; this.namePrefix = string.Empty; this.nameSuffix = string.Empty; this.office = string.Empty; this.organization = string.Empty; this.productId = string.Empty; this.role = string.Empty; this.timeZone = string.Empty; this.title = string.Empty; this.uniqueId = string.Empty; this.categories = new StringCollection(); this.certificates = new vCardCertificateCollection(); this.deliveryAddresses = new vCardDeliveryAddressCollection(); this.deliveryLabels = new vCardDeliveryLabelCollection(); this.emailAddresses = new vCardEmailAddressCollection(); this.nicknames = new StringCollection(); this.notes = new vCardNoteCollection(); this.phones = new vCardPhoneCollection(); this.photos = new vCardPhotoCollection(); this.sources = new vCardSourceCollection(); this.websites = new vCardWebsiteCollection(); this.ims = new vCardIMPPCollection(); this.sps = new vCardSocialProfileCollection(); }