// Token: 0x17001B5E RID: 7006
 internal AccessorInfo this[SourceValueType sourceValueType, Type type, string name]
 {
     get
     {
         if (type == null || name == null)
         {
             return(null);
         }
         AccessorInfo accessorInfo = (AccessorInfo)this._table[new AccessorTable.AccessorTableKey(sourceValueType, type, name)];
         if (accessorInfo != null)
         {
             accessorInfo.Generation = this._generation;
         }
         return(accessorInfo);
     }
     set
     {
         if (type != null && name != null)
         {
             value.Generation = this._generation;
             this._table[new AccessorTable.AccessorTableKey(sourceValueType, type, name)] = value;
             if (!this._cleanupRequested)
             {
                 this.RequestCleanup();
             }
         }
     }
 }
        public IReadOnlyList <IndexerParamInfo> paramList; // params for indexer

        public SourceValueInfo(SourceValueType t, DrillIn d, string n)
        {
            type      = t;
            drillIn   = d;
            name      = n;
            paramList = null;
        }
 // Token: 0x06008D79 RID: 36217 RVA: 0x00259734 File Offset: 0x00257934
 public AccessorTableKey(SourceValueType sourceValueType, Type type, string name)
 {
     Invariant.Assert(type != null && type != null);
     this._sourceValueType = sourceValueType;
     this._type            = type;
     this._name            = name;
 }
 public SourceValueInfo(SourceValueType t, DrillIn d, IReadOnlyList <IndexerParamInfo> list)
 {
     type      = t;
     drillIn   = d;
     name      = null;
     paramList = list;
 }
Beispiel #5
0
        /// <summary>
        /// 刷新
        /// </summary>
        public void Refresh()
        {
            if (SourceValue != null && SourceValueType != null)
            {
                switch (DisplayFieldType)
                {
                case "Property":
                    var p = SourceValueType.GetProperty(DisplayField);
                    DisplayValue = p.GetValue(SourceValue, null);
                    break;

                case "Method":
                    var m = SourceValueType.GetMethod(DisplayField);
                    DisplayValue = m.Invoke(SourceValue, null);
                    break;
                }
                switch (ValueFieldType)
                {
                case "Property":
                    var p = SourceValueType.GetProperty(ValueField);
                    Value = p.GetValue(SourceValue, null);
                    break;

                case "Method":
                    var m = SourceValueType.GetMethod(ValueField);
                    Value = m.Invoke(SourceValue, null);
                    break;
                }
            }
        }
Beispiel #6
0
 public SourceValueInfo(SourceValueType t, DrillIn d, FrugalObjectList <IndexerParamInfo> list)
 {
     type         = t;
     drillIn      = d;
     name         = null;
     paramList    = list;
     propertyName = null;
 }
 public ExcelColumn(string columnName, string valueFieldName, SourceValueType valueType, string path, int depth)
 {
     columnName     = columnName;
     ValueFieldName = valueFieldName;
     ValueType      = valueType;
     Path           = path;
     Depth          = depth;
 }
 public SourceValueInfo(SourceValueType t, DrillIn d, FrugalObjectList<IndexerParamInfo> list)
 {
     type = t;
     drillIn = d;
     name = null;
     paramList = list;
     propertyName = null;
 }
 // Token: 0x06007620 RID: 30240 RVA: 0x0021ABBF File Offset: 0x00218DBF
 public SourceValueInfo(SourceValueType t, DrillIn d, string n)
 {
     this.type         = t;
     this.drillIn      = d;
     this.name         = n;
     this.paramList    = null;
     this.propertyName = null;
 }
        public string propertyName;         // the real name - could be "Width"

        public SourceValueInfo(SourceValueType t, DrillIn d, string n)
        {
            type = t;
            drillIn = d;
            name = n;
            paramList = null;
            propertyName = null;
        }
