當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。