FiftyOne.Foundation.Mobile.Detection.Provider.CreateMatch C# (CSharp) Method

CreateMatch() public method

Creates a new FiftyOne.Foundation.Mobile.Detection.Match object to be used for matching.
public CreateMatch ( ) : Match
return System.Text.RegularExpressions.Match
        public Match CreateMatch()
        {
            return new Match(this);
        }

Usage Example

 /// <summary>
 /// In a single thread loops through the useragents in the file
 /// provided perform a match with the data set provided passing
 /// control back to the method provided for further processing.
 /// </summary>
 /// <param name="provider"></param>
 /// <param name="userAgents"></param>
 /// <param name="method"></param>
 /// <returns>Counts for each of the methods used</returns>
 internal static Results DetectLoopSingleThreaded(Provider provider, IEnumerable<string> userAgents, ProcessMatch method, object state)
 {
     provider.DataSet.ResetCache();
     var match = provider.CreateMatch();
     var results = new Results();
     foreach (var line in userAgents)
     {
         provider.Match(line.Trim(), match);
         method(results, match, state);
         results.Count++;
         results.Methods[match.Method]++;
     }
     AssertPool(provider);
     ReportMethods(results.Methods);
     ReportProvider(provider);
     ReportTime(results);
     return results;
 }
All Usage Examples Of FiftyOne.Foundation.Mobile.Detection.Provider::CreateMatch