Наследование: AspNetEdit.Editor.Persistence.HtmlParsingObject
Пример #1
0
        /// <summary>
        /// Parses a document fragment. Processes all controls and directives and adds them to host.
        /// </summary>
        /// <param name="fragment">The document fragment to parse</param>
        /// <returns>The document with all controls, directives and script blocks replaced by placeholders</returns>
        public void ProcessFragment(string fragment, out Control[] controls, out string substText)
        {
            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");
            }

            rootParsingObject.GetParsedContent(out controls, out substText);
        }
Пример #2
0
		/// <summary>
		/// Parses a document fragment. Processes all controls and directives and adds them to host. 
		/// </summary>
		/// <param name="fragment">The document fragment to parse</param>
		/// <returns>The document with all controls, directives and script blocks replaced by placeholders</returns>
		public void ProcessFragment (string fragment, out Control[] controls, out string substText)
		{
			
			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");
			}
			
			rootParsingObject.GetParsedContent (out controls, out substText);
		}
Пример #3
0
        /// <summary>
        /// Parses a document fragment. Processes all controls and directives and adds them to host. 
        /// </summary>
        /// <param name="fragment">The document fragment to parse</param>
        /// <returns>The document with all controls, directives and script blocks replaced by placeholders</returns>
        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);
        }
Пример #4
0
        /// <summary>
        /// Parses a document fragment. Processes all controls and directives and adds them to host.
        /// </summary>
        /// <param name="fragment">The document fragment to parse</param>
        /// <returns>The document with all controls, directives and script blocks replaced by placeholders</returns>
        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);
        }