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"); }
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; }
ILogSource ILogSourcesController.CreateLogSource(ILogProviderFactory factory, IConnectionParams connectionParams) { return(CreateLogSourceInternal(factory, connectionParams, makeHidden: false)); }
/// <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) { }
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); }
public DetectedFormat(ILogProviderFactory fact, IConnectionParams cp) { Factory = fact; ConnectParams = cp; }
public Presenter(IView view, ILogProviderFactory factory, ILogSourcesController model) { this.view = view; this.factory = factory; this.model = model; }
public LogSourceMetadata(ILogProviderFactory logProviderFactory, params ILogSourcePostprocessor[] supportedPostprocessors) { this.LogProviderFactory = logProviderFactory; this.SupportedPostprocessors = supportedPostprocessors; }
public static string FactoryPartToString(ILogProviderFactory factory) { return(string.Format("<{0}\\{1}>", factory.CompanyName, factory.FormatName)); }