// // PersonNameType.cs // // using System; using System.Collections; using System.Xml; namespace PersonName { public class PersonNameType : Xml.Node { #region Forward constructors public PersonNameType(XmlDocument doc) : base(doc) { SetCollectionParents(); } public PersonNameType(XmlNode node) : base(node) { SetCollectionParents(); } public PersonNameType(Xml.Node node) : base(node) { SetCollectionParents(); } public PersonNameType(Xml.Document doc, string namespaceURI, string prefix, string name) : base(doc, namespaceURI, prefix, name) { SetCollectionParents(); } #endregion // Forward constructors public override void AdjustPrefix() { for ( XmlNode DOMNode = GetDomFirstChild( NodeType.Attribute, "", "script" ); DOMNode != null; DOMNode = GetDomNextChild( NodeType.Attribute, "", "script", DOMNode ) ) { InternalAdjustPrefix(DOMNode, false); } for ( XmlNode DOMNode = GetDomFirstChild( NodeType.Element, "http://ns.hr-xml.org/2006-02-28", "FormattedName" ); DOMNode != null; DOMNode = GetDomNextChild( NodeType.Element, "http://ns.hr-xml.org/2006-02-28", "FormattedName", DOMNode ) ) { InternalAdjustPrefix(DOMNode, true); } for ( XmlNode DOMNode = GetDomFirstChild( NodeType.Element, "http://ns.hr-xml.org/2006-02-28", "LegalName" ); DOMNode != null; DOMNode = GetDomNextChild( NodeType.Element, "http://ns.hr-xml.org/2006-02-28", "LegalName", DOMNode ) ) { InternalAdjustPrefix(DOMNode, true); } for ( XmlNode DOMNode = GetDomFirstChild( NodeType.Element, "http://ns.hr-xml.org/2006-02-28", "GivenName" ); DOMNode != null; DOMNode = GetDomNextChild( NodeType.Element, "http://ns.hr-xml.org/2006-02-28", "GivenName", DOMNode ) ) { InternalAdjustPrefix(DOMNode, true); } for ( XmlNode DOMNode = GetDomFirstChild( NodeType.Element, "http://ns.hr-xml.org/2006-02-28", "PreferredGivenName" ); DOMNode != null; DOMNode = GetDomNextChild( NodeType.Element, "http://ns.hr-xml.org/2006-02-28", "PreferredGivenName", DOMNode ) ) { InternalAdjustPrefix(DOMNode, true); } for ( XmlNode DOMNode = GetDomFirstChild( NodeType.Element, "http://ns.hr-xml.org/2006-02-28", "MiddleName" ); DOMNode != null; DOMNode = GetDomNextChild( NodeType.Element, "http://ns.hr-xml.org/2006-02-28", "MiddleName", DOMNode ) ) { InternalAdjustPrefix(DOMNode, true); } for ( XmlNode DOMNode = GetDomFirstChild( NodeType.Element, "http://ns.hr-xml.org/2006-02-28", "FamilyName" ); DOMNode != null; DOMNode = GetDomNextChild( NodeType.Element, "http://ns.hr-xml.org/2006-02-28", "FamilyName", DOMNode ) ) { InternalAdjustPrefix(DOMNode, true); new FamilyNameType(DOMNode).AdjustPrefix(); } for ( XmlNode DOMNode = GetDomFirstChild( NodeType.Element, "http://ns.hr-xml.org/2006-02-28", "Affix" ); DOMNode != null; DOMNode = GetDomNextChild( NodeType.Element, "http://ns.hr-xml.org/2006-02-28", "Affix", DOMNode ) ) { InternalAdjustPrefix(DOMNode, true); new AffixType(DOMNode).AdjustPrefix(); } for ( XmlNode DOMNode = GetDomFirstChild( NodeType.Element, "http://ns.hr-xml.org/2006-02-28", "AlternateScript" ); DOMNode != null; DOMNode = GetDomNextChild( NodeType.Element, "http://ns.hr-xml.org/2006-02-28", "AlternateScript", DOMNode ) ) { InternalAdjustPrefix(DOMNode, true); new AlternateScriptType(DOMNode).AdjustPrefix(); } } #region script accessor methods public static int GetscriptMinCount() { return 0; } public static int scriptMinCount { get { return 0; } } public static int GetscriptMaxCount() { return 1; } public static int scriptMaxCount { get { return 1; } } public int GetscriptCount() { return DomChildCount(NodeType.Attribute, "", "script"); } public int scriptCount { get { return DomChildCount(NodeType.Attribute, "", "script"); } } public bool Hasscript() { return HasDomChild(NodeType.Attribute, "", "script"); } public SchemaString Newscript() { return new SchemaString(); } public SchemaString GetscriptAt(int index) { return new SchemaString(GetDomNodeValue(GetDomChildAt(NodeType.Attribute, "", "script", index))); } public XmlNode GetStartingscriptCursor() { return GetDomFirstChild( NodeType.Attribute, "", "script" ); } public XmlNode GetAdvancedscriptCursor( XmlNode curNode ) { return GetDomNextChild( NodeType.Attribute, "", "script", curNode ); } public SchemaString GetscriptValueAtCursor( XmlNode curNode ) { if( curNode == null ) throw new Xml.XmlException("Out of range"); else return new SchemaString( curNode.Value ); } public SchemaString Getscript() { return GetscriptAt(0); } public SchemaString script { get { return GetscriptAt(0); } } public void RemovescriptAt(int index) { RemoveDomChildAt(NodeType.Attribute, "", "script", index); } public void Removescript() { while (Hasscript()) RemovescriptAt(0); } public void Addscript(SchemaString newValue) { if( newValue.IsNull() == false ) AppendDomChild(NodeType.Attribute, "", "script", newValue.ToString()); } public void InsertscriptAt(SchemaString newValue, int index) { if( newValue.IsNull() == false ) InsertDomChildAt(NodeType.Attribute, "", "script", index, newValue.ToString()); } public void ReplacescriptAt(SchemaString newValue, int index) { ReplaceDomChildAt(NodeType.Attribute, "", "script", index, newValue.ToString()); } #endregion // script accessor methods #region script collection public scriptCollection Myscripts = new scriptCollection( ); public class scriptCollection: IEnumerable { PersonNameType parent; public PersonNameType Parent { set { parent = value; } } public scriptEnumerator GetEnumerator() { return new scriptEnumerator(parent); } IEnumerator IEnumerable.GetEnumerator() { return GetEnumerator(); } } public class scriptEnumerator: IEnumerator { int nIndex; PersonNameType parent; public scriptEnumerator(PersonNameType par) { parent = par; nIndex = -1; } public void Reset() { nIndex = -1; } public bool MoveNext() { nIndex++; return(nIndex < parent.scriptCount ); } public SchemaString Current { get { return(parent.GetscriptAt(nIndex)); } } object IEnumerator.Current { get { return(Current); } } } #endregion // script collection #region FormattedName accessor methods public static int GetFormattedNameMinCount() { return 0; } public static int FormattedNameMinCount { get { return 0; } } public static int GetFormattedNameMaxCount() { return 1; } public static int FormattedNameMaxCount { get { return 1; } } public int GetFormattedNameCount() { return DomChildCount(NodeType.Element, "http://ns.hr-xml.org/2006-02-28", "FormattedName"); } public int FormattedNameCount { get { return DomChildCount(NodeType.Element, "http://ns.hr-xml.org/2006-02-28", "FormattedName"); } } public bool HasFormattedName() { return HasDomChild(NodeType.Element, "http://ns.hr-xml.org/2006-02-28", "FormattedName"); } public SchemaString NewFormattedName() { return new SchemaString(); } public SchemaString GetFormattedNameAt(int index) { return new SchemaString(GetDomNodeValue(GetDomChildAt(NodeType.Element, "http://ns.hr-xml.org/2006-02-28", "FormattedName", index))); } public XmlNode GetStartingFormattedNameCursor() { return GetDomFirstChild( NodeType.Element, "http://ns.hr-xml.org/2006-02-28", "FormattedName" ); } public XmlNode GetAdvancedFormattedNameCursor( XmlNode curNode ) { return GetDomNextChild( NodeType.Element, "http://ns.hr-xml.org/2006-02-28", "FormattedName", curNode ); } public SchemaString GetFormattedNameValueAtCursor( XmlNode curNode ) { if( curNode == null ) throw new Xml.XmlException("Out of range"); else return new SchemaString( curNode.InnerText ); } public SchemaString GetFormattedName() { return GetFormattedNameAt(0); } public SchemaString FormattedName { get { return GetFormattedNameAt(0); } } public void RemoveFormattedNameAt(int index) { RemoveDomChildAt(NodeType.Element, "http://ns.hr-xml.org/2006-02-28", "FormattedName", index); } public void RemoveFormattedName() { while (HasFormattedName()) RemoveFormattedNameAt(0); } public void AddFormattedName(SchemaString newValue) { if( newValue.IsNull() == false ) AppendDomChild(NodeType.Element, "http://ns.hr-xml.org/2006-02-28", "FormattedName", newValue.ToString()); } public void InsertFormattedNameAt(SchemaString newValue, int index) { if( newValue.IsNull() == false ) InsertDomChildAt(NodeType.Element, "http://ns.hr-xml.org/2006-02-28", "FormattedName", index, newValue.ToString()); } public void ReplaceFormattedNameAt(SchemaString newValue, int index) { ReplaceDomChildAt(NodeType.Element, "http://ns.hr-xml.org/2006-02-28", "FormattedName", index, newValue.ToString()); } #endregion // FormattedName accessor methods #region FormattedName collection public FormattedNameCollection MyFormattedNames = new FormattedNameCollection( ); public class FormattedNameCollection: IEnumerable { PersonNameType parent; public PersonNameType Parent { set { parent = value; } } public FormattedNameEnumerator GetEnumerator() { return new FormattedNameEnumerator(parent); } IEnumerator IEnumerable.GetEnumerator() { return GetEnumerator(); } } public class FormattedNameEnumerator: IEnumerator { int nIndex; PersonNameType parent; public FormattedNameEnumerator(PersonNameType par) { parent = par; nIndex = -1; } public void Reset() { nIndex = -1; } public bool MoveNext() { nIndex++; return(nIndex < parent.FormattedNameCount ); } public SchemaString Current { get { return(parent.GetFormattedNameAt(nIndex)); } } object IEnumerator.Current { get { return(Current); } } } #endregion // FormattedName collection #region LegalName accessor methods public static int GetLegalNameMinCount() { return 0; } public static int LegalNameMinCount { get { return 0; } } public static int GetLegalNameMaxCount() { return 1; } public static int LegalNameMaxCount { get { return 1; } } public int GetLegalNameCount() { return DomChildCount(NodeType.Element, "http://ns.hr-xml.org/2006-02-28", "LegalName"); } public int LegalNameCount { get { return DomChildCount(NodeType.Element, "http://ns.hr-xml.org/2006-02-28", "LegalName"); } } public bool HasLegalName() { return HasDomChild(NodeType.Element, "http://ns.hr-xml.org/2006-02-28", "LegalName"); } public SchemaString NewLegalName() { return new SchemaString(); } public SchemaString GetLegalNameAt(int index) { return new SchemaString(GetDomNodeValue(GetDomChildAt(NodeType.Element, "http://ns.hr-xml.org/2006-02-28", "LegalName", index))); } public XmlNode GetStartingLegalNameCursor() { return GetDomFirstChild( NodeType.Element, "http://ns.hr-xml.org/2006-02-28", "LegalName" ); } public XmlNode GetAdvancedLegalNameCursor( XmlNode curNode ) { return GetDomNextChild( NodeType.Element, "http://ns.hr-xml.org/2006-02-28", "LegalName", curNode ); } public SchemaString GetLegalNameValueAtCursor( XmlNode curNode ) { if( curNode == null ) throw new Xml.XmlException("Out of range"); else return new SchemaString( curNode.InnerText ); } public SchemaString GetLegalName() { return GetLegalNameAt(0); } public SchemaString LegalName { get { return GetLegalNameAt(0); } } public void RemoveLegalNameAt(int index) { RemoveDomChildAt(NodeType.Element, "http://ns.hr-xml.org/2006-02-28", "LegalName", index); } public void RemoveLegalName() { while (HasLegalName()) RemoveLegalNameAt(0); } public void AddLegalName(SchemaString newValue) { if( newValue.IsNull() == false ) AppendDomChild(NodeType.Element, "http://ns.hr-xml.org/2006-02-28", "LegalName", newValue.ToString()); } public void InsertLegalNameAt(SchemaString newValue, int index) { if( newValue.IsNull() == false ) InsertDomChildAt(NodeType.Element, "http://ns.hr-xml.org/2006-02-28", "LegalName", index, newValue.ToString()); } public void ReplaceLegalNameAt(SchemaString newValue, int index) { ReplaceDomChildAt(NodeType.Element, "http://ns.hr-xml.org/2006-02-28", "LegalName", index, newValue.ToString()); } #endregion // LegalName accessor methods #region LegalName collection public LegalNameCollection MyLegalNames = new LegalNameCollection( ); public class LegalNameCollection: IEnumerable { PersonNameType parent; public PersonNameType Parent { set { parent = value; } } public LegalNameEnumerator GetEnumerator() { return new LegalNameEnumerator(parent); } IEnumerator IEnumerable.GetEnumerator() { return GetEnumerator(); } } public class LegalNameEnumerator: IEnumerator { int nIndex; PersonNameType parent; public LegalNameEnumerator(PersonNameType par) { parent = par; nIndex = -1; } public void Reset() { nIndex = -1; } public bool MoveNext() { nIndex++; return(nIndex < parent.LegalNameCount ); } public SchemaString Current { get { return(parent.GetLegalNameAt(nIndex)); } } object IEnumerator.Current { get { return(Current); } } } #endregion // LegalName collection #region GivenName accessor methods public static int GetGivenNameMinCount() { return 0; } public static int GivenNameMinCount { get { return 0; } } public static int GetGivenNameMaxCount() { return Int32.MaxValue; } public static int GivenNameMaxCount { get { return Int32.MaxValue; } } public int GetGivenNameCount() { return DomChildCount(NodeType.Element, "http://ns.hr-xml.org/2006-02-28", "GivenName"); } public int GivenNameCount { get { return DomChildCount(NodeType.Element, "http://ns.hr-xml.org/2006-02-28", "GivenName"); } } public bool HasGivenName() { return HasDomChild(NodeType.Element, "http://ns.hr-xml.org/2006-02-28", "GivenName"); } public SchemaString NewGivenName() { return new SchemaString(); } public SchemaString GetGivenNameAt(int index) { return new SchemaString(GetDomNodeValue(GetDomChildAt(NodeType.Element, "http://ns.hr-xml.org/2006-02-28", "GivenName", index))); } public XmlNode GetStartingGivenNameCursor() { return GetDomFirstChild( NodeType.Element, "http://ns.hr-xml.org/2006-02-28", "GivenName" ); } public XmlNode GetAdvancedGivenNameCursor( XmlNode curNode ) { return GetDomNextChild( NodeType.Element, "http://ns.hr-xml.org/2006-02-28", "GivenName", curNode ); } public SchemaString GetGivenNameValueAtCursor( XmlNode curNode ) { if( curNode == null ) throw new Xml.XmlException("Out of range"); else return new SchemaString( curNode.InnerText ); } public SchemaString GetGivenName() { return GetGivenNameAt(0); } public SchemaString GivenName { get { return GetGivenNameAt(0); } } public void RemoveGivenNameAt(int index) { RemoveDomChildAt(NodeType.Element, "http://ns.hr-xml.org/2006-02-28", "GivenName", index); } public void RemoveGivenName() { while (HasGivenName()) RemoveGivenNameAt(0); } public void AddGivenName(SchemaString newValue) { if( newValue.IsNull() == false ) AppendDomChild(NodeType.Element, "http://ns.hr-xml.org/2006-02-28", "GivenName", newValue.ToString()); } public void InsertGivenNameAt(SchemaString newValue, int index) { if( newValue.IsNull() == false ) InsertDomChildAt(NodeType.Element, "http://ns.hr-xml.org/2006-02-28", "GivenName", index, newValue.ToString()); } public void ReplaceGivenNameAt(SchemaString newValue, int index) { ReplaceDomChildAt(NodeType.Element, "http://ns.hr-xml.org/2006-02-28", "GivenName", index, newValue.ToString()); } #endregion // GivenName accessor methods #region GivenName collection public GivenNameCollection MyGivenNames = new GivenNameCollection( ); public class GivenNameCollection: IEnumerable { PersonNameType parent; public PersonNameType Parent { set { parent = value; } } public GivenNameEnumerator GetEnumerator() { return new GivenNameEnumerator(parent); } IEnumerator IEnumerable.GetEnumerator() { return GetEnumerator(); } } public class GivenNameEnumerator: IEnumerator { int nIndex; PersonNameType parent; public GivenNameEnumerator(PersonNameType par) { parent = par; nIndex = -1; } public void Reset() { nIndex = -1; } public bool MoveNext() { nIndex++; return(nIndex < parent.GivenNameCount ); } public SchemaString Current { get { return(parent.GetGivenNameAt(nIndex)); } } object IEnumerator.Current { get { return(Current); } } } #endregion // GivenName collection #region PreferredGivenName accessor methods public static int GetPreferredGivenNameMinCount() { return 0; } public static int PreferredGivenNameMinCount { get { return 0; } } public static int GetPreferredGivenNameMaxCount() { return 1; } public static int PreferredGivenNameMaxCount { get { return 1; } } public int GetPreferredGivenNameCount() { return DomChildCount(NodeType.Element, "http://ns.hr-xml.org/2006-02-28", "PreferredGivenName"); } public int PreferredGivenNameCount { get { return DomChildCount(NodeType.Element, "http://ns.hr-xml.org/2006-02-28", "PreferredGivenName"); } } public bool HasPreferredGivenName() { return HasDomChild(NodeType.Element, "http://ns.hr-xml.org/2006-02-28", "PreferredGivenName"); } public SchemaString NewPreferredGivenName() { return new SchemaString(); } public SchemaString GetPreferredGivenNameAt(int index) { return new SchemaString(GetDomNodeValue(GetDomChildAt(NodeType.Element, "http://ns.hr-xml.org/2006-02-28", "PreferredGivenName", index))); } public XmlNode GetStartingPreferredGivenNameCursor() { return GetDomFirstChild( NodeType.Element, "http://ns.hr-xml.org/2006-02-28", "PreferredGivenName" ); } public XmlNode GetAdvancedPreferredGivenNameCursor( XmlNode curNode ) { return GetDomNextChild( NodeType.Element, "http://ns.hr-xml.org/2006-02-28", "PreferredGivenName", curNode ); } public SchemaString GetPreferredGivenNameValueAtCursor( XmlNode curNode ) { if( curNode == null ) throw new Xml.XmlException("Out of range"); else return new SchemaString( curNode.InnerText ); } public SchemaString GetPreferredGivenName() { return GetPreferredGivenNameAt(0); } public SchemaString PreferredGivenName { get { return GetPreferredGivenNameAt(0); } } public void RemovePreferredGivenNameAt(int index) { RemoveDomChildAt(NodeType.Element, "http://ns.hr-xml.org/2006-02-28", "PreferredGivenName", index); } public void RemovePreferredGivenName() { while (HasPreferredGivenName()) RemovePreferredGivenNameAt(0); } public void AddPreferredGivenName(SchemaString newValue) { if( newValue.IsNull() == false ) AppendDomChild(NodeType.Element, "http://ns.hr-xml.org/2006-02-28", "PreferredGivenName", newValue.ToString()); } public void InsertPreferredGivenNameAt(SchemaString newValue, int index) { if( newValue.IsNull() == false ) InsertDomChildAt(NodeType.Element, "http://ns.hr-xml.org/2006-02-28", "PreferredGivenName", index, newValue.ToString()); } public void ReplacePreferredGivenNameAt(SchemaString newValue, int index) { ReplaceDomChildAt(NodeType.Element, "http://ns.hr-xml.org/2006-02-28", "PreferredGivenName", index, newValue.ToString()); } #endregion // PreferredGivenName accessor methods #region PreferredGivenName collection public PreferredGivenNameCollection MyPreferredGivenNames = new PreferredGivenNameCollection( ); public class PreferredGivenNameCollection: IEnumerable { PersonNameType parent; public PersonNameType Parent { set { parent = value; } } public PreferredGivenNameEnumerator GetEnumerator() { return new PreferredGivenNameEnumerator(parent); } IEnumerator IEnumerable.GetEnumerator() { return GetEnumerator(); } } public class PreferredGivenNameEnumerator: IEnumerator { int nIndex; PersonNameType parent; public PreferredGivenNameEnumerator(PersonNameType par) { parent = par; nIndex = -1; } public void Reset() { nIndex = -1; } public bool MoveNext() { nIndex++; return(nIndex < parent.PreferredGivenNameCount ); } public SchemaString Current { get { return(parent.GetPreferredGivenNameAt(nIndex)); } } object IEnumerator.Current { get { return(Current); } } } #endregion // PreferredGivenName collection #region MiddleName accessor methods public static int GetMiddleNameMinCount() { return 0; } public static int MiddleNameMinCount { get { return 0; } } public static int GetMiddleNameMaxCount() { return 1; } public static int MiddleNameMaxCount { get { return 1; } } public int GetMiddleNameCount() { return DomChildCount(NodeType.Element, "http://ns.hr-xml.org/2006-02-28", "MiddleName"); } public int MiddleNameCount { get { return DomChildCount(NodeType.Element, "http://ns.hr-xml.org/2006-02-28", "MiddleName"); } } public bool HasMiddleName() { return HasDomChild(NodeType.Element, "http://ns.hr-xml.org/2006-02-28", "MiddleName"); } public SchemaString NewMiddleName() { return new SchemaString(); } public SchemaString GetMiddleNameAt(int index) { return new SchemaString(GetDomNodeValue(GetDomChildAt(NodeType.Element, "http://ns.hr-xml.org/2006-02-28", "MiddleName", index))); } public XmlNode GetStartingMiddleNameCursor() { return GetDomFirstChild( NodeType.Element, "http://ns.hr-xml.org/2006-02-28", "MiddleName" ); } public XmlNode GetAdvancedMiddleNameCursor( XmlNode curNode ) { return GetDomNextChild( NodeType.Element, "http://ns.hr-xml.org/2006-02-28", "MiddleName", curNode ); } public SchemaString GetMiddleNameValueAtCursor( XmlNode curNode ) { if( curNode == null ) throw new Xml.XmlException("Out of range"); else return new SchemaString( curNode.InnerText ); } public SchemaString GetMiddleName() { return GetMiddleNameAt(0); } public SchemaString MiddleName { get { return GetMiddleNameAt(0); } } public void RemoveMiddleNameAt(int index) { RemoveDomChildAt(NodeType.Element, "http://ns.hr-xml.org/2006-02-28", "MiddleName", index); } public void RemoveMiddleName() { while (HasMiddleName()) RemoveMiddleNameAt(0); } public void AddMiddleName(SchemaString newValue) { if( newValue.IsNull() == false ) AppendDomChild(NodeType.Element, "http://ns.hr-xml.org/2006-02-28", "MiddleName", newValue.ToString()); } public void InsertMiddleNameAt(SchemaString newValue, int index) { if( newValue.IsNull() == false ) InsertDomChildAt(NodeType.Element, "http://ns.hr-xml.org/2006-02-28", "MiddleName", index, newValue.ToString()); } public void ReplaceMiddleNameAt(SchemaString newValue, int index) { ReplaceDomChildAt(NodeType.Element, "http://ns.hr-xml.org/2006-02-28", "MiddleName", index, newValue.ToString()); } #endregion // MiddleName accessor methods #region MiddleName collection public MiddleNameCollection MyMiddleNames = new MiddleNameCollection( ); public class MiddleNameCollection: IEnumerable { PersonNameType parent; public PersonNameType Parent { set { parent = value; } } public MiddleNameEnumerator GetEnumerator() { return new MiddleNameEnumerator(parent); } IEnumerator IEnumerable.GetEnumerator() { return GetEnumerator(); } } public class MiddleNameEnumerator: IEnumerator { int nIndex; PersonNameType parent; public MiddleNameEnumerator(PersonNameType par) { parent = par; nIndex = -1; } public void Reset() { nIndex = -1; } public bool MoveNext() { nIndex++; return(nIndex < parent.MiddleNameCount ); } public SchemaString Current { get { return(parent.GetMiddleNameAt(nIndex)); } } object IEnumerator.Current { get { return(Current); } } } #endregion // MiddleName collection #region FamilyName accessor methods public static int GetFamilyNameMinCount() { return 0; } public static int FamilyNameMinCount { get { return 0; } } public static int GetFamilyNameMaxCount() { return Int32.MaxValue; } public static int FamilyNameMaxCount { get { return Int32.MaxValue; } } public int GetFamilyNameCount() { return DomChildCount(NodeType.Element, "http://ns.hr-xml.org/2006-02-28", "FamilyName"); } public int FamilyNameCount { get { return DomChildCount(NodeType.Element, "http://ns.hr-xml.org/2006-02-28", "FamilyName"); } } public bool HasFamilyName() { return HasDomChild(NodeType.Element, "http://ns.hr-xml.org/2006-02-28", "FamilyName"); } public FamilyNameType NewFamilyName() { return new FamilyNameType(domNode.OwnerDocument.CreateElement("FamilyName", "http://ns.hr-xml.org/2006-02-28")); } public FamilyNameType GetFamilyNameAt(int index) { return new FamilyNameType(GetDomChildAt(NodeType.Element, "http://ns.hr-xml.org/2006-02-28", "FamilyName", index)); } public XmlNode GetStartingFamilyNameCursor() { return GetDomFirstChild( NodeType.Element, "http://ns.hr-xml.org/2006-02-28", "FamilyName" ); } public XmlNode GetAdvancedFamilyNameCursor( XmlNode curNode ) { return GetDomNextChild( NodeType.Element, "http://ns.hr-xml.org/2006-02-28", "FamilyName", curNode ); } public FamilyNameType GetFamilyNameValueAtCursor( XmlNode curNode ) { if( curNode == null ) throw new Xml.XmlException("Out of range"); else return new FamilyNameType( curNode ); } public FamilyNameType GetFamilyName() { return GetFamilyNameAt(0); } public FamilyNameType FamilyName { get { return GetFamilyNameAt(0); } } public void RemoveFamilyNameAt(int index) { RemoveDomChildAt(NodeType.Element, "http://ns.hr-xml.org/2006-02-28", "FamilyName", index); } public void RemoveFamilyName() { while (HasFamilyName()) RemoveFamilyNameAt(0); } public void AddFamilyName(FamilyNameType newValue) { AppendDomElement("http://ns.hr-xml.org/2006-02-28", "FamilyName", newValue); } public void InsertFamilyNameAt(FamilyNameType newValue, int index) { InsertDomElementAt("http://ns.hr-xml.org/2006-02-28", "FamilyName", index, newValue); } public void ReplaceFamilyNameAt(FamilyNameType newValue, int index) { ReplaceDomElementAt("http://ns.hr-xml.org/2006-02-28", "FamilyName", index, newValue); } #endregion // FamilyName accessor methods #region FamilyName collection public FamilyNameCollection MyFamilyNames = new FamilyNameCollection( ); public class FamilyNameCollection: IEnumerable { PersonNameType parent; public PersonNameType Parent { set { parent = value; } } public FamilyNameEnumerator GetEnumerator() { return new FamilyNameEnumerator(parent); } IEnumerator IEnumerable.GetEnumerator() { return GetEnumerator(); } } public class FamilyNameEnumerator: IEnumerator { int nIndex; PersonNameType parent; public FamilyNameEnumerator(PersonNameType par) { parent = par; nIndex = -1; } public void Reset() { nIndex = -1; } public bool MoveNext() { nIndex++; return(nIndex < parent.FamilyNameCount ); } public FamilyNameType Current { get { return(parent.GetFamilyNameAt(nIndex)); } } object IEnumerator.Current { get { return(Current); } } } #endregion // FamilyName collection #region Affix accessor methods public static int GetAffixMinCount() { return 0; } public static int AffixMinCount { get { return 0; } } public static int GetAffixMaxCount() { return Int32.MaxValue; } public static int AffixMaxCount { get { return Int32.MaxValue; } } public int GetAffixCount() { return DomChildCount(NodeType.Element, "http://ns.hr-xml.org/2006-02-28", "Affix"); } public int AffixCount { get { return DomChildCount(NodeType.Element, "http://ns.hr-xml.org/2006-02-28", "Affix"); } } public bool HasAffix() { return HasDomChild(NodeType.Element, "http://ns.hr-xml.org/2006-02-28", "Affix"); } public AffixType NewAffix() { return new AffixType(domNode.OwnerDocument.CreateElement("Affix", "http://ns.hr-xml.org/2006-02-28")); } public AffixType GetAffixAt(int index) { return new AffixType(GetDomChildAt(NodeType.Element, "http://ns.hr-xml.org/2006-02-28", "Affix", index)); } public XmlNode GetStartingAffixCursor() { return GetDomFirstChild( NodeType.Element, "http://ns.hr-xml.org/2006-02-28", "Affix" ); } public XmlNode GetAdvancedAffixCursor( XmlNode curNode ) { return GetDomNextChild( NodeType.Element, "http://ns.hr-xml.org/2006-02-28", "Affix", curNode ); } public AffixType GetAffixValueAtCursor( XmlNode curNode ) { if( curNode == null ) throw new Xml.XmlException("Out of range"); else return new AffixType( curNode ); } public AffixType GetAffix() { return GetAffixAt(0); } public AffixType Affix { get { return GetAffixAt(0); } } public void RemoveAffixAt(int index) { RemoveDomChildAt(NodeType.Element, "http://ns.hr-xml.org/2006-02-28", "Affix", index); } public void RemoveAffix() { while (HasAffix()) RemoveAffixAt(0); } public void AddAffix(AffixType newValue) { AppendDomElement("http://ns.hr-xml.org/2006-02-28", "Affix", newValue); } public void InsertAffixAt(AffixType newValue, int index) { InsertDomElementAt("http://ns.hr-xml.org/2006-02-28", "Affix", index, newValue); } public void ReplaceAffixAt(AffixType newValue, int index) { ReplaceDomElementAt("http://ns.hr-xml.org/2006-02-28", "Affix", index, newValue); } #endregion // Affix accessor methods #region Affix collection public AffixCollection MyAffixs = new AffixCollection( ); public class AffixCollection: IEnumerable { PersonNameType parent; public PersonNameType Parent { set { parent = value; } } public AffixEnumerator GetEnumerator() { return new AffixEnumerator(parent); } IEnumerator IEnumerable.GetEnumerator() { return GetEnumerator(); } } public class AffixEnumerator: IEnumerator { int nIndex; PersonNameType parent; public AffixEnumerator(PersonNameType par) { parent = par; nIndex = -1; } public void Reset() { nIndex = -1; } public bool MoveNext() { nIndex++; return(nIndex < parent.AffixCount ); } public AffixType Current { get { return(parent.GetAffixAt(nIndex)); } } object IEnumerator.Current { get { return(Current); } } } #endregion // Affix collection #region AlternateScript accessor methods public static int GetAlternateScriptMinCount() { return 0; } public static int AlternateScriptMinCount { get { return 0; } } public static int GetAlternateScriptMaxCount() { return Int32.MaxValue; } public static int AlternateScriptMaxCount { get { return Int32.MaxValue; } } public int GetAlternateScriptCount() { return DomChildCount(NodeType.Element, "http://ns.hr-xml.org/2006-02-28", "AlternateScript"); } public int AlternateScriptCount { get { return DomChildCount(NodeType.Element, "http://ns.hr-xml.org/2006-02-28", "AlternateScript"); } } public bool HasAlternateScript() { return HasDomChild(NodeType.Element, "http://ns.hr-xml.org/2006-02-28", "AlternateScript"); } public AlternateScriptType NewAlternateScript() { return new AlternateScriptType(domNode.OwnerDocument.CreateElement("AlternateScript", "http://ns.hr-xml.org/2006-02-28")); } public AlternateScriptType GetAlternateScriptAt(int index) { return new AlternateScriptType(GetDomChildAt(NodeType.Element, "http://ns.hr-xml.org/2006-02-28", "AlternateScript", index)); } public XmlNode GetStartingAlternateScriptCursor() { return GetDomFirstChild( NodeType.Element, "http://ns.hr-xml.org/2006-02-28", "AlternateScript" ); } public XmlNode GetAdvancedAlternateScriptCursor( XmlNode curNode ) { return GetDomNextChild( NodeType.Element, "http://ns.hr-xml.org/2006-02-28", "AlternateScript", curNode ); } public AlternateScriptType GetAlternateScriptValueAtCursor( XmlNode curNode ) { if( curNode == null ) throw new Xml.XmlException("Out of range"); else return new AlternateScriptType( curNode ); } public AlternateScriptType GetAlternateScript() { return GetAlternateScriptAt(0); } public AlternateScriptType AlternateScript { get { return GetAlternateScriptAt(0); } } public void RemoveAlternateScriptAt(int index) { RemoveDomChildAt(NodeType.Element, "http://ns.hr-xml.org/2006-02-28", "AlternateScript", index); } public void RemoveAlternateScript() { while (HasAlternateScript()) RemoveAlternateScriptAt(0); } public void AddAlternateScript(AlternateScriptType newValue) { AppendDomElement("http://ns.hr-xml.org/2006-02-28", "AlternateScript", newValue); } public void InsertAlternateScriptAt(AlternateScriptType newValue, int index) { InsertDomElementAt("http://ns.hr-xml.org/2006-02-28", "AlternateScript", index, newValue); } public void ReplaceAlternateScriptAt(AlternateScriptType newValue, int index) { ReplaceDomElementAt("http://ns.hr-xml.org/2006-02-28", "AlternateScript", index, newValue); } #endregion // AlternateScript accessor methods #region AlternateScript collection public AlternateScriptCollection MyAlternateScripts = new AlternateScriptCollection( ); public class AlternateScriptCollection: IEnumerable { PersonNameType parent; public PersonNameType Parent { set { parent = value; } } public AlternateScriptEnumerator GetEnumerator() { return new AlternateScriptEnumerator(parent); } IEnumerator IEnumerable.GetEnumerator() { return GetEnumerator(); } } public class AlternateScriptEnumerator: IEnumerator { int nIndex; PersonNameType parent; public AlternateScriptEnumerator(PersonNameType par) { parent = par; nIndex = -1; } public void Reset() { nIndex = -1; } public bool MoveNext() { nIndex++; return(nIndex < parent.AlternateScriptCount ); } public AlternateScriptType Current { get { return(parent.GetAlternateScriptAt(nIndex)); } } object IEnumerator.Current { get { return(Current); } } } #endregion // AlternateScript collection private void SetCollectionParents() { Myscripts.Parent = this; MyFormattedNames.Parent = this; MyLegalNames.Parent = this; MyGivenNames.Parent = this; MyPreferredGivenNames.Parent = this; MyMiddleNames.Parent = this; MyFamilyNames.Parent = this; MyAffixs.Parent = this; MyAlternateScripts.Parent = this; } } }