コード例 #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;
 }