// private readonly IDisposable _columnSubscription; public TableSynchroniser(IReactiveTable sourceTable, IWritableReactiveTable targetTable, IThreadMarshaller threadMarshaller) { _sourceTable = sourceTable; _targetTable = targetTable; _threadMarshaller = threadMarshaller; _subscription = _sourceTable.Subscribe(this); }
/// <summary> /// Create batched pass through table - uses a timer /// </summary> /// <param name="targetTable">The table to write to</param> /// <param name="marshaller">The thread marshaller</param> /// <param name="delay">The frequency with which we should update the target table</param> /// <param name="onlyKeepLastValue">Whether to only keep the last value for a column/cell position</param> public ReactiveBatchedPassThroughTable(IWritableReactiveTable targetTable, IThreadMarshaller marshaller, TimeSpan delay, bool onlyKeepLastValue = false) : this(targetTable, marshaller, onlyKeepLastValue) { _timer = new System.Timers.Timer(delay.TotalMilliseconds); _timer.Elapsed += (sender, args) => SynchroniseChanges(); _timer.AutoReset = false; _timer.Start(); }
public BatchedTableSynchroniser(ReactiveTable sourceTable, IWritableReactiveTable targetTable, IThreadMarshaller threadMarshaller, TimeSpan delay) { _sourceTable = sourceTable; _targetTable = targetTable; _threadMarshaller = threadMarshaller; _timer = new Timer(SynchroniseChanges, null, delay, delay); _subscription = _sourceTable.Subscribe(this); }
public LocksTracker(NPath repositoryPath, IThreadMarshaller threadMarshaller, LocksUpdatedHandler onLocksUpdated = null) { _repositoryPath = repositoryPath; _threadMarshaller = threadMarshaller; _commandRunner = new CommandRunner(_repositoryPath); if (onLocksUpdated != null) { OnLocksUpdated += onLocksUpdated; } }
public LoggingManager([NotNull] IThreadMarshaller threadMarshaller, [NotNull] IWurmAssistantDataDirectory wurmAssistantDataDirectory) { if (threadMarshaller == null) { throw new ArgumentNullException(nameof(threadMarshaller)); } if (wurmAssistantDataDirectory == null) { throw new ArgumentNullException(nameof(wurmAssistantDataDirectory)); } this.threadMarshaller = threadMarshaller; var logOutputDirFullPath = Path.Combine(wurmAssistantDataDirectory.DirectoryPath, "Logs"); loggingConfig = new LoggingConfig(logOutputDirFullPath); factoryLogger = new Logger(this, "LoggingManager"); }
/// <summary> /// Create batched pass through table /// </summary> /// <param name="targetTable">The table to write to</param> /// <param name="marshaller">The thread marshaller</param> /// <param name="onlyKeepLastValue">Whether to only keep the last value for a column/cell position</param> public ReactiveBatchedPassThroughTable(IWritableReactiveTable targetTable, IThreadMarshaller marshaller, bool onlyKeepLastValue = false) { _targetTable = targetTable; _marshaller = marshaller; _onlyKeepLastValue = onlyKeepLastValue; }
public ReactivePassThroughTable(ReactiveTable targetTable, IThreadMarshaller marshaller) { _targetTargetTable = targetTable; _marshaller = marshaller; }