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

            foreach (var client in d.Clients)
            {
                client.AssembliesUpdated(PackageResolver.GetAssemblyReferences(false, client.Environment, parsedDescriptor, d.Repository));
            }
        }
        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 Initialize()
        {
            FileSystem = LocalFileSystem.Instance;
            DescriptorFile = CurrentDirectory
                    .AncestorsAndSelf()
                    .SelectMany(x => x.Files("*.wrapdesc"))
                    .FirstOrDefault();
            if (DescriptorFile != null)
                Descriptor = new PackageDescriptorReaderWriter().Read(DescriptorFile);

            TryInitializeProjectRepository();

            CurrentDirectoryRepository = new CurrentDirectoryRepository();

            SystemRepository = new FolderRepository(FileSystem.GetDirectory(DefaultInstallationPaths.SystemRepositoryDirectory))
            {
                    Name = "System repository"
            };

            ConfigurationDirectory = FileSystem.GetDirectory(DefaultInstallationPaths.ConfigurationDirectory);

            RemoteRepositories = new RemoteRepositoryBuilder(FileSystem, Services.Services.GetService<IConfigurationManager>()).GetConfiguredPackageRepositories().ToList();
            ExecutionEnvironment = new ExecutionEnvironment
            {
                    Platform = IntPtr.Size == 4 ? "x86" : "x64",
                    Profile = Environment.Version.Major >= 4 ? "net40" : "net35"
            };
        }