/// <summary> /// Tries to read element from XML. /// </summary> /// <param name="reader">The reader.</param> /// <returns>Returns true if element was read.</returns> internal override bool TryReadElementFromXml(EwsServiceXmlReader reader) { switch (reader.LocalName) { case XmlElementNames.UserId: this.userId = new UserId(); this.userId.LoadFromXml(reader, reader.LocalName); return true; case XmlElementNames.DelegatePermissions: this.permissions.Reset(); this.permissions.LoadFromXml(reader, reader.LocalName); return true; case XmlElementNames.ReceiveCopiesOfMeetingMessages: this.receiveCopiesOfMeetingMessages = reader.ReadElementValue<bool>(); return true; case XmlElementNames.ViewPrivateItems: this.viewPrivateItems = reader.ReadElementValue<bool>(); return true; default: return false; } }
/// <summary> /// Initializes a new instance of the <see cref="FolderPermission"/> class. /// </summary> /// <param name="standardUser">The standard user the permission applies to.</param> /// <param name="permissionLevel">The level of the permission.</param> public FolderPermission(StandardUser standardUser, FolderPermissionLevel permissionLevel) { this.userId = new UserId(standardUser); this.PermissionLevel = permissionLevel; }
/// <summary> /// Initializes a new instance of the <see cref="FolderPermission"/> class. /// </summary> /// <param name="primarySmtpAddress">The primary SMTP address of the user the permission applies to.</param> /// <param name="permissionLevel">The level of the permission.</param> public FolderPermission(string primarySmtpAddress, FolderPermissionLevel permissionLevel) { this.userId = new UserId(primarySmtpAddress); this.PermissionLevel = permissionLevel; }
/// <summary> /// Initializes a new instance of the <see cref="FolderPermission"/> class. /// </summary> /// <param name="userId">The Id of the user the permission applies to.</param> /// <param name="permissionLevel">The level of the permission.</param> public FolderPermission(UserId userId, FolderPermissionLevel permissionLevel) { EwsUtilities.ValidateParam(userId, "userId"); this.userId = userId; this.PermissionLevel = permissionLevel; }