Example #1
0
        protected DomainObjectName(NetworkName domainName, Name name)
        {
            Contract.Requires(name != null);

            DomainName = domainName;
            Name       = name;
        }
Example #2
0
 public static DomainSecurityPrincipalName TryParse(string domainName, string name)
 {
     return(name.IsNullOrWhiteSpace()
         ? null
         : domainName.IsNullOrWhiteSpace()
             ? TryParse(name)
             : new DomainSecurityPrincipalName(NetworkName.TryParse(domainName), SecurityPrincipalName.TryParse(name)));
 }
Example #3
0
        private UpnName(string name)
            : base(name)
        {
            var nameParts = Value.Split(Separator, 2);

            DomainName = NetworkName.TryParse(nameParts.Length == 1 ? null : nameParts[1]);
            UserName   = nameParts[0];
        }
Example #4
0
        public bool IsSimilar(NetworkName other)
        {
            if (other == null)
            {
                return(false);
            }

            return(GetType() == other.GetType()
                ? Equals(other)
                : (other is NetbiosName
                    ? ToString().StartsWithOrdinalIgnoreCase(other.ToString())
                    : other.ToString().StartsWithOrdinalIgnoreCase(ToString())));
        }
Example #5
0
 private static DomainResourceName TryParse(string domainName, IReadOnlyCollection <string> nameParts)
 {
     return(nameParts == null || nameParts.None()
         ? null
         : new DomainResourceName(NetworkName.TryParse(domainName), SpnName.TryParse(nameParts, false)));
 }
Example #6
0
 public static DomainResourceName TryParse(string domainName, string name)
 {
     return(name.IsNullOrWhiteSpace()
         ? null
         : new DomainResourceName(NetworkName.TryParse(domainName), ResourceName.TryParse(name)));
 }
Example #7
0
 public DomainResourceName(NetworkName domainName, IResourceName name)
     : base(domainName, (Name)name)
 {
 }
Example #8
0
 public DomainSecurityPrincipalName(NetworkName domainName, ISecurityPrincipalName name)
     : base(domainName, (Name)name)
 {
 }
Example #9
0
 public bool IsSimilar(DomainNetworkName other)
 {
     return
         (DomainName == null && other.DomainName == null && Name.Equals(other.Name) ||
          ((NetworkName)Name).IsSimilar((NetworkName)other.Name) &&
          (DomainName != null && other.DomainName != null && DomainName.IsSimilar(other.DomainName) ||
           DomainName != null && other.DomainName == null && Name is NetbiosName && other.Name is DnsName && DomainName.IsSimilar(NetworkName.TryParse(((DnsName)other.Name).DomainName)) ||
           DomainName == null && other.DomainName != null && Name is DnsName && other.Name is NetbiosName && other.DomainName.IsSimilar(NetworkName.TryParse(((DnsName)Name).DomainName))));
 }
Example #10
0
 public DomainNetworkName(NetworkName domainName, NetworkName name)
     : base(domainName, name)
 {
 }