예제 #1
0
 WrapFileDescriptor GetDescriptor(string wrapPath, IWrapRepository wrapsDirectory)
 {
     WrapFileDescriptor descriptor;
     if (!_notificationClients.TryGetValue(wrapPath, out descriptor))
         _notificationClients.Add(wrapPath, descriptor = new WrapFileDescriptor(wrapPath, wrapsDirectory, HandleWrapFileUpdate));
     return descriptor;
 }
예제 #2
0
 public IEnumerable<IAssemblyReferenceExportItem> GetAssemblyReferences(WrapDescriptor descriptor, IWrapRepository repository, IWrapAssemblyClient client)
 {
     return (from dependency in descriptor.Dependencies
             let package = repository.Find(dependency)
             where package != null
             let items = package.Load().GetExport("bin", client.Environment).Items.OfType<IAssemblyReferenceExportItem>()
             select items).SelectMany(x => x);
 }
 public ResharperProjectUpdater(string descriptorPath, IWrapRepository wrapRepository, string projectFilePath, WrapRuntimeEnvironment environment)
 {
     _descriptorPath = descriptorPath;
     _wrapRepository = wrapRepository;
     _projectFilePath = projectFilePath;
     Environment = environment;
     WrapServices.GetService<IWrapDescriptorMonitoringService>()
         .ProcessWrapDescriptor(_descriptorPath, _wrapRepository, this);
 }
예제 #4
0
        public void ProcessWrapDescriptor(string wrapPath, IWrapRepository wrapsDirectory, IWrapAssemblyClient client)
        {
            if (!File.Exists(wrapPath))
                return;

            var descriptor = GetDescriptor(wrapPath, wrapsDirectory);
            if (client.IsLongRunning)
                descriptor.Clients.Add(client);

            NotifyClient(wrapPath, client);
        }
예제 #5
0
 public WrapFileDescriptor(string path, IWrapRepository wraps, FileSystemEventHandler handler)
 {
     Repository = wraps;
     Clients = new List<IWrapAssemblyClient>();
     FilePath = path;
     FileSystemWatcher = new FileSystemWatcher(Path.GetDirectoryName(path), Path.GetFileName(path))
     {
         NotifyFilter = NotifyFilters.LastWrite
     };
     FileSystemWatcher.Changed += handler;
     FileSystemWatcher.EnableRaisingEvents = true;
 }
 public void TryAddNotifier(string descriptorPath, IWrapRepository repository, string projectFilePath)
 {
     if (_projectFiles.ContainsKey(projectFilePath))
         return;
     _projectFiles[projectFilePath] = new ResharperProjectUpdater(descriptorPath, repository, projectFilePath, Environment);
 }