예제 #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="PersonModel"/> class from MS Graph person.
        /// </summary>
        /// <param name="msftPerson">MS Graph person.</param>
        public PersonModel(Microsoft.Graph.Person msftPerson)
        {
            source                 = MailSource.Microsoft;
            this.Id                = msftPerson.Id;
            this.DisplayName       = msftPerson?.DisplayName;
            this.UserPrincipalName = msftPerson?.UserPrincipalName;

            this.Emails = new List <string>();
            if (msftPerson?.ScoredEmailAddresses != null)
            {
                foreach (var email in msftPerson.ScoredEmailAddresses)
                {
                    this.Emails.Add(email.Address);
                }
            }
        }
예제 #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="PersonModel"/> class.
        /// </summary>
        /// <param name="source">the event source.</param>
        public PersonModel(EventSource source)
        {
            this.source = source;
            switch (this.source)
            {
            case EventSource.Microsoft:
                msftPersonData = new Microsoft.Graph.Person();
                break;

            case EventSource.Google:
                gmailPersonData = new Google.Apis.People.v1.Data.Person();
                break;

            default:
                throw new Exception("Event Type not Defined");
            }
        }
예제 #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PersonModel"/> class from MS Graph person.
 /// </summary>
 /// <param name="msftPerson">MS Graph person.</param>
 public PersonModel(Microsoft.Graph.Person msftPerson)
 {
     source         = EventSource.Microsoft;
     msftPersonData = msftPerson;
 }