本文整理汇总了C#中System.Web.UI.TemplateParser类的典型用法代码示例。如果您正苦于以下问题:C# TemplateParser类的具体用法?C# TemplateParser怎么用?C# TemplateParser使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TemplateParser类属于System.Web.UI命名空间,在下文中一共展示了TemplateParser类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Init
public override void Init(TemplateParser parser, ControlBuilder parentBuilder, Type type, string tagName, string ID, IDictionary attribs)
{
this._contentPlaceHolderID = ID;
if (parser.FInDesigner)
{
base.Init(parser, parentBuilder, type, tagName, ID, attribs);
}
else
{
if (string.IsNullOrEmpty(ID))
{
throw new HttpException(System.Web.SR.GetString("Control_Missing_Attribute", new object[] { "ID", type.Name }));
}
this._templateName = ID;
MasterPageParser parser2 = parser as MasterPageParser;
if (parser2 == null)
{
throw new HttpException(System.Web.SR.GetString("ContentPlaceHolder_only_in_master"));
}
base.Init(parser, parentBuilder, type, tagName, ID, attribs);
if (parser2.PlaceHolderList.Contains(this.Name))
{
throw new HttpException(System.Web.SR.GetString("ContentPlaceHolder_duplicate_contentPlaceHolderID", new object[] { this.Name }));
}
parser2.PlaceHolderList.Add(this.Name);
}
}
示例2: Init
public override void Init(TemplateParser parser, ControlBuilder parentBuilder,
Type type, string tagName, string ID, IDictionary attribs) {
base.Init(parser, parentBuilder, type /*type*/, tagName, ID, attribs);
SetControlType(typeof(string));
}
示例3: Init
/// <devdoc>
/// <para>[To be supplied.]</para>
/// </devdoc>
public override void Init(TemplateParser parser, ControlBuilder parentBuilder,
Type type, string tagName, string ID, IDictionary attribs) {
base.Init(parser, parentBuilder, type /*type*/, tagName, ID, attribs);
//
PropertyInfo propInfo = TargetFrameworkUtil.GetProperty(parentBuilder.ControlType,
tagName, BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static | BindingFlags.IgnoreCase);
SetControlType(propInfo.PropertyType);
Debug.Assert(ControlType != null, "ControlType != null");
BindingFlags bindingFlags = BindingFlags.Public | BindingFlags.Instance;
// Look for an "item" property on the collection that takes in an integer index
// (similar to IList::Item)
propInfo = TargetFrameworkUtil.GetProperty(ControlType, "Item", bindingFlags, types: new Type[] { typeof(int) });
if (propInfo == null) {
// fall-back on finding a non-specific Item property
// a type with overloaded indexed properties will result in an exception however
propInfo = TargetFrameworkUtil.GetProperty(ControlType, "Item", bindingFlags);
}
// If we got one, use it to determine the type of the items
if (propInfo != null)
_itemType = propInfo.PropertyType;
}
示例4: RootBuilder
public RootBuilder (TemplateParser parser)
{
foundry = new AspComponentFoundry ();
line = 1;
fileName = parser.InputFile;
Init (parser, null, null, null, null, null);
}
示例5: Create
// Create a PageParserFilter and initialize it
internal static PageParserFilter Create(PagesSection pagesConfig, VirtualPath virtualPath, TemplateParser parser) {
PageParserFilter pageParserFilter = pagesConfig.CreateControlTypeFilter();
if (pageParserFilter != null)
pageParserFilter.InitializeInternal(virtualPath, parser);
return pageParserFilter;
}
示例6: Init
public override void Init (TemplateParser parser,
ControlBuilder parentBuilder,
Type type,
string tagName,
string id,
IDictionary attribs)
{
if (attribs == null)
throw new ParseException (parser.Location, "Error in ObjectTag.");
attribs.Remove ("runat");
this.id = attribs ["id"] as string;
attribs.Remove ("id");
if (this.id == null || this.id.Trim () == "")
throw new ParseException (parser.Location, "Object tag must have a valid ID.");
scope = attribs ["scope"] as string;
string className = attribs ["class"] as string;
attribs.Remove ("scope");
attribs.Remove ("class");
if (className == null || className.Trim () == "")
throw new ParseException (parser.Location, "Object tag must have 'class' attribute.");
this.type = parser.LoadType (className);
if (this.type == null)
throw new ParseException (parser.Location, "Type " + className + " not found.");
if (attribs ["progid"] != null || attribs ["classid"] != null)
throw new ParseException (parser.Location, "ClassID and ProgID are not supported.");
if (attribs.Count > 0)
throw new ParseException (parser.Location, "Unknown attribute");
}
示例7: Init
public override void Init(TemplateParser parser, ControlBuilder parentBuilder, Type type, string tagName, string id,
IDictionary attribs)
{
base.Init(parser, parentBuilder, type, tagName, id, attribs);
_typeName = (string)attribs["typename"];
}
示例8: Init
public override void Init(TemplateParser parser, ControlBuilder parentBuilder,
Type type, string tagName, string ID, IDictionary attribs) {
// Copy the ID so that it will be available when BuildObject is called
_contentPlaceHolderID = ID;
if (parser.FInDesigner) {
// shortcut for designer
base.Init(parser, parentBuilder, type, tagName, ID, attribs);
return;
}
if (String.IsNullOrEmpty(ID)) {
throw new HttpException(SR.GetString(SR.Control_Missing_Attribute, "ID", type.Name));
}
_templateName = ID;
MasterPageParser masterPageParser = parser as MasterPageParser;
if (masterPageParser == null) {
throw new HttpException(SR.GetString(SR.ContentPlaceHolder_only_in_master));
}
base.Init(parser, parentBuilder, type, tagName, ID, attribs);
if (masterPageParser.PlaceHolderList.Contains(Name))
throw new HttpException(SR.GetString(SR.ContentPlaceHolder_duplicate_contentPlaceHolderID, Name));
masterPageParser.PlaceHolderList.Add(Name);
}
示例9: OverrideAssemblyPrefix
protected override void OverrideAssemblyPrefix (TemplateParser parser, AssemblyBuilder assemblyBuilder)
{
if (parser == null || assemblyBuilder == null)
return;
string newPrefix = assemblyBuilder.OutputFilesPrefix + parser.ClassName + ".";
assemblyBuilder.OutputFilesPrefix = newPrefix;
}
示例10: Init
public override void Init(TemplateParser parser, ControlBuilder parentBuilder, Type type, string tagName, string ID, IDictionary attribs)
{
base.Init(parser, parentBuilder, type, tagName, ID, attribs);
if ((base.InPageTheme && (base.ParentBuilder != null)) && base.ParentBuilder.IsControlSkin)
{
((PageThemeParser) base.Parser).CurrentSkinBuilder = parentBuilder;
}
}
示例11: PreControlBuilderInit
/// <summary>
/// This methood is called before a <see cref="System.Web.UI.ControlBuilder"/> for an element in the markup is initialized.
/// </summary>
/// <param name="controlBuilder">The control builder which is about to be initialized.</param>
/// <param name="parser">The <see cref="System.Web.UI.TemplateParser"/> which was used to parse the markup.</param>
/// <param name="parentBuilder">The parent control builder (typically the builder corresponding to the parent element in the markup).</param>
/// <param name="type">The type of the control that this builder will create.</param>
/// <param name="tagName">The name of the tag to be built.</param>
/// <param name="id">ID of the element in the markup.</param>
/// <param name="attributes">List of attributes of the element in the markup.</param>
/// <param name="additionalState">This is an additional state which can be used to store/retrive data within several methods of <see cref="System.Web.Compilation.ControlBuilderInterceptor"/>.
/// The state is per control builder.</param>
public virtual void PreControlBuilderInit(ControlBuilder controlBuilder,
TemplateParser parser,
ControlBuilder parentBuilder,
Type type,
string tagName,
string id,
IDictionary attributes,
IDictionary additionalState) {
}
示例12: Init
public override void Init (TemplateParser parser,
ControlBuilder parentBuilder,
Type type,
string tagName,
string ID,
IDictionary attribs)
{
throw new NotImplementedException ();
}
示例13: Init
public override void Init (TemplateParser parser,
ControlBuilder parentBuilder,
Type type,
string tagName,
string ID,
IDictionary attribs)
{
// enough?
base.Init (parser, parentBuilder, type, tagName, ID, attribs);
}
示例14: BuildResultNoCompileUserControl
internal BuildResultNoCompileUserControl(Type baseType, TemplateParser parser) : base(baseType, parser)
{
UserControlParser parser2 = (UserControlParser) parser;
OutputCacheParameters outputCacheParameters = parser2.OutputCacheParameters;
if ((outputCacheParameters != null) && (outputCacheParameters.Duration > 0))
{
this._cachingAttribute = new PartialCachingAttribute(outputCacheParameters.Duration, outputCacheParameters.VaryByParam, outputCacheParameters.VaryByControl, outputCacheParameters.VaryByCustom, outputCacheParameters.SqlDependency, parser2.FSharedPartialCaching);
this._cachingAttribute.ProviderName = parser2.Provider;
}
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:10,代码来源:BuildResultNoCompileUserControl.cs
示例15: CompileLiteralTextParser
internal CompileLiteralTextParser(TemplateParser parser,
ControlBuilder parentBuilder,
String fileName,
int lineNumber)
{
_parser = parser;
_parentBuilder = parentBuilder;
_fileName = fileName;
_lineNumber = lineNumber;
}