Mono.Xml.XmlTextWriter.ShiftStateTopLevel C# (CSharp) Method

ShiftStateTopLevel() private method

private ShiftStateTopLevel ( string occured, bool allowAttribute, bool dontCheckXmlDecl, bool isCharacter ) : void
occured string
allowAttribute bool
dontCheckXmlDecl bool
isCharacter bool
return void
		void ShiftStateTopLevel (string occured, bool allowAttribute, bool dontCheckXmlDecl, bool isCharacter)
		{
			switch (state) {
#if NET_2_0
			case WriteState.Error:
#endif
			case WriteState.Closed:
				throw StateError (occured);
			case WriteState.Start:
				if (isCharacter)
					CheckMixedContentState ();
				if (xmldecl_state == XmlDeclState.Auto && !dontCheckXmlDecl)
					OutputAutoStartDocument ();
				state = WriteState.Prolog;
				break;
			case WriteState.Attribute:
				if (allowAttribute)
					break;
				goto case WriteState.Closed;
			case WriteState.Element:
				if (isCharacter)
					CheckMixedContentState ();
				CloseStartElement ();
				break;
			case WriteState.Content:
				if (isCharacter)
					CheckMixedContentState ();
				break;
			}

		}