示例#1
0
 async Task IPreprocessingStep.Execute(IPreprocessingStepCallback callback)
 {
     await ExecuteInternal(callback, p =>
     {
         var cp = ((IFileBasedLogProviderFactory)harLogsFactory).CreateParams(p.Location);
         p.DumpToConnectionParams(cp);
         callback.YieldLogProvider(new YieldedProvider()
         {
             Factory          = harLogsFactory,
             ConnectionParams = cp,
             DisplayName      = p.DisplayName,
         });
     });
 }
示例#2
0
        static void AutodetectFormatAndYield(PreprocessingStepParams file, IPreprocessingStepCallback callback)
        {
            callback.SetStepDescription(string.Format("Detecting format: {0}", file.FullPath));
            var progressHandler = new ProgressHandler()
            {
                callback = callback
            };
            var detectedFormat = callback.FormatAutodetect.DetectFormat(file.Location, file.FullPath, progressHandler.cancellation.Token, progressHandler);

            if (detectedFormat != null)
            {
                file.DumpToConnectionParams(detectedFormat.ConnectParams);
                callback.YieldLogProvider(new YieldedProvider()
                {
                    Factory          = detectedFormat.Factory,
                    ConnectionParams = detectedFormat.ConnectParams,
                    DisplayName      = file.FullPath,
                    IsHiddenLog      = false
                });
            }
        }