예제 #1
0
        /// <summary>
        /// Map the columns in this dataframe to a given type.
        ///
        /// If the column names match (in a case insensitive, culture invariant comparison) the mapping can be automatic.
        ///
        /// Otherwise, list out the member names in column order to map to.
        ///
        /// Objects of TProxyType will be created by calling the provided proxy function.
        ///
        /// Return false if the mapping cannot be made, and true otherwise.
        /// </summary>
        public bool TryProxy <TProxyType>(Func <TProxyType> factory, out ProxyDataFrame <TProxyType> dataframe, params string[] membersToColumns)
        {
            if (factory == null)
            {
                dataframe = null;
                return(false);
            }

            Dictionary <long, MemberInfo> columnsToMembers;
            string _;

            if (!TryInferMapping <TProxyType>(membersToColumns, out columnsToMembers, out _))
            {
                dataframe = null;
                return(false);
            }

            dataframe = MakeProxy(columnsToMembers, factory);
            return(true);
        }
예제 #2
0
 /// <summary>
 /// Map the columns in this dataframe to a given type.
 ///
 /// If the column names match (in a case insensitive, culture invariant comparison) the mapping can be automatic.
 ///
 /// Otherwise, list out the member names in column order to map to.
 ///
 /// Objects of TProxyType will be created by calling the default constructor.
 ///
 /// Return false if the mapping cannot be made, and true otherwise.
 /// </summary>
 public bool TryProxy <TProxyType>(out ProxyDataFrame <TProxyType> dataframe, params string[] membersToColumns)
     where TProxyType : new()
 => TryProxy(MakeDefaultFactory <TProxyType>(), out dataframe, membersToColumns);
예제 #3
0
 /// <summary>
 /// <see cref="System.Collections.Generic.IEnumerator{T}"/>
 /// </summary>
 public void Dispose()
 {
     Parent = null;
 }
예제 #4
0
 internal ProxyRowEnumerator(ProxyDataFrame <TProxyType> parent)
 {
     Current = default(TProxyType);
     Parent  = parent;
     Index   = -1;
 }
예제 #5
0
 internal ProxyRowEnumerable(ProxyDataFrame <TProxyType> parent)
 {
     Parent = parent;
 }
예제 #6
0
 internal ProxyRowMap(ProxyDataFrame <TProxyType> parent)
 {
     Parent = parent;
 }