Пример #1
0
        /// <summary>
        /// Test to see if all fields are equal.
        /// </summary>
        /// <param name="user">User to check</param>
        /// <returns></returns>
        public bool EqualsDirectoryIdentity(DirectoryIdentity user)
        {
            if (user == null)
            {
                return(false);
            }

            return(this.Id == user.Id && this.DisplayName == user.DisplayName && this.PrincipalName == user.PrincipalName && this.Type == user.Type);
        }
Пример #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Document"/> class.
 /// </summary>
 /// <param name="inputType">The type of input for the CountingGrid script.</param>
 /// <param name="userIdentity">The user identity object of the current user.</param>
 public Document(InputType inputType, DirectoryIdentity userIdentity)
 {
     this.Id             = Guid.NewGuid();
     this.DisplayName    = $"Document from {DateTime.UtcNow.ToShortDateString()}";
     this.InputType      = inputType;
     this.Owner          = userIdentity ?? throw new BrowseCloudServiceException("When creating a Document, userIdentity can't be null.");
     this.Acl            = new List <DirectoryIdentity>();
     this.IsPublic       = false;
     this.SubmitDateTime = DateTime.UtcNow;
     this.UpdateDateTime = DateTime.UtcNow;
 }