예제 #1
0
 public FileWatcher(Action <Exception> onException)
 {
     this.onException        = onException;
     this.watchers           = new ConcurrentBag <System.IO.FileSystemWatcher>();
     this.watchedDirectories = new Dictionary <Uri, ImmutableHashSet <string> >();
     this.processing         = new ProcessingQueue(this.onException, "error in file system watcher");
     this.globPatterns       = new ConcurrentDictionary <Uri, IEnumerable <string> >();
 }
예제 #2
0
            internal Project(
                Uri projectFile,
                ProjectInformation projectInfo,
                Action <Exception>?onException,
                Action <PublishDiagnosticParams>?publishDiagnostics,
                Action <string, MessageType>?log)
            {
                this.ProjectFile = projectFile;
                this.Properties  = projectInfo.Properties;

                var version = Version.TryParse(projectInfo.Properties.Version, out Version v) ? v : null;

                if (projectInfo.Properties.Version.Equals("Latest", StringComparison.InvariantCultureIgnoreCase))
                {
                    version = new Version(0, 3);
                }
                var ignore = version == null || version < new Version(0, 3) ? true : false;

                this.processing = new ProcessingQueue(onException);
                this.log        = log ?? ((msg, severity) => Console.WriteLine($"{severity}: {msg}"));

                this.loadedSourceFiles = ImmutableHashSet <Uri> .Empty;
            }