当前位置: 首页>>代码示例>>C#>>正文


C# UI.TemplateParser类代码示例

本文整理汇总了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);
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:27,代码来源:ContentPlaceHolderBuilder.cs

示例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));
        }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:7,代码来源:StringPropertyBuilder.cs

示例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;
        }
开发者ID:krytht,项目名称:DotNetReferenceSource,代码行数:32,代码来源:CollectionBuilder.cs

示例4: RootBuilder

		public RootBuilder (TemplateParser parser)
		{
			foundry = new AspComponentFoundry ();
			line = 1;
			fileName = parser.InputFile;
			Init (parser, null, null, null, null, null);
		}
开发者ID:jjenki11,项目名称:blaze-chem-rendering,代码行数:7,代码来源:RootBuilder.cs

示例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;
    }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:8,代码来源:PageParserFilter.cs

示例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");
		}
开发者ID:jjenki11,项目名称:blaze-chem-rendering,代码行数:33,代码来源:ObjectTagBuilder.cs

示例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"];
        }
开发者ID:mhinze,项目名称:msmvc,代码行数:7,代码来源:ViewTypeControlBuilder.cs

示例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);
        }
开发者ID:krytht,项目名称:DotNetReferenceSource,代码行数:30,代码来源:ContentPlaceHolder.cs

示例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;
		}
开发者ID:nlhepler,项目名称:mono,代码行数:8,代码来源:ThemeDirectoryBuildProvider.cs

示例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;
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:8,代码来源:TemplateBuilder.cs

示例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) { 
 }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:21,代码来源:ControlBuilderInterceptor.cs

示例12: Init

		public override void Init (TemplateParser parser,
					  ControlBuilder parentBuilder,
					  Type type,
					  string tagName,
					  string ID,
					  IDictionary attribs)
		{
			throw new NotImplementedException ();
		}
开发者ID:carrie901,项目名称:mono,代码行数:9,代码来源:TemplateBuilder.jvm.cs

示例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);
		}
开发者ID:jjenki11,项目名称:blaze-chem-rendering,代码行数:10,代码来源:TemplateBuilder.cs

示例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;
 }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:10,代码来源:CompileLiteralTextParser.cs


注:本文中的System.Web.UI.TemplateParser类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。