private WatcherOperation(Kind kind) { Contract.ThrowIfFalse(kind is Kind.None); _kind = kind; // Other watching fields are not used for this kind _directory = null !; _filter = null; _fileChangeFlags = 0; _sink = null !; _cookies = null !; _token = null !; _tokens = null !; }
private WatcherOperation(Kind kind, IEnumerable <Context.FileWatchingToken> tokens) { Contract.ThrowIfFalse(kind is Kind.UnwatchFiles); _kind = kind; _tokens = tokens; // Other watching fields are not used for this kind _directory = null !; _filter = null; _fileChangeFlags = 0; _sink = null !; _cookies = null !; _token = null !; }
private WatcherOperation(Kind kind, string path, _VSFILECHANGEFLAGS fileChangeFlags, IVsFreeThreadedFileChangeEvents2 sink, Context.FileWatchingToken token) { Contract.ThrowIfFalse(kind is Kind.WatchFile); _kind = kind; _directory = path; _fileChangeFlags = fileChangeFlags; _sink = sink; _token = token; // Other watching fields are not used for this kind _filter = null; _cookies = null !; _tokens = null !; }
private WatcherOperation(Kind kind, string directory, string?filter, IVsFreeThreadedFileChangeEvents2 sink, List <uint> cookies) { Contract.ThrowIfFalse(kind is Kind.WatchDirectory); _kind = kind; _directory = directory; _filter = filter; _sink = sink; _cookies = cookies; // Other watching fields are not used for this kind _fileChangeFlags = 0; _token = null !; _tokens = null !; }
public static WatcherOperation WatchFile(string path, _VSFILECHANGEFLAGS fileChangeFlags, IVsFreeThreadedFileChangeEvents2 sink, Context.FileWatchingToken token) => new(Kind.WatchFile, path, fileChangeFlags, sink, token);