public LogSourcesPreprocessingManager( ISynchronizationContext invokeSynchronize, IFormatAutodetect formatAutodetect, IExtensionsRegistry extensions, IPreprocessingManagerExtension builtinStepsExtension, Telemetry.ITelemetryCollector telemetry, ITempFilesManager tempFilesManager, ILogSourcesManager logSourcesManager, IShutdown shutdown, ITraceSourceFactory traceSourceFactory, IChangeNotification changeNotification ) { this.traceSourceFactory = traceSourceFactory; this.trace = traceSourceFactory.CreateTraceSource("PreprocessingManager", "prepr"); this.invokeSynchronize = invokeSynchronize; this.formatAutodetect = formatAutodetect; this.providerYieldedCallback = prov => logSourcesManager.Create(prov.Factory, prov.ConnectionParams).Visible = !prov.IsHiddenLog; this.extensions = extensions; this.telemetry = telemetry; this.tempFilesManager = tempFilesManager; this.logSourcesManager = logSourcesManager; this.changeNotification = changeNotification; extensions.Register(builtinStepsExtension); shutdown.Cleanup += (sender, e) => { shutdown.AddCleanupTask(this.DeleteAllPreprocessings()); }; }
void IPagePresenter.Apply() { if (currentIdentity == null) { return; } IConnectionParams connectParams = factory.CreateParamsFromIdentity(currentIdentity); model.Create(factory, connectParams); SetCurrentIdentity(null); }
void ApplyIndependentLogsMode() { string tmp = ((string)view.ReadControlValue(ControlId.FileSelector)).Trim(); if (tmp == "") { return; } view.WriteControlValue(ControlId.FileSelector, ""); foreach (string fname in FileListUtils.ParseFileList(tmp)) { try { model.Create(factory, factory.CreateParams(fname)); } catch (Exception e) { alerts.ShowPopup("Error", string.Format("Failed to create log source for '{0}': {1}", fname, e.Message), AlertFlags.Ok | AlertFlags.WarningIcon); break; } } }
public static ILogSource FindLiveLogSourceOrCreateNew( this ILogSourcesManager logSources, ILogProviderFactory factory, IConnectionParams cp) { ILogSource src = logSources.Find(cp); if (src != null && src.Provider.Stats.State == LogProviderState.LoadError) { src.Dispose(); src = null; } if (src == null) { src = logSources.Create(factory, cp); } return(src); }
void IPagePresenter.Apply() { StorageAccount account = CreateStorageAccount(); IConnectionParams connectParams = null; if (loadFixedRangeRadioButton.Checked) { connectParams = factory.CreateParams(account, fromDateTimePicker.Value, tillDateTimePicker.Value); } else if (loadRecentRadioButton.Checked) { connectParams = factory.CreateParams(account, GetRecentPeriod(), liveLogCheckBox.Checked); } else { return; } logSources.Create(factory, connectParams); }
void IPagePresenter.Apply() { model.Create(factory, new ConnectionParams()); }