本文整理汇总了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>());
}
示例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)
};
}
示例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;
}
示例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));
}
示例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);
}
示例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;
}
示例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"),
};
}
示例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>() );
}
示例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 );
}
}
示例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"));
}
示例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 );
}
示例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,
};
}
示例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);
}
示例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;
}
示例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);
}