public ViewModel(bool isLive) { _isLive = isLive; _dir = Path.Combine(AcRootDirectory.Instance.RequireValue, "extension", "config"); _directoryWatcher = Directory.Exists(_dir) ? SimpleDirectoryWatcher.WatchDirectory(_dir, OnDirectoryUpdate) : null; CreateConfigs(); }
public override void SetOverridesDirectory(IDeviceContextHolder holder, string directory) { ClearOverridesDirectory(); ContentTexturesDirectory = GetContentTexturesDirectory(directory); _contentTexturesWatching = SimpleDirectoryWatcher.WatchDirectory(ContentTexturesDirectory, filename => { if (CurrentDirectory != null) { UpdateOverrideLater(Path.Combine(CurrentDirectory, "skin.ini")); } }); SetOverridesDirectoryInner(holder, directory); }
protected void SetOverridesDirectoryInner([NotNull] IDeviceContextHolder holder, [NotNull] string directory) { _holder = holder; CurrentDirectory = directory; _watching = SimpleDirectoryWatcher.WatchDirectory(directory, filename => { if (filename == null) { UpdateOverridesLater(); } else { UpdateOverrideLater(filename); } }); UpdateOverridesAsync().Ignore(); }