// 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;
 }
Ejemplo n.º 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;
                }
            }
        }
Ejemplo n.º 6
0
 public SourceValueInfo(SourceValueType t, DrillIn d, FrugalObjectList <IndexerParamInfo> list)
 {
     type         = t;
     drillIn      = d;
     name         = null;
     paramList    = list;
     propertyName = null;
 }
Ejemplo n.º 7
0
 public ExcelColumn(string columnName, string valueFieldName, SourceValueType valueType, string path, int depth)
 {
     columnName     = columnName;
     ValueFieldName = valueFieldName;
     ValueType      = valueType;
     Path           = path;
     Depth          = depth;
 }
Ejemplo n.º 8
0
 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;
 }
Ejemplo n.º 10
0
        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;
        }
Ejemplo n.º 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();
                    }
                }
            }
        }
Ejemplo n.º 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()));
        }
Ejemplo n.º 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();
                }
            }
        }
Ejemplo n.º 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;
 }
Ejemplo n.º 17
0
 internal SourceValueInfo(SourceValueType t, DrillIn d, string n)
 {
     type = t;
     drillIn = d;
     name = n;
 }
Ejemplo n.º 18
0
 public ExcelColumn(string columnName, string valueFieldName, SourceValueType valueType)
 {
     columnName     = columnName;
     ValueFieldName = valueFieldName;
     ValueType      = valueType;
 }