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

C# UI.BoundPropertyEntry类代码示例

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

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



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

示例1: GetCodeExpression

        public override CodeExpression GetCodeExpression(BoundPropertyEntry entry, object parsedData, ExpressionBuilderContext context)
        {
            if (!entry.Expression.Contains(","))
              {
            throw new ArgumentException("Must include two numbers separated by a comma.");
              }
              else
              {
            // get two numbers
            string[] numbers = entry.Expression.Split(',');
            if (numbers.Length != 2)
            {
              throw new ArgumentException("Only include two numbers");
            }
            else
            {
              int lowerLimit, upperLimit;
              if (Int32.TryParse(numbers[0], out lowerLimit) && Int32.TryParse(numbers[1], out upperLimit))
              {
            CodeTypeReferenceExpression typeRef = new CodeTypeReferenceExpression(this.GetType());
            CodeExpression[] methodParameters = new CodeExpression[2];
            methodParameters[0] = new CodePrimitiveExpression(lowerLimit);
            methodParameters[1] = new CodePrimitiveExpression(upperLimit);

            return new CodeMethodInvokeExpression(typeRef, "GetRandomNumber", methodParameters);
              }
              else
              {
            throw new ArgumentException("Use valid Integers");
              }
            }
              }
        }
开发者ID:bq-wang,项目名称:aspnet,代码行数:33,代码来源:RandomNumberExpressionBuilder.cs


示例2: EvaluateExpression

 public override object EvaluateExpression(object target, BoundPropertyEntry entry, object parsedData, ExpressionBuilderContext context)
 {
     var fields = parsedData as ResourceExpressionFields;
     EnsureResourceProviderFactory();
     IResourceProvider provider = _resourceProviderFactory.CreateGlobalResourceProvider(fields.ClassKey);
     return provider.GetObject(fields.ResourceKey, null);
 }
开发者ID:andriybilas,项目名称:MasterM,代码行数:7,代码来源:ResourceExpressionBuilder.cs


示例3: EvaluateExpression

 public override object EvaluateExpression(object target, BoundPropertyEntry entry, object parsedData, ExpressionBuilderContext context)
 {
     if (target is Control)
     {
         return GetRouteValue(context.TemplateControl.Page, entry.Expression.Trim(), entry.ControlType, entry.Name);
     }
     return null;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:8,代码来源:RouteValueExpressionBuilder.cs


示例4: AddBoundProperty

 private void AddBoundProperty(BoundPropertyEntry entry)
 {
     this.AddEntry(this.BoundPropertyEntriesInternal, entry);
     if (entry.TwoWayBound)
     {
         this.flags[0x400] = true;
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:8,代码来源:ControlBuilder.cs


示例5: GetCodeExpression

 public override CodeExpression GetCodeExpression(BoundPropertyEntry entry, object parsedData, ExpressionBuilderContext context)
 {
     if ((entry.DeclaringType == null) || (entry.PropertyInfo == null))
     {
         return new CodeMethodInvokeExpression(new CodeTypeReferenceExpression(base.GetType()), "GetAppSetting", new CodeExpression[] { new CodePrimitiveExpression(entry.Expression.Trim()) });
     }
     return new CodeMethodInvokeExpression(new CodeTypeReferenceExpression(base.GetType()), "GetAppSetting", new CodeExpression[] { new CodePrimitiveExpression(entry.Expression.Trim()), new CodeTypeOfExpression(entry.DeclaringType), new CodePrimitiveExpression(entry.PropertyInfo.Name) });
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:8,代码来源:AppSettingsExpressionBuilder.cs


示例6: GetCodeExpression

        /// <summary>
        /// Gets the code expression.
        /// </summary>
        /// <param name="entry">
        /// The entry.
        /// </param>
        /// <param name="parsedData">
        /// The parsed data.
        /// </param>
        /// <param name="context">
        /// The context.
        /// </param>
        /// <returns>
        /// A CodeExpression.
        /// </returns>
        public override CodeExpression GetCodeExpression(
            BoundPropertyEntry entry, object parsedData, ExpressionBuilderContext context)
        {
            var typeName = BeforeLast(entry.Expression, ".");
            var propertyName = AfterLast(entry.Expression, ".");

            return new CodePrimitiveExpression(PropertyLength(typeName, propertyName));
        }
开发者ID:CharlesZHENG,项目名称:BlogEngine.NET,代码行数:23,代码来源:LinqLengthExpressionBuilder.cs


示例7: GetCodeExpression

 public override CodeExpression GetCodeExpression(
     BoundPropertyEntry entry,
     object parsedData,
     ExpressionBuilderContext context)
 {
     CodeMethodInvokeExpression ex = new CodeMethodInvokeExpression(new CodeTypeReferenceExpression(typeof(ResourceReader)),
     "GetVal", new CodePrimitiveExpression(entry.Expression.ToString().Trim()));
     return ex;
 }
开发者ID:ratnazone,项目名称:ratna,代码行数:9,代码来源:ResourceReader.cs


示例8: GetCodeExpression

        public override CodeExpression GetCodeExpression(BoundPropertyEntry entry,
            object parsedData, ExpressionBuilderContext context) {

            return new CodeMethodInvokeExpression(
                new CodeTypeReferenceExpression(this.GetType()),
                "GetRouteUrl",
                new CodeThisReferenceExpression(),
                new CodePrimitiveExpression(entry.Expression.Trim()));
        }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:9,代码来源:RouteUrlExpressionBuilder.cs


示例9: GetCodeExpression

        public override CodeExpression GetCodeExpression(BoundPropertyEntry entry, object parsedData, ExpressionBuilderContext context)
        {
            string property = (string) parsedData;

            CodePrimitiveExpression prim = new CodePrimitiveExpression(property);
            CodeExpression[] args = new[] {prim};
            CodeTypeReferenceExpression refType = new CodeTypeReferenceExpression(this.GetType());
            return new CodeMethodInvokeExpression(refType, "GetProperty", args);
        }
开发者ID:dreamer777,项目名称:My.Common,代码行数:9,代码来源:ConfigExpressionBuilder.cs


示例10: GetCodeExpression

 public override CodeExpression GetCodeExpression(BoundPropertyEntry entry, object parsedData, ExpressionBuilderContext context)
 {
     ResourceExpressionFields fields = (ResourceExpressionFields) parsedData;
     if (fields.ClassKey.Length == 0)
     {
         return this.GetPageResCodeExpression(fields.ResourceKey, entry);
     }
     return this.GetAppResCodeExpression(fields.ClassKey, fields.ResourceKey, entry);
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:9,代码来源:ResourceExpressionBuilder.cs


示例11: EvaluateExpression

        public override object EvaluateExpression(object target, BoundPropertyEntry entry,
            object parsedData, ExpressionBuilderContext context) {

            // Target should always be a control
            Control control = target as Control;
            if (control == null) 
                return null;

            return GetRouteValue(context.TemplateControl.Page, entry.Expression.Trim(), entry.ControlType, entry.Name);
        }
开发者ID:krytht,项目名称:DotNetReferenceSource,代码行数:10,代码来源:RouteValueExpressionBuilder.cs


示例12: GetCodeExpression

 /// <summary>
 /// Returns a code expression to evaluate during page execution.
 /// </summary>
 /// <param name="entry">The property name of the object.</param>
 /// <param name="parsedData">The parsed value of the expression.</param>
 /// <param name="context">Properties for the control or page.</param>
 /// <returns>A CodeExpression that invokes a method.</returns>
 public override CodeExpression GetCodeExpression(BoundPropertyEntry entry, object parsedData, ExpressionBuilderContext context)
 {
     var lsr = (LocaleStringResource)parsedData;
     var ex = new CodeMethodInvokeExpression(
         new CodeTypeReferenceExpression(base.GetType()),
         "GetVal",
         new CodePrimitiveExpression(lsr.ResourceName)
     );
     return ex;
 }
开发者ID:robbytarigan,项目名称:ToyHouse,代码行数:17,代码来源:NopResourceExpressionBuilder.cs


示例13: GetCodeExpression

		public override CodeExpression GetCodeExpression (BoundPropertyEntry entry, object parsedData,
								  ExpressionBuilderContext context)
		{			
			Pair connString = parsedData as Pair;
			return new CodeMethodInvokeExpression (
				new CodeTypeReferenceExpression (typeof (ConnectionStringsExpressionBuilder)),
				(bool)connString.Second ? "GetConnectionStringProviderName" : "GetConnectionString",
				new CodeExpression [] {new CodePrimitiveExpression (connString.First)}
			);
		}
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:10,代码来源:ConnectionStringsExpressionBuilder.cs


示例14: GetCodeExpression

 public override CodeExpression GetCodeExpression(BoundPropertyEntry entry, object parsedData, ExpressionBuilderContext context)
 {
     Pair pair = (Pair) parsedData;
     string first = (string) pair.First;
     if ((bool) pair.Second)
     {
         return new CodeMethodInvokeExpression(new CodeTypeReferenceExpression(base.GetType()), "GetConnectionString", new CodeExpression[] { new CodePrimitiveExpression(first) });
     }
     return new CodeMethodInvokeExpression(new CodeTypeReferenceExpression(base.GetType()), "GetConnectionStringProviderName", new CodeExpression[] { new CodePrimitiveExpression(first) });
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:10,代码来源:ConnectionStringsExpressionBuilder.cs


示例15: EvaluateExpression

 public override object EvaluateExpression(object target, BoundPropertyEntry entry, object parsedData, ExpressionBuilderContext context)
 {
     ResourceExpressionFields fields = (ResourceExpressionFields) parsedData;
     IResourceProvider resourceProvider = GetResourceProvider(fields, context.VirtualPathObject);
     if (entry.Type == typeof(string))
     {
         return GetResourceObject(resourceProvider, fields.ResourceKey, null);
     }
     return GetResourceObject(resourceProvider, fields.ResourceKey, null, entry.DeclaringType, entry.PropertyInfo.Name);
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:10,代码来源:ResourceExpressionBuilder.cs


示例16: EvaluateExpression

		// This method is used only from within pages that aren't compiled
		public override object EvaluateExpression (object target, BoundPropertyEntry entry, object parsedData, ExpressionBuilderContext context)
		{
			if (entry == null)
				throw new NullReferenceException (".NET emulation (entry == null)");

			if (context == null)
				throw new NullReferenceException (".NET emulation (context == null)");
			
			return GetRouteUrl (context.TemplateControl, entry.Expression);
		}
开发者ID:nlhepler,项目名称:mono,代码行数:11,代码来源:RouteUrlExpressionBuilder.cs


示例17: GetCodeExpression

		public override CodeExpression GetCodeExpression (BoundPropertyEntry entry, object parsedData, ExpressionBuilderContext context)
		{
			Type type = entry.DeclaringType;
			PropertyDescriptor descriptor = TypeDescriptor.GetProperties(type)[entry.PropertyInfo.Name];
			CodeExpression[] expressionArray = new CodeExpression[3];
			expressionArray[0] = new CodePrimitiveExpression(entry.Expression.Trim());
			expressionArray[1] = new CodeTypeOfExpression(entry.Type);
			expressionArray[2] = new CodePrimitiveExpression(entry.Name);
			return new CodeCastExpression(descriptor.PropertyType, new CodeMethodInvokeExpression(new 
								       CodeTypeReferenceExpression(base.GetType()), "GetAppSetting", expressionArray));
		}
开发者ID:nlhepler,项目名称:mono,代码行数:11,代码来源:AppSettingsExpressionBuilder.cs


示例18: GetCodeExpression

 /// <summary>
 /// When overridden in a derived class, returns code that is used during page execution to obtain the evaluated expression.
 /// </summary>
 /// <param name="entry">The object that represents information about the property bound to by the expression.</param>
 /// <param name="parsedData">The object containing parsed data as returned by <see cref="M:System.Web.Compilation.ExpressionBuilder.ParseExpression(System.String,System.Type,System.Web.Compilation.ExpressionBuilderContext)" />.</param>
 /// <param name="context">Contextual information for the evaluation of the expression.</param>
 /// <returns>
 /// A <see cref="T:System.CodeDom.CodeExpression" /> that is used for property assignment.
 /// </returns>
 public override CodeExpression GetCodeExpression( BoundPropertyEntry entry, object parsedData, ExpressionBuilderContext context )
 {
     // from http://msdn.microsoft.com/en-us/library/system.web.compilation.expressionbuilder.getcodeexpression.aspx
     Type type1 = entry.DeclaringType;
     PropertyDescriptor descriptor1 = TypeDescriptor.GetProperties( type1 )[entry.PropertyInfo.Name];
     CodeExpression[] expressionArray1 = new CodeExpression[3];
     expressionArray1[0] = new CodePrimitiveExpression( entry.Expression.Trim() );
     expressionArray1[1] = new CodeTypeOfExpression( type1 );
     expressionArray1[2] = new CodePrimitiveExpression( entry.Name );
     return new CodeCastExpression( descriptor1.PropertyType, new CodeMethodInvokeExpression( new CodeTypeReferenceExpression( base.GetType() ), "GetEvalData", expressionArray1 ) );
 }
开发者ID:tcavaletto,项目名称:Rock-CentralAZ,代码行数:20,代码来源:FingerprintExpressionBuilder.cs


示例19: GetCodeExpression

		public override CodeExpression GetCodeExpression(BoundPropertyEntry entry, Object parsedData, ExpressionBuilderContext context)
		{
			if (String.IsNullOrEmpty(entry.Expression) == true)
			{
				return (new CodePrimitiveExpression(String.Empty));
			}
			else
			{
				return (new CodeMethodInvokeExpression(new CodeMethodReferenceExpression(new CodeTypeReferenceExpression(this.GetType()), "IsInGroup"), new CodePrimitiveExpression(entry.Expression)));
			}
		}
开发者ID:rjperes,项目名称:DevelopmentWithADot.SPExpressionBuilders,代码行数:11,代码来源:SPIsInGroupExpressionBuilder.cs


示例20: BuildExpression

        internal virtual void BuildExpression(BoundPropertyEntry bpe, ControlBuilder controlBuilder,
            CodeExpression controlReference, CodeStatementCollection methodStatements, CodeStatementCollection statements, CodeLinePragma linePragma, ref bool hasTempObject) {

            CodeExpression codeExpression = GetCodeExpression(bpe,
                bpe.ParsedExpressionData, new ExpressionBuilderContext(controlBuilder.VirtualPath));

            CodeDomUtility.CreatePropertySetStatements(methodStatements, statements,
                controlReference, bpe.Name, bpe.Type,
                codeExpression,
                linePragma);
        }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:11,代码来源:ExpressionBuilder.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# UI.Control类代码示例发布时间:2022-05-26
下一篇:
C# UI.AsyncPostBackTrigger类代码示例发布时间: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