示例#1
0
 /// <summary>
 /// Convertit la fiche d'identité au format utilisé par la librairie agsXMPP
 /// </summary>
 /// <returns>Carte de visite</returns>
 public agsXMPP.protocol.iq.vcard.Vcard toVcard()
 {
     agsXMPP.protocol.iq.vcard.Vcard vcard = new agsXMPP.protocol.iq.vcard.Vcard();
     vcard.Birthday     = birthday;
     vcard.Description  = description;
     vcard.Fullname     = fullname;
     vcard.JabberId     = new agsXMPP.Jid(jabberID.full);
     vcard.Name         = new agsXMPP.protocol.iq.vcard.Name(name.lastname, name.firstname, name.middle);
     vcard.Nickname     = nickname;
     vcard.Organization = new agsXMPP.protocol.iq.vcard.Organization(organization.name, organization.unit);
     if (photoFormat != null)
     {
         vcard.Photo = new agsXMPP.protocol.iq.vcard.Photo(photo, photoFormat);
     }
     else
     {
         vcard.Photo = null;
     }
     vcard.Role  = role;
     vcard.Title = title;
     vcard.Url   = url;
     foreach (Email m in email)
     {
         vcard.AddEmailAddress(new agsXMPP.protocol.iq.vcard.Email(Enums.EmailTypeConverter(m.type), m.address, false));
     }
     foreach (Telehone t in telephone)
     {
         vcard.AddTelephoneNumber(new agsXMPP.protocol.iq.vcard.Telephone(Enums.LocationTypeConverter(t.location), Enums.PhoneTypeConverter(t.type), t.number));
     }
     foreach (Address a in address)
     {
         agsXMPP.protocol.iq.vcard.Address ad = new agsXMPP.protocol.iq.vcard.Address();
         ad.Country      = a.country;
         ad.ExtraAddress = a.extra;
         ad.Locality     = a.city;
         ad.Location     = Enums.AddressLocationTypeConverter(a.location);
         ad.PostalCode   = a.zipcode;
         ad.Region       = a.region;
         ad.Street       = a.street;
         vcard.AddAddress(ad);
     }
     return(vcard);
 }
示例#2
0
 /// <summary>
 /// Convertit la fiche d'identité au format utilisé par la librairie agsXMPP
 /// </summary>
 /// <returns>Carte de visite</returns>
 public agsXMPP.protocol.iq.vcard.Vcard toVcard()
 {
     agsXMPP.protocol.iq.vcard.Vcard vcard = new agsXMPP.protocol.iq.vcard.Vcard();
     vcard.Birthday = birthday;
     vcard.Description = description;
     vcard.Fullname = fullname;
     vcard.JabberId = new agsXMPP.Jid(jabberID.full);
     vcard.Name = new agsXMPP.protocol.iq.vcard.Name(name.lastname, name.firstname, name.middle);
     vcard.Nickname = nickname;
     vcard.Organization = new agsXMPP.protocol.iq.vcard.Organization(organization.name, organization.unit);
     if (photoFormat != null) {
         vcard.Photo = new agsXMPP.protocol.iq.vcard.Photo(photo, photoFormat);
     } else {
         vcard.Photo = null;
     }
     vcard.Role = role;
     vcard.Title = title;
     vcard.Url = url;
     foreach (Email m in email) {
         vcard.AddEmailAddress(new agsXMPP.protocol.iq.vcard.Email(Enums.EmailTypeConverter(m.type), m.address, false));
     }
     foreach (Telehone t in telephone) {
         vcard.AddTelephoneNumber(new agsXMPP.protocol.iq.vcard.Telephone(Enums.LocationTypeConverter(t.location), Enums.PhoneTypeConverter(t.type), t.number));
     }
     foreach (Address a in address) {
         agsXMPP.protocol.iq.vcard.Address ad = new agsXMPP.protocol.iq.vcard.Address();
         ad.Country = a.country;
         ad.ExtraAddress = a.extra;
         ad.Locality = a.city;
         ad.Location = Enums.AddressLocationTypeConverter(a.location);
         ad.PostalCode = a.zipcode;
         ad.Region = a.region;
         ad.Street = a.street;
         vcard.AddAddress(ad);
     }
     return vcard;
 }