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


C# BuilderContext类代码示例

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


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

示例1: SetUp

            public void SetUp( BuilderContext obj )
            {
//                var routes = this._junctionEdge.EdgeBuilder.Routes;
//                var convertedRoutes = this.ConvertRoutes( routes, obj, this._junctionEdge ).ToArray();
                // TODO Remove Routes from this element
                this._junctionEdge.Routes = new StandardRoutes( Enumerable.Empty<BuildRoute>());
            }
开发者ID:Klakier,项目名称:Road-Traffic-Simualator,代码行数:7,代码来源:JunctionEdgeBuilder.cs

示例2: Build

		public override object Build(BuilderContext context)
		{
			return new IgnoreRouteInternal(context.Builtin.Properties.GetRawValue("url"))
			{
				Constraints = this.ResolveValues(context.Builtin.Properties.GetValue<string>("constraints"), context.Builtin)
			};
		}
开发者ID:jonfee,项目名称:Zongsoft.Web.Plugins,代码行数:7,代码来源:RouteIgnoreBuilder.cs

示例3: Build

		public override object Build(BuilderContext context)
		{
			Builtin builtin = context.Builtin;

			var node = new Zongsoft.Web.Controls.TreeViewNode(builtin.Name, builtin.Properties.GetValue<string>("text"))
			{
				Icon = builtin.Properties.GetValue<string>("icon"),
				Text = builtin.Properties.GetValue<string>("text"),
				ToolTip = builtin.Properties.GetValue<string>("tooltip"),
				Description = builtin.Properties.GetValue<string>("description"),
				NavigateUrl = builtin.Properties.GetValue<string>("url") ?? string.Empty,
				NavigateCssClass = builtin.Properties.GetValue<string>("navigateCssClass"),
				CssClass = builtin.Properties.GetValue<string>("cssClass"),
				ListCssClass = builtin.Properties.GetValue<string>("listCssClass"),
				Selected = builtin.Properties.GetValue<bool>("selected", false),
				Visible = builtin.Properties.GetValue<bool>("visible", true),
			};

			node.Image.CssClass = builtin.Properties.GetValue<string>("image-cssClass");
			node.Image.Dimension = builtin.Properties.GetValue<Zongsoft.Web.Controls.Dimension>("image-dimension", Controls.Dimension.None);
			node.Image.ImageUrl = builtin.Properties.GetValue<string>("image-url");
			node.Image.NavigateUrl = builtin.Properties.GetValue<string>("image-navigateUrl");
			node.Image.Placeholder = builtin.Properties.GetValue<string>("image-placeholder");

			//返回构建的目标对象
			return node;
		}
开发者ID:Zongsoft,项目名称:Zongsoft.Web.Plugins,代码行数:27,代码来源:TreeViewNodeBuilder.cs

示例4: TestNoPoliciesReturnsNull

		public void TestNoPoliciesReturnsNull()
		{
			PolicyList policies = new PolicyList();
			BuilderContext context = new BuilderContext(null, null, policies);

			Assert.IsNull(context.Policies.Get<IBuilderPolicy>(typeof (object), null));
		}
开发者ID:ChiangHanLung,项目名称:PIC_VDS,代码行数:7,代码来源:BuilderContextFixture.cs

示例5: OnBuilt

		protected override void OnBuilt(BuilderContext context)
		{
			Control itemControl = context.Result as Control;

			if(itemControl == null)
				return;

			itemControl.ID = context.Builtin.Name;
			Control ownerControl = context.Owner as Control ?? context.Parameter as Control;

			if(ownerControl == null)
				return;

			string index = context.Builtin.Properties.GetValue<string>("index");

			if(!string.IsNullOrWhiteSpace(index))
			{
				for(int i = 0; i < ownerControl.Controls.Count; i++)
				{
					if(string.Equals(ownerControl.Controls[i].ID, index, StringComparison.OrdinalIgnoreCase))
					{
						ownerControl.Controls.AddAt(i, itemControl);
						return;
					}
				}
			}

			ownerControl.Controls.Add(itemControl);
		}
开发者ID:Zongsoft,项目名称:Zongsoft.Web.Plugins,代码行数:29,代码来源:ControlBuilder.cs

示例6: BuildExpressionQuery

 /// <summary>
 /// Builds the ExpressionQuery:
 /// - parses Expressions and builds row creator
 /// - checks names unicity
 /// </summary>
 /// <param name="expressions"></param>
 /// <param name="queryContext"></param>
 /// <returns></returns>
 protected virtual ExpressionQuery BuildExpressionQuery(ExpressionChain expressions, QueryContext queryContext)
 {
     var builderContext = new BuilderContext(queryContext);
     BuildExpressionQuery(expressions, builderContext);
     CheckTablesAlias(builderContext);
     CheckParametersAlias(builderContext);
     return builderContext.ExpressionQuery;
 }
开发者ID:TheRealDuckboy,项目名称:mono-soc-2008,代码行数:16,代码来源:QueryBuilder.cs

