ProjectSystem\FileChangeWatcher.cs (36)
99private readonly Kind _kind;
102/// The extension filters to apply for <see cref="Kind.WatchDirectory"/>. This value may be
108/// The file change flags to apply for <see cref="Kind.WatchFiles"/>.
113/// The instance to receive callback events for <see cref="Kind.WatchDirectory"/> or
114/// <see cref="Kind.WatchFiles"/>.
119/// The collection holding cookies. For <see cref="Kind.WatchDirectory"/>, the operation will add the
120/// resulting cookie to this collection. For <see cref="Kind.UnwatchDirectories"/>, the operation will
132/// assigned by the operation for <see cref="Kind.WatchFiles"/>, or read by the operation for
133/// <see cref="Kind.UnwatchFiles"/>.
138/// A collection of file paths to subscribe to for <see cref="Kind.WatchFiles"/> or
139/// <see cref="Kind.WatchDirectory"/>.
143private WatcherOperation(Kind kind, string directory, ImmutableArray<string> filters, IVsFreeThreadedFileChangeEvents2 sink, List<uint> cookies)
145Contract.ThrowIfFalse(kind is Kind.WatchDirectory);
158private WatcherOperation(Kind kind, OneOrMany<string> files, _VSFILECHANGEFLAGS fileChangeFlags, IVsFreeThreadedFileChangeEvents2 sink, OneOrMany<Context.RegularWatchedFile> tokens)
160Contract.ThrowIfFalse(kind is Kind.WatchFiles);
173private WatcherOperation(Kind kind, List<uint> cookies)
175Contract.ThrowIfFalse(kind is Kind.UnwatchDirectories);
188private WatcherOperation(Kind kind, OneOrMany<Context.RegularWatchedFile> tokens)
190Contract.ThrowIfFalse(kind is Kind.UnwatchFiles);
212=> new(Kind.WatchDirectory, directory, filters, sink, cookies);
215=> new(Kind.WatchFiles, OneOrMany.Create(path), fileChangeFlags, sink, OneOrMany.Create(token));
218=> new(Kind.WatchFiles, new OneOrMany<string>(files), fileChangeFlags, sink, new OneOrMany<Context.RegularWatchedFile>(tokens));
221=> new(Kind.UnwatchDirectories, cookies);
224=> new(Kind.UnwatchFiles, new OneOrMany<Context.RegularWatchedFile>(tokens));
227=> new(Kind.UnwatchFiles, OneOrMany.Create(token));
254case Kind.WatchFiles:
262case Kind.UnwatchFiles:
267case Kind.UnwatchDirectories:
278Kind.WatchFiles =>
280Kind.UnwatchFiles =>
282Kind.UnwatchDirectories =>
292if (_kind == Kind.WatchDirectory)
303case Kind.WatchDirectory:
314case Kind.WatchFiles:
323case Kind.UnwatchDirectories:
328case Kind.UnwatchFiles: