void NotifyClient(IFile wrapPath, IResolvedAssembliesUpdateListener listener)
        {
            if (!_notificationClients.ContainsKey(wrapPath.Path))
                return;
            var d = _notificationClients[wrapPath.Path];
            d.Repository.RefreshPackages();
            var parsedDescriptor = new PackageDescriptorReaderWriter().Read(wrapPath);

            listener.AssembliesUpdated(PackageResolver.GetAssemblyReferences(false, listener.Environment, parsedDescriptor, d.Repository));
        }
 public void UnregisterListener(IResolvedAssembliesUpdateListener listener)
 {
     List<DescriptorSubscriptions> registrationsForClient;
     lock (_notificationClients)
     {
         registrationsForClient = _notificationClients.Values.Where(x => x.Clients.Contains(listener)).ToList();
     }
     foreach (var registraiton in registrationsForClient)
         registraiton.Clients.Remove(listener);
 }
        public void UnregisterListener(IResolvedAssembliesUpdateListener listener)
        {
            List <DescriptorSubscriptions> registrationsForClient;

            lock (_notificationClients)
            {
                registrationsForClient = _notificationClients.Values.Where(x => x.Clients.Contains(listener)).ToList();
            }
            foreach (var registraiton in registrationsForClient)
            {
                registraiton.Clients.Remove(listener);
            }
        }
        public void RegisterListener(IFile wrapFile, IPackageRepository projectRepository, IResolvedAssembliesUpdateListener listener)
        {
            if (!wrapFile.Exists)
                return;

            if (projectRepository == null) throw new ArgumentNullException("projectRepository");
            if (listener == null) throw new ArgumentNullException("listener");

            var descriptor = GetDescriptor(wrapFile, projectRepository);
            if (listener.IsLongRunning)
                descriptor.Clients.Add(listener);

            NotifyClient(wrapFile, listener);
        }
        void NotifyClient(IFile wrapPath, IResolvedAssembliesUpdateListener listener)
        {
            var subscriptions = GetSubsriptionsFor(wrapPath);

            if (subscriptions == null)
            {
                return;
            }

            subscriptions.Repository.RefreshPackages();
            var descriptor = new PackageDescriptorReader()
                             .ReadAll(wrapPath.Parent)
                             .Where(x => x.Value.File.Path == wrapPath.Path)
                             .Select(x => x.Value.Value)
                             .Single();


            listener.AssembliesUpdated(PackageManager.GetProjectAssemblyReferences(descriptor, subscriptions.Repository, listener.Environment, false));
        }
 void NotifyClient(IFile wrapPath, IResolvedAssembliesUpdateListener listener)
 {
     NotifyCore(wrapPath, new[] { listener });
 }
        public void RegisterListener(IFile wrapFile, IPackageRepository projectRepository, IResolvedAssembliesUpdateListener listener)
        {
            if (!wrapFile.Exists)
            {
                return;
            }

            if (projectRepository == null)
            {
                throw new ArgumentNullException("projectRepository");
            }
            if (listener == null)
            {
                throw new ArgumentNullException("listener");
            }

            var descriptor = GetDescriptor(wrapFile, projectRepository);

            if (listener.IsLongRunning)
            {
                descriptor.Clients.Add(listener);
            }

            NotifyClient(wrapFile, listener);
        }
Exemplo n.º 8
0
        void NotifyClient(IFile wrapPath, IResolvedAssembliesUpdateListener listener)
        {
            var subscriptions = GetSubsriptionsFor(wrapPath);
            if (subscriptions == null) return;

            subscriptions.Repository.RefreshPackages();
            var descriptor = new PackageDescriptorReader()
                    .ReadAll(wrapPath.Parent)
                    .Where(x => x.Value.File.Path == wrapPath.Path)
                    .Select(x => x.Value.Value)
                    .Single();

            listener.AssembliesUpdated(PackageResolver.GetAssemblyReferences(false, listener.Environment, descriptor, subscriptions.Repository));
        }
        static bool TryEnumerateProjects(Func<ExecutionEnvironment> env, out IEnumerable<IResolvedAssembliesUpdateListener> projects)
        {
            projects = new IResolvedAssembliesUpdateListener[0];

            if (resharper::JetBrains.ProjectModel.SolutionManager.Instance == null)
                return false;

            ResharperLogger.Debug("SolutionManager found");

            resharper::JetBrains.ProjectModel.ISolution solution = resharper::JetBrains.ProjectModel.SolutionManager.Instance.CurrentSolution;
            if (solution == null) return false;

            ResharperLogger.Debug("Solution found");
            var monitors = (from proj in solution.GetAllProjects()
                            where ProjectIsOpenWrapEnabled(proj)
                            select new ResharperProjectUpdater(proj, env))
                    .Cast<IResolvedAssembliesUpdateListener>()
                    .ToList();
            projects = monitors;
            return true;
        }
Exemplo n.º 10
0
 void NotifyClient(IFile wrapPath, IResolvedAssembliesUpdateListener listener)
 {
     NotifyCore(wrapPath, new[] { listener });
 }