• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# UI.TemplateParser类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中System.Web.UI.TemplateParser的典型用法代码示例。如果您正苦于以下问题:C# TemplateParser类的具体用法?C# TemplateParser怎么用?C# TemplateParser使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



TemplateParser类属于System.Web.UI命名空间,在下文中一共展示了TemplateParser类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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


示例16: 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);
			placeHolderID = attribs ["ContentPlaceHolderID"] as string;
		}
开发者ID:jjenki11,项目名称:blaze-chem-rendering,代码行数:10,代码来源:ContentControlBuilder.cs


示例17: Init

        public override void Init(TemplateParser parser, ControlBuilder parentBuilder, Type type, string tagName, string id, System.Collections.IDictionary attribs)
        {
            string dataItemTypeName = attribs["DataItemType"] as string;
            Type dataItemType = typeof(object);
            if (!string.IsNullOrEmpty(dataItemTypeName))
            {
                dataItemType = BuildManager.GetType(dataItemTypeName, true);
            }
            Type repeaterFakeType = new RepeaterFakeType(dataItemType);

            base.Init(parser, parentBuilder, repeaterFakeType, tagName, id, attribs);
        }
开发者ID:rajayaseelan,项目名称:mysoftsolution,代码行数:12,代码来源:RepeaterControlBuilder.cs


示例18: Init

 public override void Init(TemplateParser parser, ControlBuilder parentBuilder, Type type, string tagName, string id, IDictionary attribs)
 {
     // Nasty hack to get internal property value.
     TypedGridViewControlBuilder typedGridViewControlBuilder = parentBuilder.GetValue("ParentBuilder") as TypedGridViewControlBuilder;
     Type fakeType = type;
     if (typedGridViewControlBuilder != null)
     {
         Type dataItemType = typedGridViewControlBuilder.DataItemType;
         if (dataItemType != null)
             fakeType = new TypedTemplateFieldFakeType(dataItemType);
     }
     base.Init(parser, parentBuilder, fakeType, tagName, id, attribs);
 }
开发者ID:dpawatts,项目名称:zeus,代码行数:13,代码来源:TypedTemplateFieldControlBuilder.cs


示例19: 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);
     PropertyInfo info = TargetFrameworkUtil.GetProperty(parentBuilder.ControlType, tagName, BindingFlags.Public | BindingFlags.Static | BindingFlags.Instance | BindingFlags.IgnoreCase);
     base.SetControlType(info.PropertyType);
     BindingFlags bindingAttr = BindingFlags.Public | BindingFlags.Instance;
     info = TargetFrameworkUtil.GetProperty(base.ControlType, "Item", bindingAttr, null, null, new Type[] { typeof(int) }, null);
     if (info == null)
     {
         info = TargetFrameworkUtil.GetProperty(base.ControlType, "Item", bindingAttr);
     }
     if (info != null)
     {
         this._itemType = info.PropertyType;
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:16,代码来源:CollectionBuilder.cs


示例20: Init

		public override void Init(TemplateParser parser, ControlBuilder parentBuilder, Type type, string tagName, string id, IDictionary attribs)
		{
			IDictionary attributes = new Hashtable(attribs.Count);

			foreach(DictionaryEntry entry in attribs)
			{
				var attributeName = (string)entry.Key;

				if(string.Equals(attributeName, "ID", StringComparison.OrdinalIgnoreCase))
				{
					if(string.IsNullOrEmpty(id))
						id = (string)entry.Value;

					if(Environment.OSVersion.Platform == PlatformID.Unix ||
					   Environment.OSVersion.Platform == PlatformID.MacOSX)
					{
						attributes["$ID"] = id;
						continue;
					}
				}

				var property = type.GetProperty(attributeName, (BindingFlags.Instance | BindingFlags.Public | BindingFlags.IgnoreCase));

				if(property != null && property.IsDefined(typeof(BindableAttribute), true))
				{
					var attribute = Attribute.GetCustomAttribute(property, typeof(PropertyMetadataAttribute), true);

					if(attribute != null)
					{
						if(((PropertyMetadataAttribute)attribute).Bindable)
							attributeName = "$" + attributeName;
					}
					else
					{
						attribute = Attribute.GetCustomAttribute(property, typeof(BindableAttribute), true);

						if(attribute != null && ((BindableAttribute)attribute).Bindable)
							attributeName = "$" + attributeName;
					}
				}

				attributes[attributeName] = entry.Value;
			}

			base.Init(parser, parentBuilder, type, tagName, id, attributes);
		}
开发者ID:Flagwind,项目名称:Zongsoft.Web,代码行数:46,代码来源:DataBoundControlBuilder.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# UI.UpdatePanel类代码示例发布时间:2022-05-26
下一篇:
C# UI.StateBag类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap