コード例 #1
0
 public void before_each()
 {
     dialogLauncher = MockRepository.GenerateMock<IDialogLauncher>();
     providerFactory = MockRepository.GenerateStub<ILogProviderFactory<FileLogProviderCreationContext>>();
     createdProvider = MockRepository.GenerateStub<ILogProvider>();
     applicationController = MockRepository.GenerateMock<IApplicationController>();
     context = new FileLogProviderCreationContext("log.txt");
 }
コード例 #2
0
ファイル: OpenLogFileCommand.cs プロジェクト: jenrom/LogSpy
 public OpenLogFileCommand(IDialogLauncher dialogLauncher, 
     ILogProviderFactory<FileLogProviderCreationContext> fileProviderFactory, 
     IApplicationController applicationController)
 {
     if (dialogLauncher == null) throw new ArgumentNullException("dialogLauncher");
     if (fileProviderFactory == null) throw new ArgumentNullException("fileProviderFactory");
     if (applicationController == null) throw new ArgumentNullException("applicationController");
     this.dialogLauncher = dialogLauncher;
     this.fileProviderFactory = fileProviderFactory;
     this.applicationController = applicationController;
 }
コード例 #3
0
 ILogSource ILogSourcesController.CreateLogSource(ILogProviderFactory factory, IConnectionParams connectionParams)
 {
     return(CreateLogSourceInternal(factory, connectionParams, makeHidden: false));
 }
コード例 #4
0
 /// <summary>
 ///     初始化日志操作
 /// </summary>
 /// <param name="providerFactory">日志提供程序工厂</param>
 /// <param name="context">日志上下文</param>
 /// <param name="format">日志格式器</param>
 /// <param name="session">用户会话</param>
 public Log(ILogProviderFactory providerFactory, ILogContext context, ILogFormat format, ISession session) :
     base(providerFactory.Create("", format), context, session)
 {
 }
コード例 #5
0
        public static IConnectionParams CreateRotatedLogConnectionParamsFromFolderPath(string folder, ILogProviderFactory logFormat, IEnumerable <string> patterns)
        {
            ConnectionParams p = new ConnectionParams();

            p[ConnectionParamsKeys.RotatedLogFolderPathConnectionParam] = folder;
            int patternIndex   = 0;
            var mergedPatterns = new StringBuilder();

            foreach (var pattern in patterns)
            {
                if (!string.IsNullOrWhiteSpace(pattern))
                {
                    p[$"{ConnectionParamsKeys.RotatedLogPatternParamPrefix}{patternIndex}"] = pattern;
                    ++patternIndex;
                    mergedPatterns.AppendFormat("{0}|", pattern);
                }
            }
            p[ConnectionParamsKeys.IdentityConnectionParam] = CreateFolderBasedConnectionIdentityFromFolderPath(
                $"{logFormat.CompanyName}\\{logFormat.FormatName}", folder, mergedPatterns.ToString());
            return(p);
        }
コード例 #6
0
ファイル: Interfaces.cs プロジェクト: rkapl123/logjoint
		public DetectedFormat(ILogProviderFactory fact, IConnectionParams cp)
		{
			Factory = fact;
			ConnectParams = cp;
		}
コード例 #7
0
 public Presenter(IView view, ILogProviderFactory factory, ILogSourcesController model)
 {
     this.view    = view;
     this.factory = factory;
     this.model   = model;
 }
コード例 #8
0
 public LogSourceMetadata(ILogProviderFactory logProviderFactory, params ILogSourcePostprocessor[] supportedPostprocessors)
 {
     this.LogProviderFactory      = logProviderFactory;
     this.SupportedPostprocessors = supportedPostprocessors;
 }
コード例 #9
0
ファイル: RecentLogEntry.cs プロジェクト: pnelson786/logjoint
 public static string FactoryPartToString(ILogProviderFactory factory)
 {
     return(string.Format("<{0}\\{1}>", factory.CompanyName, factory.FormatName));
 }