Rolcore.Net.WebMethods.WebMethodsHtmlResponseObject.this C# (CSharp) Method

this() public method

Accesses child WebMethodsHtmlResponseObject instances of the current instance.
public this ( string objectName ) : WebMethodsHtmlResponseObject
objectName string The child instance (using instance.SubObjectName syntax) to access.
return WebMethodsHtmlResponseObject
        public WebMethodsHtmlResponseObject this[string objectName]
        {
            get
            {
                if(string.IsNullOrEmpty(objectName))
                    throw new ArgumentException("objectName is null or empty", "objectName");

                XmlNode nameNode = _Xml.FirstChild;
                if (objectName.Contains(".")) // Parse dots
                {
                    string[] objectNames = objectName.Split('.');
                    for (int i = 0; i < objectNames.Length; i++)
                    {   // Traverse each node, then sub-node, for the one we're seeking
                        nameNode = FindObjectNameNode(objectNames[i], nameNode.ParentNode);
                        if (nameNode == null)
                            throw new KeyNotFoundException(
                                string.Format("Object path {0} not found. {1} does not exist.",
                                    objectName, objectName[i]));
                    }
                }
                else // Simple find
                    nameNode = FindObjectNameNode(objectName, nameNode);

                if (nameNode == null)
                    throw new KeyNotFoundException(string.Format("{0} does not exist.", objectName));

                return new WebMethodsHtmlResponseObject(nameNode.NextSibling.OuterXml);
            }
        }