Exemplo n.º 1
0
        protected DomainObjectName(NetworkName domainName, Name name)
        {
            Contract.Requires(name != null);

            DomainName = domainName;
            Name       = name;
        }
Exemplo n.º 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)));
 }
Exemplo n.º 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];
        }
Exemplo n.º 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())));
        }
Exemplo n.º 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)));
 }
Exemplo n.º 6
0
 public static DomainResourceName TryParse(string domainName, string name)
 {
     return(name.IsNullOrWhiteSpace()
         ? null
         : new DomainResourceName(NetworkName.TryParse(domainName), ResourceName.TryParse(name)));
 }
Exemplo n.º 7
0
 public DomainResourceName(NetworkName domainName, IResourceName name)
     : base(domainName, (Name)name)
 {
 }
Exemplo n.º 8
0
 public DomainSecurityPrincipalName(NetworkName domainName, ISecurityPrincipalName name)
     : base(domainName, (Name)name)
 {
 }
Exemplo n.º 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))));
 }
Exemplo n.º 10
0
 public DomainNetworkName(NetworkName domainName, NetworkName name)
     : base(domainName, name)
 {
 }