当前位置: 首页>>代码示例>>C#>>正文


C# IPackageManager类代码示例

本文整理汇总了C#中IPackageManager的典型用法代码示例。如果您正苦于以下问题:C# IPackageManager类的具体用法?C# IPackageManager怎么用?C# IPackageManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


IPackageManager类属于命名空间,在下文中一共展示了IPackageManager类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Purge

        /// <summary>
        /// Attempts to delete files and directories in the trash.
        /// </summary>
        /// <param name="pkgmgr">package manager reference</param>
        public static void Purge(IPackageManager pkgmgr)
        {
            List<string> deleted = new List<string>();

            foreach (string p in pkgmgr.Trash.OrderBy(i => i)) {
                try {
                    if (File.Exists(p))
                        File.Delete(p);
                    else if (Directory.Exists(p) && pkgmgr.CheckPathOwned(p)) {
                        /* this can be removed from the trash */
                    } else if (Directory.Exists(p) && Directory.GetFiles(p).Length > 0)
                        continue;
                    else if (Directory.Exists(p))
                        Directory.Delete(p);
                    else {
                        /* orphaned file? */
                    }

                    deleted.Add(p);
                } catch {
                    continue;
                }
            }

            pkgmgr.DeleteTrashItems(deleted.ToArray());
        }
开发者ID:rcarz,项目名称:fusion,代码行数:30,代码来源:TrashWorker.cs

示例2: ActionsViewModel

        public ActionsViewModel(IPackageManager packageManager, List<PackageAction> actions)
        {
            DisplayName = "";

            List = new ObservableCollection<PackageAction>(actions);
            List.CollectionChanged += (sender, args) => RaisePropertyChanged(() => OrderedList);

            var eventHandler = new PropertyChangedEventHandler((sender, args) =>
            {
                if (List.Any(n => n.Progress != 100))
                    return;

                CanClose = true;
                RaisePropertyChanged(() => CanClose);

                // TODO: if autoclose in options: TryClose(true)
            });

            actions.ForEach(n => n.SubscribeToPropertyChanged(eventHandler));

            foreach (var action in actions)
            {
                action.ActionAdded += a => DispatcherHelper.CheckBeginInvokeOnUI(() => List.Add(a));
            }

            CloseCommand = new RelayCommand(() => TryClose(true));

            packageManager.Execute(actions.ToArray());
        }
开发者ID:henjuv,项目名称:Mg2,代码行数:29,代码来源:ActionsViewModel.cs

示例3: PackageService

        public PackageService(IPackageManager packageManager, INotifier notifier)
        {
            _packageManager = packageManager;
            _notifier = notifier;

            T = NullLocalizer.Instance;
        }
开发者ID:SmartFire,项目名称:Orchard.Platform-Modules,代码行数:7,代码来源:PackageService.cs

示例4: TryInitialize

        bool TryInitialize()
        {
            try
            {
                _dte = SiteManager.GetGlobalService<DTE>();
                _running = _dte != null;
            }
            catch
            {
                _running = false;
            }
            if (!_running) return false;
            // TODO:  seen in the wild, _dte.Solution is null (?), need to schedule and restart initialization for those scenarios.
            _solution = new DteSolution(_dte.Solution);
            _solution.ProjectChanged += HandleProjectChange;
            var environment = ServiceLocator.GetService<IEnvironment>();
            _packageManager = ServiceLocator.GetService<IPackageManager>();

            _assembliesChanged = new EventWaitHandle(false, EventResetMode.AutoReset, System.Diagnostics.Process.GetCurrentProcess().Id + ASSEMBLY_NOTIFY);
            _rootDirectory = environment.DescriptorFile.Parent;
            _projectRepository = environment.ProjectRepository;
            RegisterFileListener();
            RefreshProjects();
            _timer = new Timer(_ => RefreshProjects(), null, Timeout.Infinite, Timeout.Infinite);
            return true;
        }
开发者ID:modulexcite,项目名称:openwrap,代码行数:26,代码来源:AssemblyReferenceNotificationsPlugin.cs

示例5: ExtensionManagerWindow

        public ExtensionManagerWindow(IPackageManager packageManager)
        {
            InitializeComponent();

            explorer.Providers.Add(new InstalledProvider(packageManager, Resources));
            explorer.Providers.Add(new GalleryProvider(packageManager, Resources));
            explorer.Providers.Add(new UpdatesProvider(packageManager, Resources));

            explorer.SelectedProvider = explorer.Providers[0];

            //explorer.BringExtensionIntoView();
            //explorer.CategorySelectionChanged+=
            explorer.IsDetailPaneVisible = true;
            explorer.IsLeftNavigationVisible = true;
            explorer.IsPageNavigatorVisible = true;
            explorer.IsProvidersListVisible = true;
            explorer.IsSearchVisible = true;
            //explorer.NoItemSelectedMessage = "Hello";
            //explorer.NoItemsMessage = "Hi";
            //explorer.PageNavigator
            //explorer.ProviderSelectionChanged
            //explorer.Providers
            //explorer.SelectedExtension
            //explorer.SelectedExtensionTreeNode
            //explorer.SelectedProvider
            //explorer.SelectedSortField
            //explorer.SetFocusOnSearchBox();
        }
开发者ID:citizenmatt,项目名称:ReSharperExtensionManager,代码行数:28,代码来源:ExtensionManagerWindow.xaml.cs

示例6: ShouldElevateAsync

        public async Task<bool> ShouldElevateAsync(IPackageManager sender, string operation) {
            if (_alwaysElevate) {
                return true;
            }

            return ShouldElevate(_site, sender.Factory.Configuration, operation);
        }
