Esempio n. 1
0
 /// <summary>
 /// Adds the specified person as a contact.
 /// </summary>
 public void AddAsContact( Person person )
 {
     new SaveContactTask
     {
         FirstName = person.FirstName,
         LastName = person.LastName,
         HomePhone = person.PrivatePhoneNumber,
         WorkPhone = person.OfficePhoneNumber,
         WorkEmail = person.EmailAddress,
         Website = person.Homepages.Any() ? person.Homepages.First().Value : null
     }.Show();
 }
Esempio n. 2
0
        public static Person Parse( IDictionary<string, string> pairs )
        {
            var person = new Person();
            var typeInfo = typeof( Person ).GetTypeInfo();

            foreach ( var pair in pairs )
            {
                var prop = typeInfo.DeclaredProperties.FirstOrDefault( p =>
                {
                    var attr = p.GetCustomAttribute<ThriftFieldAttribute>();
                    return attr != null && attr.Name == pair.Key;
                } );
                // thankfully there are only strings in this class, apart from roles & homepages
                if ( prop != null && prop.PropertyType == typeof( string ) )
                {
                    prop.SetValue( person, pair.Value );
                }
            }

            return person;
        }
 public void AddAsContact( Person person )
 {
     // FRAMEWORK MISSING FEATURE: Windows Phone doesn't implement ContactPickerUI yet.
     throw new NotSupportedException();
 }
 public void AddAsContact( Person person ) { }