ProjectSystem\FileChangeWatcher.cs (36)
100private readonly Kind _kind;
103/// The extension filters to apply for <see cref="Kind.WatchDirectory"/>. This value may be
109/// The file change flags to apply for <see cref="Kind.WatchFiles"/>.
114/// The instance to receive callback events for <see cref="Kind.WatchDirectory"/> or
115/// <see cref="Kind.WatchFiles"/>.
120/// The collection holding cookies. For <see cref="Kind.WatchDirectory"/>, the operation will add the
121/// resulting cookie to this collection. For <see cref="Kind.UnwatchDirectories"/>, the operation will
133/// assigned by the operation for <see cref="Kind.WatchFiles"/>, or read by the operation for
134/// <see cref="Kind.UnwatchFiles"/>.
139/// A collection of file paths to subscribe to for <see cref="Kind.WatchFiles"/> or
140/// <see cref="Kind.WatchDirectory"/>.
144private WatcherOperation(Kind kind, string directory, ImmutableArray<string> filters, IVsFreeThreadedFileChangeEvents2 sink, List<uint> cookies)
146Contract.ThrowIfFalse(kind is Kind.WatchDirectory);
159private WatcherOperation(Kind kind, OneOrMany<string> files, _VSFILECHANGEFLAGS fileChangeFlags, IVsFreeThreadedFileChangeEvents2 sink, OneOrMany<Context.RegularWatchedFile> tokens)
161Contract.ThrowIfFalse(kind is Kind.WatchFiles);
174private WatcherOperation(Kind kind, List<uint> cookies)
176Contract.ThrowIfFalse(kind is Kind.UnwatchDirectories);
189private WatcherOperation(Kind kind, OneOrMany<Context.RegularWatchedFile> tokens)
191Contract.ThrowIfFalse(kind is Kind.UnwatchFiles);
213=> new(Kind.WatchDirectory, directory, filters, sink, cookies);
216=> new(Kind.WatchFiles, OneOrMany.Create(path), fileChangeFlags, sink, OneOrMany.Create(token));
219=> new(Kind.WatchFiles, new OneOrMany<string>(files), fileChangeFlags, sink, new OneOrMany<Context.RegularWatchedFile>(tokens));
222=> new(Kind.UnwatchDirectories, cookies);
225=> new(Kind.UnwatchFiles, new OneOrMany<Context.RegularWatchedFile>(tokens));
228=> new(Kind.UnwatchFiles, OneOrMany.Create(token));
255case Kind.WatchFiles:
263case Kind.UnwatchFiles:
268case Kind.UnwatchDirectories:
279Kind.WatchFiles =>
281Kind.UnwatchFiles =>
283Kind.UnwatchDirectories =>
293if (_kind == Kind.WatchDirectory)
304case Kind.WatchDirectory:
315case Kind.WatchFiles:
324case Kind.UnwatchDirectories:
329case Kind.UnwatchFiles: