示例#1
0
        /// <summary>
        /// Creates a new instance of a ContactInfo object, and initializes it with the specified properties.
        /// </summary>
        /// <param name="user"></param>
        /// <param name="name"></param>
        /// <param name="type"></param>
        /// <param name="category"></param>
        /// <param name="value"></param>
        public ContactInfo(User user, string name, ContactInfoType type, ContactInfoCategory category, string value)
        {
            if (String.IsNullOrWhiteSpace(name))
            {
                throw new ArgumentNullException(nameof(name));
            }

            if (String.IsNullOrWhiteSpace(value))
            {
                throw new ArgumentNullException(nameof(value));
            }

            this.Users.Add(new UserContactInfo(user, this));
            this.Name     = name;
            this.Type     = type;
            this.Category = category;
            this.Value    = value;
        }
示例#2
0
        /// <summary>
        /// Creates a new instance of a ContactInfo object, and initializes it with the specified properties.
        /// </summary>
        /// <param name="participant"></param>
        /// <param name="name"></param>
        /// <param name="type"></param>
        /// <param name="category"></param>
        /// <param name="value"></param>
        public ContactInfo(Participant participant, string name, ContactInfoType type, ContactInfoCategory category, string value)
        {
            if (String.IsNullOrWhiteSpace(name))
            {
                throw new ArgumentNullException(nameof(name));
            }

            if (String.IsNullOrWhiteSpace(value))
            {
                throw new ArgumentNullException(nameof(value));
            }

            this.Participants.Add(new ParticipantContactInfo(participant, this));
            this.Name     = name;
            this.Type     = type;
            this.Category = category;
            this.Value    = value;
        }