public DistinguishedName(string dn) : this() { if (String.IsNullOrEmpty(dn)) { // Empty DN return; } string[] dnSegments = SplitDN(dn, false); foreach (string segment in dnSegments) { string[] rdnSegments = SplitDN(segment, true); if (rdnSegments.Length != 2) { throw new ArgumentException(Resources.DNParsingErrorMessage, "dn"); } try { var component = new DistinguishedNameComponent(rdnSegments[0].Trim(), rdnSegments[1].Trim()); this.Components.Add(component); } catch (ArgumentNullException) { throw new ArgumentException(Resources.DNParsingErrorMessage, "dn"); } } }
public void AddParent(string name, string value) { // Validation will be done in the DistinguishedNameComponent constructor var component = new DistinguishedNameComponent(name, value); this.AddParent(component); }
public void AddChild(DistinguishedNameComponent component) { if (component != null) { this.Components.Insert(0, component); } }
public void AddParent(DistinguishedNameComponent component) { if (component != null) { this.Components.Add(component); } }
public void AddChild(string name, string value) { // Validation will be performed by the DistinguishedNameComponent contructor. var component = new DistinguishedNameComponent(name, value); this.AddChild(component); }
public DistinguishedName(string dn) { this.Components = new List<DistinguishedNameComponent>(); if(String.IsNullOrEmpty(dn)) { // Empty DN return; } string[] dnSegments = SplitDN(dn, false); foreach (string segment in dnSegments) { string[] rdnSegments = SplitDN(segment, true); if (rdnSegments.Length != 2) { throw new ArgumentException(Resources.DNParsingErrorMessage, "dn"); } try { var component = new DistinguishedNameComponent(rdnSegments[0].Trim(), rdnSegments[1].Trim()); this.Components.Add(component); } catch(ArgumentNullException) { throw new ArgumentException(Resources.DNParsingErrorMessage, "dn"); } } }
public DistinguishedName(DistinguishedNameComponent rdn) : this() { this.AddParent(rdn); }
public void AddChild(string name, string value) { var component = new DistinguishedNameComponent(name, value); this.AddChild(component); }
public void AddParent(DistinguishedNameComponent component) { this.Components.Add(component); }
public void AddChild(DistinguishedNameComponent component) { this.Components.Insert(0, component); }
public void AddParent(string name, string value) { var component = new DistinguishedNameComponent(name, value); this.AddParent(component); }