本文整理汇总了C#中System.Linq.Expressions.Expression.ToAccessor方法的典型用法代码示例。如果您正苦于以下问题:C# Expression.ToAccessor方法的具体用法?C# Expression.ToAccessor怎么用?C# Expression.ToAccessor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Linq.Expressions.Expression
的用法示例。
在下文中一共展示了Expression.ToAccessor方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: setter
private IGrammar setter(Expression<Func<AuthenticationSettings, object>> property)
{
var accessor = property.ToAccessor();
var grammar = new SetPropertyGrammar(accessor.InnerProperty);
grammar.CellModifications.DefaultValue(accessor.GetValue(new AuthenticationSettings()).ToString());
return grammar;
}
示例2: SetUp
public void SetUp()
{
_page = MockRepository.GenerateStub<IFubuPage<ViewModel>>();
_convention = MockRepository.GenerateStub<IElementNamingConvention>();
_expression = (x=>x.Property);
_accessor = _expression.ToAccessor();
_convention.Stub(c => c.GetName(Arg<Type>.Is.Equal(typeof (ViewModel)), Arg<Accessor>.Is.Equal(_accessor))).Return("name");
_page.Stub(p => p.Get<IElementNamingConvention>()).Return(_convention);
}
示例3: buildFileSet
private FileSet buildFileSet(XmlDocument document, Expression<Func<PackageManifest, object>> expression)
{
var node = document.DocumentElement.SelectSingleNode(expression.ToAccessor().Name) as XmlElement;
var fileSet = new FileSet();
if (node == null) return fileSet;
if (node.HasAttribute("Include"))
{
fileSet.Include = node.GetAttribute("Include");
}
if (node.HasAttribute("Exclude"))
{
fileSet.Exclude = node.GetAttribute("Exclude");
}
var deepSearchNode = node.SelectSingleNode("DeepSearch");
if (deepSearchNode != null) fileSet.DeepSearch = bool.Parse(deepSearchNode.InnerText);
return fileSet;
}
示例4: argFor
private Argument argFor(Expression<Func<ArgumentTarget, object>> property)
{
return new Argument(property.ToAccessor().InnerProperty, new ObjectConverter());
}
示例5: getFlag
private BooleanFlag getFlag(Expression<Func<BooleanFlagTarget, object>> expression)
{
return new BooleanFlag(expression.ToAccessor().InnerProperty);
}
示例6: rulesFor
private IEnumerable<IFieldValidationRule> rulesFor(Expression<Func<AttributeScanningTarget, object>> expression)
{
return theRules.RulesFor(expression.ToAccessor());
}
示例7: format
public string format(Expression<Func<DateTimeFormattingTarget, object>> expression, object value)
{
var accessor = expression.ToAccessor();
return _formatter.GetDisplayForValue(accessor, value);
}
示例8: handlerFor
private ITokenHandler handlerFor(Expression<Func<InputModel, object>> expression)
{
var property = expression.ToAccessor().InnerProperty;
return new InputParser().BuildHandler(property);
}
示例9: findElement
// TODO (checked) -- this needs to be in ScreenFixture, Serenity
protected IWebElement findElement(Expression<Func<LoginRequest, object>> property)
{
return Driver.FindElement(By.Name(property.ToAccessor().Name));
}
示例10: rulesFor
private IEnumerable<IFieldValidationRule> rulesFor(Expression<Func<ClassValidationRulesTarget, object>> expression)
{
var registry = new FieldRulesRegistry(new IFieldValidationSource[0], new TypeDescriptorCache());
registry.Import(theRules);
return registry.RulesFor(typeof (ClassValidationRulesTarget)).RulesFor(expression.ToAccessor());
}
示例11: accessorFor
private Accessor accessorFor(Expression<Func<RemoteFieldModel, object>> expression)
{
return expression.ToAccessor();
}
示例12: For
private ElementRequest For(Expression<Func<AddressViewModel, object>> expression)
{
return new ElementRequest(new AddressViewModel(), expression.ToAccessor(), null, new Stringifier());
}
示例13: For
private HtmlTag For(Expression<Func<Address, object>> expression)
{
Accessor accessor = expression.ToAccessor();
var request = new ElementRequest(address, accessor, null);
request.ElementId = accessor.Name;
return factory.Build(request);
}
示例14: accessor
private Accessor accessor(Expression<Func<TestCsvObject, object>> expression)
{
return expression.ToAccessor();
}
示例15: forProp
private Flag forProp(Expression<Func<FlagTarget, object>> expression)
{
return new Flag(expression.ToAccessor().InnerProperty, new ObjectConverter());
}