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


C# Expression.ToAccessor方法代码示例

本文整理汇总了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;
        }
开发者ID:kingreatwill,项目名称:fubumvc,代码行数:8,代码来源:ModelFixture.cs

示例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);
 }
开发者ID:henninga,项目名称:fubumvc,代码行数:9,代码来源:FubuPageExtensionsTester.cs

示例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;
        }
开发者ID:cprieto,项目名称:fubumvc,代码行数:23,代码来源:PackageManifestXmlReader.cs

示例4: argFor

 private Argument argFor(Expression<Func<ArgumentTarget, object>> property)
 {
     return new Argument(property.ToAccessor().InnerProperty, new ObjectConverter());
 }
开发者ID:nieve,项目名称:fubucore,代码行数:4,代码来源:ArgumentTester.cs

示例5: getFlag

 private BooleanFlag getFlag(Expression<Func<BooleanFlagTarget, object>> expression)
 {
     return new BooleanFlag(expression.ToAccessor().InnerProperty);
 }
开发者ID:nieve,项目名称:fubucore,代码行数:4,代码来源:BooleanFlagTester.cs

示例6: rulesFor

 private IEnumerable<IFieldValidationRule> rulesFor(Expression<Func<AttributeScanningTarget, object>> expression)
 {
     return theRules.RulesFor(expression.ToAccessor());
 }
开发者ID:RyanHauert,项目名称:fubumvc,代码行数:4,代码来源:attribute_scanning_tester.cs

示例7: format

        public string format(Expression<Func<DateTimeFormattingTarget, object>> expression, object value)
        {
            var accessor = expression.ToAccessor();

            return _formatter.GetDisplayForValue(accessor, value);
        }
开发者ID:roend83,项目名称:fubumvc,代码行数:6,代码来源:DateTimeFormatting_import_integration_testing.cs

示例8: handlerFor

 private ITokenHandler handlerFor(Expression<Func<InputModel, object>> expression)
 {
     var property = expression.ToAccessor().InnerProperty;
     return new InputParser().BuildHandler(property);
 }
开发者ID:sbartlett,项目名称:fubumvc,代码行数:5,代码来源:InputParserTester.cs

示例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));
 }
开发者ID:joemcbride,项目名称:fubumvc,代码行数:5,代码来源:LoginScreenFixture.cs

示例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());
        }
开发者ID:taylonr,项目名称:fubuvalidation,代码行数:7,代码来源:ClassValidationRulesTester.cs

示例11: accessorFor

 private Accessor accessorFor(Expression<Func<RemoteFieldModel, object>> expression)
 {
     return expression.ToAccessor();
 }
开发者ID:thunklife,项目名称:fubuvalidation,代码行数:4,代码来源:RemoteFieldRuleTester.cs

示例12: For

 private ElementRequest For(Expression<Func<AddressViewModel, object>> expression)
 {
     return new ElementRequest(new AddressViewModel(), expression.ToAccessor(), null, new Stringifier());
 }
开发者ID:cmdrkeem,项目名称:fubumvc,代码行数:4,代码来源:DefaultHtmlConventionsTester.cs

示例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);
 }
开发者ID:joedivec,项目名称:fubumvc,代码行数:7,代码来源:TagFactoryTester.cs

示例14: accessor

 private Accessor accessor(Expression<Func<TestCsvObject, object>> expression)
 {
     return expression.ToAccessor();
 }
开发者ID:bobpace,项目名称:fubucore,代码行数:4,代码来源:creating_a_value_source_when_all_values_exist.cs

示例15: forProp

 private Flag forProp(Expression<Func<FlagTarget, object>> expression)
 {
     return new Flag(expression.ToAccessor().InnerProperty, new ObjectConverter());
 }
开发者ID:wbinford,项目名称:fubucore,代码行数:4,代码来源:FlagTester.cs


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