System.Xml.Xsl.Runtime.XmlQueryOutput.ThrowInvalidStateError C# (CSharp) Method

ThrowInvalidStateError() private method

Throw an invalid state transition error.
private ThrowInvalidStateError ( XPathNodeType constructorType ) : void
constructorType XPathNodeType
return void
        private void ThrowInvalidStateError(XPathNodeType constructorType) {
            switch (constructorType) {
                case XPathNodeType.Element:
                case XPathNodeType.Root:
                case XPathNodeType.Text:
                case XPathNodeType.Comment:
                case XPathNodeType.ProcessingInstruction:
                    throw new XslTransformException(Res.XmlIl_BadXmlState, new string[] {constructorType.ToString(), XmlStateToNodeType(this.xstate).ToString()});

                case XPathNodeType.Attribute:
                case XPathNodeType.Namespace:
                    if (this.depth == 1)
                        throw new XslTransformException(Res.XmlIl_BadXmlState, new string[] {constructorType.ToString(), this.rootType.ToString()});

                    if (this.xstate == XmlState.WithinContent)
                        throw new XslTransformException(Res.XmlIl_BadXmlStateAttr, string.Empty);

                    goto case XPathNodeType.Element;

                default:
                    throw new XslTransformException(Res.XmlIl_BadXmlState, new string[] {"Unknown", XmlStateToNodeType(this.xstate).ToString()});
            }
        }
    }