示例7: Build

		public override object Build(BuilderContext context)
		{
			return new HtmlForm()
			{
				Action = context.Builtin.Properties.GetValue<string>("action"),
				Method = context.Builtin.Properties.GetValue<string>("method"),
			};
		}
开发者ID:Zongsoft,项目名称:Zongsoft.Web.Plugins,代码行数:8,代码来源:HtmlFormBuilder.cs

示例8: SetUp

            public void SetUp(BuilderContext obj)
            {
//                this._lane.LaneCornerBuild.Routes.CalculateProbabilities();
//                var routes = this._lane.LaneCornerBuild.Routes;
//                var convertedRoutes = this.ConvertRoutes( routes, obj, this._lane ).ToArray();
                // TODO Remove Routes from this element
                this._lane.Routes = new StandardRoutes( Enumerable.Empty<BuildRoute>() );
            }
开发者ID:Klakier,项目名称:Road-Traffic-Simualator,代码行数:8,代码来源:LaneCornerBuilder.cs

示例9: Connect

 public void Connect( BuilderContext builderContext )
 {
     this._junctionEdge.Junction = builderContext.GetObject<LaneJunction>( this._junctionEdge.EdgeBuilder.Connector.JunctionEdge.Parent );
     if ( this._junctionEdge.EdgeBuilder.Connector.Edge != null )
     {
         this._junctionEdge.Next = builderContext.GetObject<IRoadElement>( this._junctionEdge.EdgeBuilder.Connector.Edge.Parent );
     }
 }
开发者ID:Klakier,项目名称:Road-Traffic-Simualator,代码行数:8,代码来源:JunctionEdgeBuilder.cs

示例10: CanSetPoliciesUsingTheContext

		public void CanSetPoliciesUsingTheContext()
		{
			BuilderContext context = new BuilderContext(null, null, null);
			MockCreationPolicy policy = new MockCreationPolicy();

			context.Policies.Set<IBuilderPolicy>(policy, typeof (object), "foo");

			Assert.AreSame(policy, context.Policies.Get<IBuilderPolicy>(typeof (object), "foo"));
		}
开发者ID:ChiangHanLung,项目名称:PIC_VDS,代码行数:9,代码来源:BuilderContextFixture.cs

示例11: Connect

 public void Connect( BuilderContext builderContext )
 {
     var connectedLane = this._carsRemover.CarsRemoverBuilder.Connector.OpositeEdge;
     if ( connectedLane == null )
     {
         return;
     }
     this._carsRemover.Lane = builderContext.GetObject<Lane>( connectedLane.Parent );
 }
开发者ID:Klakier,项目名称:Road-Traffic-Simualator,代码行数:9,代码来源:CarsRemoverBuilder.cs

示例12: ConvertRoute

 private BuildRoute ConvertRoute( BuildMode.Controls.Route route, BuilderContext context, IRoadElement routeOwner )
 {
     return new BuildRoute( this.GetRouteElements( route, context, routeOwner ) )
                {
                    Probability = route.Probability,
                    Name = route.Name,
                    Owner = routeOwner,
                };
 }
开发者ID:Klakier,项目名称:Road-Traffic-Simualator,代码行数:9,代码来源:BuildRoutesToSimulationRoutesConverter.cs

示例13: EntitySetExpression

 internal EntitySetExpression(TableExpression sourceTable, MemberInfo memberInfo, Type entitySetType, BuilderContext builderContext, ExpressionDispatcher dispatcher)
     : base(ExpressionType, entitySetType)
 {
     this.builderContext = builderContext;
     this.EntitySetType = entitySetType;
     this.dispatcher = dispatcher;
     this.sourceTable = sourceTable;
     this.memberInfo = memberInfo;
     ParseExpression(sourceTable);
 }
开发者ID:nlhepler,项目名称:mono,代码行数:10,代码来源:EntitySetExpression.cs

示例14: ConvertToSimulationMode

        public IEnumerable<IRoadElement> ConvertToSimulationMode( IEnumerable<IControl> controls )
        {
            Contract.Requires( controls != null );
            var context = new BuilderContext( this._roadInformationFactory );
            controls.Where( c => c != null )
                .SelectMany( this.GetAction )
                .OrderBy( a => a.Order )
                .ForEach( a => a.Action( context ) );

            return context.Elements;
        }
开发者ID:Klakier,项目名称:Road-Traffic-Simualator,代码行数:11,代码来源:Builder.cs

示例15: TestSettingAndRetrievePolicy

		public void TestSettingAndRetrievePolicy()
		{
			PolicyList policies = new PolicyList();
			MockCreationPolicy policy = new MockCreationPolicy();

			policies.Set<IBuilderPolicy>(policy, typeof (object), null);
			BuilderContext context = new BuilderContext(null, null, policies);

			IBuilderPolicy outPolicy = context.Policies.Get<IBuilderPolicy>(typeof (object), null);

			Assert.IsNotNull(outPolicy);
			Assert.AreSame(policy, outPolicy);
		}
开发者ID:ChiangHanLung,项目名称:PIC_VDS,代码行数:13,代码来源:BuilderContextFixture.cs


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