/// <summary> /// Creates a ParsingObject as a child of this one, and returns it. /// </summary> public virtual ParsingObject CreateChildParsingObject(ILocation location, string tagid, TagAttributes attributes) { string[] str = tagid.Split(':'); //html tags //TODO: check for valid tags? if (str.Length == 1) { if (attributes.IsRunAtServer() && (0 == string.Compare("form", tagid))) { return(new ServerFormParsingObject(location.PlainText, tagid, this)); } return(new HtmlParsingObject(location.PlainText, tagid, this)); } //fall through to server tags if (str.Length != 2) { throw new ParseException(location, "Server tag name is not of form prefix:name"); } Type tagType = WebFormReferenceManager.GetObjectType(str[0], str[1]); if (tagType == null) { throw new ParseException(location, "The tag " + tagid + "has not been registered"); } return(new ServerObjectParsingObject(tagType, attributes.GetDictionary(null), tagid, this)); }
public override ParsingObject CreateChildParsingObject(ILocation location, string tagid, TagAttributes attributes) { switch (mode) { case ParseChildrenMode.DefaultProperty: //oops, we didn't need to tokenise this. innerText += location.PlainText; //how do we get end tag? throw new NotImplementedException("Inner default properties that look like tags have not been implemented yet."); case ParseChildrenMode.DefaultEncodedProperty: innerText += System.Web.HttpUtility.HtmlDecode(location.PlainText); //how do we get end tag? throw new NotImplementedException("Inner default properties that look like tags have not been implemented yet."); case ParseChildrenMode.Controls: //html tags if (tagid.IndexOf(':') == -1) { return(new HtmlParsingObject(location.PlainText, tagid, this)); } goto case ParseChildrenMode.DefaultCollectionProperty; case ParseChildrenMode.DefaultCollectionProperty: string[] str = tagid.Split(':'); if (str.Length != 2) { throw new ParseException(location, "Server tag name is not of form prefix:name"); } Type tagType = WebFormReferenceManager.GetObjectType(str[0], str[1]); if (tagType == null) { throw new ParseException(location, "The tag " + tagid + "has not been registered"); } return(new ServerObjectParsingObject(tagType, attributes.GetDictionary(null), tagid, this)); case ParseChildrenMode.Properties: throw new NotImplementedException("Multiple child properties have not yet been implemented."); } throw new ParseException(location, "Unexpected state encountered: "); }
/*TODO: if only we could get the controlbuilder to build the control like in .NET 2's builder.BuildObject () * ControlBuilder builder = ControlBuilder.CreateBuilderFromType (null, b, tagType, str[1], (string) attributes["ID"], attributes.GetDictionary (null), currentLocation.BeginLine, currentLocation.Filename); * * if (builder == null) * throw new ParseException (currentLocation, "Could not create builder for type " + tagType); * builder.SetServiceProvider (host); * Control c = builder.BuildObject (); */ void ProcessDirective(string tagid, TagAttributes attributes) { string placeholder = document.AddDirective(tagid, attributes.GetDictionary(null)); openObject.AddText(placeholder); }
/*TODO: if only we could get the controlbuilder to build the control like in .NET 2's builder.BuildObject () ControlBuilder builder = ControlBuilder.CreateBuilderFromType (null, b, tagType, str[1], (string) attributes["ID"], attributes.GetDictionary (null), currentLocation.BeginLine, currentLocation.Filename); if (builder == null) throw new ParseException (currentLocation, "Could not create builder for type " + tagType); builder.SetServiceProvider (host); Control c = builder.BuildObject (); */ void ProcessDirective(string tagid, TagAttributes attributes) { string placeholder = document.AddDirective (tagid, attributes.GetDictionary (null)); openObject.AddText (placeholder); }
/// <summary> /// Creates a ParsingObject as a child of this one, and returns it. /// </summary> public virtual ParsingObject CreateChildParsingObject(ILocation location, string tagid, TagAttributes attributes) { string[] str = tagid.Split(':'); //html tags //TODO: check for valid tags? if (str.Length == 1) { if (attributes.IsRunAtServer () && (0 == string.Compare ("form", tagid))) return new ServerFormParsingObject (location.PlainText, tagid, this); return new HtmlParsingObject (location.PlainText, tagid, this); } //fall through to server tags if (str.Length != 2) throw new ParseException (location, "Server tag name is not of form prefix:name"); Type tagType = WebFormReferenceManager.GetObjectType(str[0], str[1]); if (tagType == null) throw new ParseException(location, "The tag " + tagid + "has not been registered"); return new ServerObjectParsingObject (tagType, attributes.GetDictionary(null), tagid, this); }
public override ParsingObject CreateChildParsingObject(ILocation location, string tagid, TagAttributes attributes) { switch (mode) { case ParseChildrenMode.DefaultProperty: //oops, we didn't need to tokenise this. innerText += location.PlainText; //how do we get end tag? throw new NotImplementedException ("Inner default properties that look like tags have not been implemented yet."); case ParseChildrenMode.DefaultEncodedProperty: innerText += System.Web.HttpUtility.HtmlDecode (location.PlainText); //how do we get end tag? throw new NotImplementedException ("Inner default properties that look like tags have not been implemented yet."); case ParseChildrenMode.Controls: //html tags if (tagid.IndexOf(':') == -1) return new HtmlParsingObject (location.PlainText, tagid, this); goto case ParseChildrenMode.DefaultCollectionProperty; case ParseChildrenMode.DefaultCollectionProperty: string[] str = tagid.Split(':'); if (str.Length != 2) throw new ParseException (location, "Server tag name is not of form prefix:name"); Type tagType = WebFormReferenceManager.GetObjectType(str[0], str[1]); if (tagType == null) throw new ParseException(location, "The tag " + tagid + "has not been registered"); return new ServerObjectParsingObject (tagType, attributes.GetDictionary(null), tagid, this); case ParseChildrenMode.Properties: throw new NotImplementedException ("Multiple child properties have not yet been implemented."); } throw new ParseException (location, "Unexpected state encountered: "); }