AspNetEdit.Editor.Persistence.DesignTimeParser.ParseDocument C# (CSharp) Method

ParseDocument() public method

Parses a document fragment. Processes all controls and directives and adds them to host.
public ParseDocument ( string fragment, Control &controls, string &designDocument ) : void
fragment string The document fragment to parse
controls System.Web.UI.Control
designDocument string
return void
        public void ParseDocument(string fragment, out Control[] controls, out string designDocument)
        {
            AspParser parser = InitialiseParser (fragment);

            rootParsingObject = new RootParsingObject(host);
            openObject = rootParsingObject;

            parser.Parse ();

            if (openObject != rootParsingObject) {
                throw new Exception ("The tag " +  openObject.TagID + " was left unclosed");
            }

            object[] objects;
            rootParsingObject.BuildObject(out objects, out designDocument);
            controls = new Control[objects.Length];
            objects.CopyTo (controls, 0);
        }