Beispiel #11
0
        // map (SourceValueType, type, name) to (accessor, propertyType, args)
        internal AccessorInfo this[SourceValueType sourceValueType, Type type, string name]
        {
            get
            {
                if (type == null || name == null)
                {
                    return(null);
                }

                AccessorInfo info = (AccessorInfo)_table[new AccessorTableKey(sourceValueType, type, name)];

                if (info != null)
                {
#if DEBUG
                    // record the age of cache hits
                    int age = _generation - info.Generation;

                    if (age >= _ages.Length)
                    {
                        int[] newAges = new int[2 * age];
                        _ages.CopyTo(newAges, 0);
                        _ages = newAges;
                    }

                    ++_ages[age];
                    ++_hits;
#endif
                    info.Generation = _generation;
                }
#if DEBUG
                else
                {
                    ++_misses;
                }
#endif
                return(info);
            }
            set
            {
                if (type != null && name != null)
                {
                    value.Generation = _generation;
                    _table[new AccessorTableKey(sourceValueType, type, name)] = value;

                    if (!_cleanupRequested)
                    {
                        RequestCleanup();
                    }
                }
            }
        }
Beispiel #12
0
        public override LambdaExpression GetBindExpression()
        {
            bool sourceIsQueryable    = SourceValueType.IsGenericQueryable();
            bool targetIsQueryable    = TargetValueType.IsGenericQueryable();
            var  selectMethod         = sourceIsQueryable ? MethodFinder.GetQuerybleSelect <TSourceValueItem, TTargetValueItem>() : MethodFinder.GetEnumerableSelect <TSourceValueItem, TTargetValueItem>();
            var  callSelectExpression = Expression.Call(selectMethod, this.SourceExpression.Body, GetAssignExpression());
            var  toResultExpression   = GetResultExpression(callSelectExpression, sourceIsQueryable, targetIsQueryable);
            // 需要处理source为null的情况
            var resultExpression = Expression.Condition(
                Expression.Equal(this.SourceExpression.Body, Expression.Constant(null))
                , Expression.Constant(null, this.TargetValueType), toResultExpression);

            return(Expression.Lambda(resultExpression, this.SourceExpression.Parameters.First()));
        }
Beispiel #13
0
        // map (SourceValueType, type, name) to (accessor, propertyType, args)
        internal AccessorInfo this[SourceValueType sourceValueType, Type type, string name]
        {
            get
            {
                if (type == null || name == null)
                    return null;

                AccessorInfo info = (AccessorInfo)_table[new AccessorTableKey(sourceValueType, type, name)];

                if (info != null)
                {
#if DEBUG
                    // record the age of cache hits
                    int age = _generation - info.Generation;

                    if (age >= _ages.Length)
                    {
                        int[] newAges = new int[2*age];
                        _ages.CopyTo(newAges, 0);
                        _ages = newAges;
                    }

                    ++ _ages[age];
                    ++ _hits;
#endif
                    info.Generation = _generation;
                }
#if DEBUG
                else
                {
                    ++ _misses;
                }
#endif
                return info;
            }
            set
            {
                if (type != null && name != null)
                {
                    value.Generation = _generation;
                    _table[new AccessorTableKey(sourceValueType, type, name)] = value;

                    if (!_cleanupRequested)
                        RequestCleanup();
                }
            }
        }
Beispiel #14
0
            public AccessorTableKey(SourceValueType sourceValueType, Type type, string name)
            {
                Invariant.Assert(type != null && type != null);

                _sourceValueType = sourceValueType;
                _type = type;
                _name = name;
            }
 internal SourceValueInfo(SourceValueType t, DrillIn d, string n)
 {
     this.type    = t;
     this.drillIn = d;
     this.name    = n;
 }
 internal SourceValueInfo(SourceValueType t, DrillIn d, string n)
 {
     this.type = t;
     this.drillIn = d;
     this.name = n;
 }
Beispiel #17
0
 internal SourceValueInfo(SourceValueType t, DrillIn d, string n)
 {
     type = t;
     drillIn = d;
     name = n;
 }
 public ExcelColumn(string columnName, string valueFieldName, SourceValueType valueType)
 {
     columnName     = columnName;
     ValueFieldName = valueFieldName;
     ValueType      = valueType;
 }