コード例 #1
0
        public HttpMockServer(IRecordMatcher matcher)
        {
            instanceCount++;
            this.matcher = matcher;
            this.Records = new Records(matcher);

            if (Mode == HttpRecorderMode.Playback)
            {
                Records.EnqueueRange(sessionRecords);
            }
        }
コード例 #2
0
ファイル: Engine.cs プロジェクト: toyners/Siftan
        private void Process(String[] filePaths, IRecordSourceFactory recordSourceFactory, IRecordMatcher recordMatcher, IRecordWriter2 recordWriter)
        {
            foreach (String filePath in filePaths)
              {
            var recordSource = recordSourceFactory.CreateSource(filePath);

            while (!recordMatcher.HasReachedMatchQuota && recordSource.GotRecord)
            {
              if (recordMatcher.IsMatch(recordSource))
              {
            recordWriter.WriteMatchedRecord(recordSource);
              }
              else
              {
            recordWriter.WriteUnmatchedRecord(recordSource);
              }

              recordSource.MoveToNextRecord();
            }

            recordSource.Close();
              }
        }
コード例 #3
0
ファイル: Page.cs プロジェクト: pwdlugosz/Spectre
 /// <summary>
 /// Sorts all records on the page
 /// </summary>
 /// <param name="ClusterKey"></param>
 public virtual void Sort(IRecordMatcher SortKey)
 {
     this._Elements.Sort(SortKey);
     this._Version++;
 }
コード例 #4
0
ファイル: Records.cs プロジェクト: vladca/azure-sdk-tools
 public Records(Dictionary <string, Queue <RecordEntry> > records, IRecordMatcher matcher)
 {
     this.sessionRecords = new Dictionary <string, Queue <RecordEntry> >(records);
     this.matcher        = matcher;
 }
コード例 #5
0
ファイル: Records.cs プロジェクト: vladca/azure-sdk-tools
 public Records(IRecordMatcher matcher)
     : this(new Dictionary <string, Queue <RecordEntry> >(), matcher)
 {
 }
コード例 #6
0
 /// <summary>
 /// Turn off sorting
 /// </summary>
 /// <param name="ClusterKey"></param>
 public override void Sort(IRecordMatcher SortKey)
 {
     throw new ArgumentException("Cannot sort a sorted page; it's already sorted and the key cannot be changed");
 }
コード例 #7
0
 public SortedPage(Page Primitive, IRecordMatcher Matcher)
     : this(Primitive.PageSize, Primitive.PageID, Primitive.LastPageID, Primitive.NextPageID, Primitive.FieldCount, Primitive.UsedSpace, Matcher)
 {
     this._Elements = Primitive.Cache;
 }
コード例 #8
0
 public SortedPage(int PageSize, int PageID, int LastPageID, int NextPageID, int FieldCount, int UsedSpace, IRecordMatcher Matcher)
     : base(PageSize, PageID, LastPageID, NextPageID, FieldCount, UsedSpace)
 {
     this._Matcher = Matcher;
 }
コード例 #9
0
 public HttpMockServer(IRecordMatcher matcher)
 {
     instanceCount++;
     this.matcher = matcher;
     this.Records = new Records(matcher);
     
     if (Mode == HttpRecorderMode.Playback)
     {
         Records.EnqueueRange(sessionRecords);
     }
 }