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


C# QueryToken.GetImplementations方法代码示例

本文整理汇总了C#中QueryToken.GetImplementations方法的典型用法代码示例。如果您正苦于以下问题:C# QueryToken.GetImplementations方法的具体用法?C# QueryToken.GetImplementations怎么用?C# QueryToken.GetImplementations使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在QueryToken的用法示例。


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

示例1: FromToken

        internal static MetaExpression FromToken(QueryToken token, Type sourceType)
        {
            var pr = token.GetPropertyRoute();

            if (pr == null)
                return new MetaExpression(sourceType, new DirtyMeta(token.GetImplementations(), new Meta[0]));

            if (!sourceType.IsLite()  && pr.Type.IsLite())
                return new MetaExpression(sourceType, new CleanMeta(token.GetImplementations(), new[] { pr.Add("Entity") }));

            return new MetaExpression(sourceType, new CleanMeta(token.GetImplementations(), new[] { pr }));

            //throw new InvalidOperationException("Impossible to convert {0} to {1}".FormatWith(pr.Type.TypeName(), sourceType.TypeName()));
        }
开发者ID:rondoo,项目名称:framework,代码行数:14,代码来源:MetaExpression.cs

示例2: GetValueControl

        public static Control GetValueControl(QueryToken token, string bindingPath)
        {
            Type type = token.Type;
            if (type.IsLite())
            {
                Implementations implementations = token.GetImplementations().Value;

                Type cleanType = Lite.Extract(type);

                if (EntityKindCache.IsLowPopulation(cleanType) && !implementations.IsByAll)
                {
                    EntityCombo ec = new EntityCombo
                    {
                        Type = type,
                        Implementations = implementations,
                    };

                    ec.SetBinding(EntityCombo.EntityProperty, new Binding
                    {
                        Path = new PropertyPath(bindingPath),
                        NotifyOnValidationError = true,
                        ValidatesOnDataErrors = true,
                        ValidatesOnExceptions = true,
                    });

                    return ec;
                }
                else
                {
                    EntityLine el = new EntityLine
                    {
                        Type = type,
                        Create = false,
                        Implementations = implementations,
                    };

                    el.SetBinding(EntityLine.EntityProperty, new Binding
                    {
                        Path = new PropertyPath(bindingPath),
                        NotifyOnValidationError = true,
                        ValidatesOnDataErrors = true,
                        ValidatesOnExceptions = true
                    });

                    return el;
                }
            }
            else if (type.IsEmbeddedEntity())
            {
                EntityLine el = new EntityLine
                {
                    Type = type,
                    Create = false,
                    Autocomplete = false,
                    Find = false,
                    Implementations = null,
                };

                el.SetBinding(EntityLine.EntityProperty, new Binding
                {
                    Path = new PropertyPath(bindingPath),
                    NotifyOnValidationError = true,
                    ValidatesOnDataErrors = true,
                    ValidatesOnExceptions = true
                });

                return el;
            }
            else
            {
                ValueLine vl = new ValueLine()
                {
                    Type = type,
                    Format = token.Format,
                    UnitText = token.Unit,
                };

                if (type.UnNullify().IsEnum)
                {
                    vl.ItemSource = EnumEntity.GetValues(type.UnNullify()).PreAndNull(type.IsNullable()).ToObservableCollection();
                }

                vl.SetBinding(ValueLine.ValueProperty, new Binding
                {
                    Path = new PropertyPath(bindingPath), //odd
                    NotifyOnValidationError = true,
                    ValidatesOnDataErrors = true,
                    ValidatesOnExceptions = true,
                    Converter = Reflector.IsNumber(type) ? Converters.Identity : null,
                });

                return vl;
            }
        }
开发者ID:nuub666,项目名称:framework,代码行数:94,代码来源:FilterLine.xaml.cs

示例3: QueryTokenTS

 public QueryTokenTS(QueryToken qt, bool recursive)
 {
     this.toString = qt.ToString();
     this.niceName = qt.NiceName();
     this.key = qt.Key;
     this.fullKey = qt.FullKey();
     this.type = new TypeReferenceTS(qt.Type, qt.GetImplementations());
     this.filterType = QueryUtils.TryGetFilterType(qt.Type);
     this.format = qt.Format;
     this.unit = qt.Unit;
     this.typeColor = qt.TypeColor;
     this.niceTypeName = qt.NiceTypeName;
     this.queryTokenType = GetQueryTokenType(qt);
     this.isGroupable = qt.IsGroupable;
     this.propertyRoute = qt.GetPropertyRoute()?.ToString();
     if (recursive && qt.Parent != null)
         this.parent = new QueryTokenTS(qt.Parent, recursive);
 }
开发者ID:signumsoftware,项目名称:framework,代码行数:18,代码来源:QueryController.cs


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