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


C# IPackage.IsTheme方法代码示例

本文整理汇总了C#中IPackage.IsTheme方法的典型用法代码示例。如果您正苦于以下问题:C# IPackage.IsTheme方法的具体用法?C# IPackage.IsTheme怎么用?C# IPackage.IsTheme使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IPackage的用法示例。


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

示例1: Update

 private void Update(IPackage package)
 {
     if (package.IsTheme())
     {
         this.themePackageManager.UpdatePackage(package, false, true);
     }
     else
     {
         this.pluginPackageManager.UpdatePackage(package, false, true);
     }
 }
开发者ID:prabhakara,项目名称:Dexter-Blog-Engine,代码行数:11,代码来源:PackageInstaller.cs

示例2: ExecuteInstall

		/// <summary>
		/// Executes a package installation.
		/// </summary>
		/// <param name="package">The package to install.</param>
		/// <param name="packageRepository">The repository for the package.</param>
		/// <param name="sourceLocation">The source location.</param>
		/// <param name="targetPath">The path where to install the package.</param>
		/// <returns>The package information.</returns>
		protected PackageInfo ExecuteInstall(IPackage package, IPackageRepository packageRepository, string sourceLocation, string targetPath)
		{
			var logger = new NugetLogger(_logger);

			var project = new FileBasedProjectSystem(targetPath) { Logger = logger };

			IPackageRepository referenceRepository;
			if (package.IsTheme())
			{
				referenceRepository = new ThemeReferenceRepository(project, packageRepository, _themeRegistry);
			}
			else
			{
				referenceRepository = new PluginReferenceRepository(project, packageRepository, _pluginFinder);
			}

			var projectManager = new ProjectManager(
				packageRepository,
				new DefaultPackagePathResolver(targetPath),
				project,
				referenceRepository
				) { Logger = logger };

			// add the package to the project
			projectManager.AddPackageReference(package, true, false);

			return new PackageInfo
			{
				Id = package.Id,
				Name = package.Title ?? package.Id,
				Version = package.Version.ToString(),
				Type = package.IsTheme() ? "Theme" : "Plugin",
				Path = targetPath
			};
		}
开发者ID:GloriousOnion,项目名称:SmartStoreNET,代码行数:43,代码来源:PackageInstaller.cs

示例3: Uninstall

        private void Uninstall(IPackage package)
        {
            if (package == null)
            {
                throw new ArgumentNullException("package", "The package cannot be null.");
            }

            if (package.IsTheme())
            {
                this.themePackageManager.UninstallPackage(package);
            }
            else
            {
                this.pluginPackageManager.UninstallPackage(package);
            }
        }
开发者ID:prabhakara,项目名称:Dexter-Blog-Engine,代码行数:16,代码来源:PackageInstaller.cs


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