コード例 #1
0
ファイル: Extension.cs プロジェクト: kouweizhong/Sop
            public EnumeratorEnumeratorFilter(ISortedDictionary <TKey, TValue> target,
                                              IEnumerable <KeyValuePair <TSourceKey, TSourceValue> > source,
                                              ExtractKey <TSourceKey, TSourceValue, TKey> sourceKeyExtractor = null,
                                              bool lockWrap = false)
            {
                if (target == null)
                {
                    throw new ArgumentNullException("target");
                }
                if (source == null)
                {
                    throw new ArgumentNullException("source");
                }

                if (lockWrap)
                {
                    target.Locker.Lock(OperationType.Read);
                }
                _target             = (ISortedDictionaryOnDisk)((SpecializedStoreBase)target).Collection.Clone();
                _source             = source.GetEnumerator();
                _sourceKeyExtractor = sourceKeyExtractor;
                _lockWrap           = lockWrap;
                if (_sourceKeyExtractor == null)
                {
                    _sourceKeyExtractor = DefaultKeyExtractor <TSourceKey, TSourceValue, TKey>;
                }
            }
コード例 #2
0
ファイル: Extension.cs プロジェクト: kouweizhong/Sop
 public static IEnumerable <KeyValuePair <TKey, TValue> > Query <TKey, TValue, TSourceKey, TSourceValue>(
     this IEnumerable <KeyValuePair <TKey, TValue> > target,
     IEnumerable <KeyValuePair <TSourceKey, TSourceValue> > source,
     ExtractKey <TSourceKey, TSourceValue, TKey> sourceKeyExtractor = null,
     bool lockWrap = false
     )
 {
     return(new EnumerableEnumeratorFilter <TKey, TValue, TSourceKey, TSourceValue>(
                (ISortedDictionary <TKey, TValue>)target, source, sourceKeyExtractor, lockWrap));
 }
コード例 #3
0
ファイル: Extension.cs プロジェクト: kouweizhong/Sop
 public EnumerableEnumeratorFilter(ISortedDictionary <TKey, TValue> target,
                                   IEnumerable <KeyValuePair <TSourceKey, TSourceValue> > source,
                                   ExtractKey <TSourceKey, TSourceValue, TKey> sourceKeyExtractor = null,
                                   bool lockWrap = false)
 {
     if (target == null)
     {
         throw new ArgumentNullException("target");
     }
     if (source == null)
     {
         throw new ArgumentNullException("source");
     }
     _target             = target;
     _source             = source;
     _sourceKeyExtractor = sourceKeyExtractor;
     _lockWrap           = lockWrap;
 }