开发者ID:jsschultz,项目名称:PTVS,代码行数:7,代码来源:VsPackageManagerUI.cs

示例7: Operation

        public Operation(
            PackageOperation operation, 
            IProjectManager projectManager,
            IPackageManager packageManager)
            : base(operation.Package, operation.Action)
        {
            if (projectManager != null && packageManager != null)
            {
                throw new ArgumentException("Only one of packageManager and projectManager can be non-null");
            }

            if (operation.Target == PackageOperationTarget.PackagesFolder && packageManager == null)
            {
                throw new ArgumentNullException("packageManager");
            }

            if (operation.Target == PackageOperationTarget.Project && projectManager == null)
            {
                throw new ArgumentNullException("projectManager");
            }

            Target = operation.Target;
            PackageManager = packageManager;
            ProjectManager = projectManager;
            if (ProjectManager != null)
            {
                _projectName = ProjectManager.Project.ProjectName;
            }
        }
开发者ID:rikoe,项目名称:nuget,代码行数:29,代码来源:RealPackageOperation.cs

示例8: GenerateUniqueToken

        /// <summary>
        /// We want to base the lock name off of the full path of the package, however, the Mutex looks for files on disk if a path is given.
        /// Additionally, it also fails if the string is longer than 256 characters. Therefore we obtain a base-64 encoded hash of the path.
        /// </summary>
        /// <seealso cref="http://social.msdn.microsoft.com/forums/en-us/clr/thread/D0B3BF82-4D23-47C8-8706-CC847157AC81"/>
        private static string GenerateUniqueToken(IPackageManager packageManager, string packageId, SemanticVersion version)
        {
            var packagePath = packageManager.FileSystem.GetFullPath(packageManager.PathResolver.GetPackageFileName(packageId, version));
            var pathBytes = Encoding.UTF8.GetBytes(packagePath);
            var hashProvider = new CryptoHashProvider("SHA256");

            return Convert.ToBase64String(hashProvider.CalculateHash(pathBytes)).ToUpperInvariant();
        }
开发者ID:Alxandr,项目名称:NAnt.Nuget.Tasks,代码行数:13,代码来源:PackageExtractor.cs

示例9: TestWrapCommand

 public TestWrapCommand(IFileSystem fileSystem,IPackageResolver resolver, IEnvironment environment, IPackageExporter exporter, IPackageManager manager)
 {
     _fileSystem = fileSystem;
     _exporter = exporter;
     _manager = manager;
     _resolver = resolver;
     _environment = environment;
 }
开发者ID:modulexcite,项目名称:openwrap,代码行数:8,代码来源:TestWrapCommand.cs

示例10: PowerShellPackageFile

 public PowerShellPackageFile(
     IProcess process, IPackageManager manager, IFileSystem fileSystem, string configurationPath)
 {
     this.process = process;
     this.manager = manager;
     this.fileSystem = fileSystem;
     this.configurationPath = configurationPath;
 }
开发者ID:alexfalkowski,项目名称:NuGet.AdvancedPackagingTool,代码行数:8,代码来源:PowerShellPackageFile.cs

示例11: RepositoryService

 public RepositoryService(IPackageRepository packageRepository, IPackageManager packageManager, IJsonSerializer jsonSerializer)
 {
     if (packageRepository == null) throw new ArgumentNullException("packageRepository");
     if (packageManager == null) throw new ArgumentNullException("packageManager");
     _packageRepository = packageRepository;
     _packageManager = packageManager;
     _jsonSerializer = jsonSerializer;
 }
开发者ID:KyulingLee,项目名称:hadouken,代码行数:8,代码来源:RepositoryService.cs

示例12: Ps1ScaffolderLocator

 public Ps1ScaffolderLocator(IPowershellCommandInvoker commandInvoker, IPackageManager packageManager, IPackagePathResolver pathResolver, FileSystem.IFileSystem fileSystem, IScaffoldingConfigStore configStore)
 {
     _commandInvoker = commandInvoker;
     _packageManager = packageManager;
     _pathResolver = pathResolver ?? packageManager.PathResolver;
     _fileSystem = fileSystem;
     _configStore = configStore;
 }
开发者ID:processedbeets,项目名称:ASP.NET-MVC-Scaffolding,代码行数:8,代码来源:Ps1ScaffolderLocator.cs

示例13: PackageManager

        NuGet.IPackageManager INuGetFactory.GetPackageManager()
        {
            if (_packageManager != null)
                return _packageManager;

            var repo = ((INuGetFactory)this).GetPackageRepository();
            _packageManager = new PackageManager(repo, _arguments.GetInstallationDirectory());
            return _packageManager;
        }
开发者ID:run00,项目名称:NuProduct,代码行数:9,代码来源:NuGetFactory.cs

示例14: InstallPackageCommand

 public InstallPackageCommand(
     IHostPlatformDetector hostPlatformDetector,
     IPackageManager packageManager,
     IFeatureManager featureManager)
 {
     this.m_HostPlatformDetector = hostPlatformDetector;
     this.m_PackageManager = packageManager;
     _featureManager = featureManager;
 }
开发者ID:marler8997,项目名称:Protobuild,代码行数:9,代码来源:InstallPackageCommand.cs

示例15: KnownToolProvider

 public KnownToolProvider(
     IPackageGlobalTool packageGlobalTool,
     IPackageManager packageManager,
     IHostPlatformDetector hostPlatformDetector)
 {
     _packageGlobalTool = packageGlobalTool;
     _packageManager = packageManager;
     _hostPlatformDetector = hostPlatformDetector;
 }
开发者ID:jbeshir,项目名称:Protobuild,代码行数:9,代码来源:KnownToolProvider.cs


注:本文中的IPackageManager类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。