本文整理汇总了C#中PackageInfo类的典型用法代码示例。如果您正苦于以下问题:C# PackageInfo类的具体用法?C# PackageInfo怎么用?C# PackageInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PackageInfo类属于命名空间,在下文中一共展示了PackageInfo类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: WritePackageDetails
private static void WritePackageDetails(XmlWriter writer, List<FileDetails> selectedResxFiles,PackageInfo package)
{
writer.WriteStartElement("package");
writer.WriteAttributeString("name", package.PackageName);
writer.WriteAttributeString("type", package.PackageType);
writer.WriteAttributeString("version", package.Version);
writer.WriteElementString("friendlyname", package.FriendlyName);
writer.WriteElementString("description", package.Description);
writer.WriteStartElement("owner");
writer.WriteElementString("name", package.OwnerName);
writer.WriteElementString("organization",package.Organistaion);
writer.WriteElementString("url","");
writer.WriteElementString("email", package.Email);
writer.WriteEndElement();
writer.WriteElementString("license", package.License);
writer.WriteElementString("releasenotes", package.ReleaseNotes);
writer.WriteStartElement("components");
writer.WriteStartElement("component");
writer.WriteAttributeString("type", "CoreLanguage");
writer.WriteStartElement("languagefiles");
writer.WriteElementString("code","");
writer.WriteElementString("displayname", "");
writer.WriteElementString("fallback", "");
WritePackageResources(writer,selectedResxFiles);
WritePackageEndElements(writer);
}
开发者ID:electrono,项目名称:veg-web,代码行数:30,代码来源:PackageWriterBase.cs
示例2: GetPackageManifest
public static PackageInfo GetPackageManifest(string path)
{
PackageInfo package = new PackageInfo();
XmlDocument doc = new XmlDocument();
doc.Load(path);
XmlNode root = doc.DocumentElement;
XmlNodeList xnList = doc.SelectNodes("sageframe/packages/package");
foreach (XmlNode xn in xnList)
{
package.Description = xn["description"].InnerXml.ToString();
package.Version = xn.Attributes["version"].InnerText.ToString();
package.OwnerName = xn["owner"].ChildNodes[0].InnerXml.ToString();
package.Organistaion = xn["owner"].ChildNodes[1].InnerXml.ToString();
package.URL = xn["owner"].ChildNodes[2].InnerXml.ToString();
package.Email = xn["owner"].ChildNodes[3].InnerXml.ToString();
package.ReleaseNotes = xn["releasenotes"].InnerXml.ToString();
package.License = xn["license"].InnerXml.ToString();
}
return package;
}
开发者ID:electrono,项目名称:veg-web,代码行数:25,代码来源:XMLHelper.cs
示例3: Package
public Package(string name, PackageInfo info, PackageStatus status)
{
Name = name;
Id = (info != null ? info.PackageId : null);
Info = info;
Status = status;
}
开发者ID:CartoDB,项目名称:mobile-dotnet-samples,代码行数:7,代码来源:Package.cs
示例4: CreateAssembly
static void CreateAssembly(PackageInfo package) {
// Save the snk file from the embedded resource to the disk so we can use it when we compile
using (var resStream = typeof(Program).Assembly.GetManifestResourceStream("GenerateTestPackages." + keyFileName)) {
using (var snkStream = File.Create(keyFileName)) {
resStream.CopyTo(snkStream);
}
}
var codeProvider = new CSharpCodeProvider();
var compilerParams = new CompilerParameters() {
OutputAssembly = Path.GetFullPath(GetAssemblyFullPath(package.FullName)),
CompilerOptions = "/keyfile:" + keyFileName
};
// Add all the dependencies as referenced assemblies
foreach (DependencyInfo dependency in package.Dependencies) {
compilerParams.ReferencedAssemblies.Add(GetAssemblyFullPath(dependency.FullName));
}
// Create the source code and compile it using CodeDom
var generator = new AssemblySourceFileGenerator() { Package = package };
CompilerResults results = codeProvider.CompileAssemblyFromSource(compilerParams, generator.TransformText());
if (results.Errors.HasErrors) {
Console.WriteLine(results.Errors[0]);
}
File.Delete(keyFileName);
}
开发者ID:monoman,项目名称:NugetCracker,代码行数:31,代码来源:Program.cs
示例5: DeleteFiles
/// <summary>
/// Deletes all files from a package
/// </summary>
/// <param name="installed">Insyalled package</param>
/// <param name="repositories">Repositories where to find the package</param>
private void DeleteFiles(PackageInfo installed, ICollection<string> repositories)
{
Logger.Log("Deleting installed files... ");
var factory = new PackageRepositoryFactory();
IPackage package;
var globalRepo = new AggregateRepository(factory, repositories, true);
package = globalRepo.FindPackage(installed.Name, SemanticVersion.Parse(installed.Version), true, true);
if (package == null)
{
throw new InexistentPackageException(string.Format("Unable to find package {0} version {1}", installed.Name, installed.Version));
}
var fylesystem = new PhysicalFileSystem(installed.InstallationDirectory);
fylesystem.DeleteFiles(package.GetFiles(), installed.InstallationDirectory);
File.Delete(Path.Combine(installed.InstallationDirectory, installed.Name + "." + installed.Version + ".nupkg"));
foreach (var config in Directory.GetFiles(installed.InstallationDirectory, "*.config"))
{
File.Delete(config);
}
Logger.Log("Installed files deleted");
}
开发者ID:BazookaDeploy,项目名称:Bazooka,代码行数:35,代码来源:PackageRemover.cs
示例6: LoadFromFolder
public IPackageInfo LoadFromFolder(string folder)
{
folder = Path.GetFullPath(folder);
var manifest = _fileSystem.LoadFromFile<PackageManifest>(folder, PackageManifest.FILE);
var package = new PackageInfo(manifest.Name){
Description = "{0} ({1})".ToFormat(manifest.Name, folder)
};
// Right here, this needs to be different
package.RegisterFolder(BottleFiles.WebContentFolder, _getContentFolderFromPackageFolder(folder));
package.RegisterFolder(BottleFiles.DataFolder, Path.Combine(folder, BottleFiles.DataFolder));
var binPath = FileSystem.Combine(_applicationFolder, folder, "bin");
var debugPath = FileSystem.Combine(binPath, "debug");
if(_fileSystem.DirectoryExists(debugPath))
{
binPath = debugPath;
}
var assemblyPaths = findCandidateAssemblyFiles(binPath);
assemblyPaths.Each(path =>
{
var assemblyName = Path.GetFileNameWithoutExtension(path);
if (manifest.AssemblyNames.Contains(assemblyName))
{
package.RegisterAssemblyLocation(assemblyName, path);
}
});
return package;
}
开发者ID:Memmo,项目名称:fubumvc,代码行数:32,代码来源:PackageManifestReader.cs
示例7: PackageDownloadProgressChangedEventArgs
/// <summary>
/// 创建 <see cref="PackageDownloadProgressChangedEventArgs" /> 的新实例(PackageDownloadProgressChangedEventArgs)
/// </summary>
public PackageDownloadProgressChangedEventArgs(PackageInfo package, long totalBytesToReceive, long bytesReceived, int progressPercentage)
: base(progressPercentage, package)
{
Package = package;
TotalBytesToReceive = totalBytesToReceive;
BytesReceived = bytesReceived;
}
开发者ID:ChenJasonGit,项目名称:FSLib.App.SimpleUpdater,代码行数:10,代码来源:PackageDownloadProgressChangedEventArgs.cs
示例8: Application
internal Application(PackageInfo pinfo)
{
name = pinfo.Name;
description = pinfo.Description;
startupPath = pinfo.GetData ("MonoAddinsRoot");
registryPath = pinfo.GetData ("MonoAddinsRegistry");
testCommand = pinfo.GetData ("MonoAddinsTestCommand");
}
开发者ID:NALSS,项目名称:Telegraph,代码行数:8,代码来源:SetupService.cs
示例9: ProcessPackage
static void ProcessPackage(PackageInfo package) {
// Make sure all its dependencies are processed first
foreach (var dependency in package.Dependencies) {
EnsurePackageProcessed(dependency.FullName.ToString());
}
Console.WriteLine("Creating package {0}", package.FullName);
CreateAssembly(package);
CreatePackage(package);
}
开发者ID:monoman,项目名称:NugetCracker,代码行数:10,代码来源:Program.cs
示例10: Process
public void Process(string filePath, PackageInfo.NamedInstance inst)
{
var doc = XDocument.Load(filePath);
inst.Metadata = new PackageInfo.MetaData();
var pathToInstall = doc.Root.Element("PathToInstall");
if (pathToInstall != null)
{
inst.Metadata.FolderToInstall = pathToInstall.Value;
}
}
开发者ID:kbochenina,项目名称:Kraken,代码行数:10,代码来源:XmlMetadataProcessor.cs
示例11: Remove
/// <summary>
/// Removes an installed package from the system
/// </summary>
/// <param name="info"></param>
public void Remove(PackageInfo info, ICollection<string> repositories, Dictionary<string, string> parameters, string optionalScript)
{
Logger.Log(string.Format("Uninstalling application {0} version {1}", info.Name, info.Version));
ExecuteRemoveScript(info,parameters, optionalScript);
DeleteFiles(info,repositories);
Logger.Log(string.Format("Uninstalled application {0} version {1}", info.Name, info.Version));
}
开发者ID:BazookaDeploy,项目名称:Bazooka,代码行数:14,代码来源:PackageRemover.cs
示例12: Install
/// <summary>
/// Installs the package
/// </summary>
/// <param name="info">Package informations</param>
/// <param name="repositories">Repositories to use</param>
/// <param name="parameters">parameters to pass to the script</param>
/// <param name="installScript">Installation script to execute</param>
/// <param name="configFile">Name of the configuration file</param>
/// <param name="configTrasform">Configuration transform to apply</param>
public void Install(PackageInfo info, ICollection<string> repositories, Dictionary<string, string> parameters, string installScript, string configFile, string configTrasform)
{
Logger.Log(String.Format("Starting installation of {0} version {1} ... ", info.Name, info.Version));
DownloadPackage(info, repositories);
ApplyTransformations(info, configFile, configTrasform);
ExecuteInstallScript(info, parameters, installScript);
Logger.Log(String.Format("{0} version {1} Installed successfully ", info.Name, info.Version));
}
开发者ID:BazookaDeploy,项目名称:Bazooka,代码行数:21,代码来源:PackageInstaller.cs
示例13: WriteManifest
/// <summary>
/// Writes manifest.
/// </summary>
/// <param name="path">path</param>
/// <param name="filename">filename</param>
/// <param name="selectedResxFiles">List of object of FileDetails class. </param>
/// <param name="package">Objects of PackageInfo class.</param>
public static void WriteManifest(string path,string filename,List<FileDetails> selectedResxFiles,PackageInfo package)
{
XmlWriter writer = XmlWriter.Create(path + @"/" + filename + ".sfe",XMLUtils.GetXmlWriterSettings());
// Write first element
writer.WriteStartElement("sageframe");
writer.WriteAttributeString("type", "Package");
writer.WriteAttributeString("version", "1.0.0.1");
writer.WriteStartElement("packages");
WritePackageDetails(writer,selectedResxFiles,package);
// close writer
writer.Close();
}
开发者ID:xiaoxiaocoder,项目名称:AspxCommerce2.7,代码行数:20,代码来源:PackageWriterBase.cs
示例14: ConvertToPublic
static PackageInfo ConvertToPublic(PackageInfoInternal info)
{
if (info == null)
{
return null;
}
var newInfo = new PackageInfo();
newInfo.Name = info.Name;
newInfo.Path = info.Path;
newInfo.InstallInfo = ConvertToPublic(info.InstallInfo);
return newInfo;
}
开发者ID:Phrohdoh,项目名称:Projeny,代码行数:15,代码来源:PrjSerializer.cs
示例15: AssemblyPackageInfo
public AssemblyPackageInfo(Assembly assembly)
{
_manifest = new AssemblyPackageManifestFactory().Extract(assembly);
_inner = new Lazy<PackageInfo>(() =>
{
var inner = new PackageInfo(_manifest);
var exploder = BottleExploder.GetPackageExploder(new FileSystem());
exploder.ExplodeAssembly(PackageRegistry.GetApplicationDirectory(), assembly, inner);
return inner;
});
_assembly = assembly;
}
开发者ID:eatsleeptraincode,项目名称:crossfit204scoreboard,代码行数:15,代码来源:AssemblyPackageInfo.cs
示例16: Badging
internal Badging(FileInfo source, string dump)
{
this.source = source;
this.package = new PackageInfo();
this.application = new ApplicationInfo();
this.activity = new LaunchableActivity();
this.sdkVersion = "";
this.targetSdkVersion = "";
this.usesPermission = new List<string>();
this.densities = new List<int>();
ProcessDump(dump);
}
开发者ID:xXxTheDarkprogramerxXx,项目名称:AndroidLib-master,代码行数:16,代码来源:AAPT.Dump.cs
示例17: ExecuteRemoveScript
/// <summary>
/// Excutes the uninstall script
/// </summary>
/// <param name="installed">Installed package</param>
/// <param name="parameters">Parameters to pass to the script</param>
/// <param name="optionalScript">optional additiona script to execute</param>
private void ExecuteRemoveScript(PackageInfo installed, Dictionary<string, string> parameters, string optionalScript)
{
if (optionalScript != null && optionalScript.Trim().Length > 0)
{
Logger.Log("Executing uninstallation script specified as parameter...");
PowershellHelpers.ExecuteScript(installed.InstallationDirectory, optionalScript, Logger, parameters);
return;
}
if (File.Exists(Path.Combine(installed.InstallationDirectory, "Uninstall.ps1")))
{
Logger.Log("Executing uninstall script contained in package ... ");
PowershellHelpers.Execute(installed.InstallationDirectory, "Uninstall.ps1", installed.Configuration, Logger, parameters);
}
}
开发者ID:BazookaDeploy,项目名称:Bazooka,代码行数:22,代码来源:PackageRemover.cs
示例18: convertToPackage
private IPackageInfo convertToPackage(string directory)
{
var folder = _fileSystem.GetFullPath(directory);
var manifest = _fileSystem.LoadFromFile<HostManifest>(folder, HostManifest.CONTROL, HostManifest.FILE);
var package = new PackageInfo(manifest.Name)
{
Description = "{0} ({1})".ToFormat(manifest.Name, folder)
};
package.RegisterFolder("data", FileSystem.Combine(folder, HostManifest.DATA));
package.RegisterFolder("control", FileSystem.Combine(folder, HostManifest.CONTROL));
return package;
}
开发者ID:Memmo,项目名称:fubumvc,代码行数:16,代码来源:BottleHostLoader.cs
示例19: OpenNupkgStreamAsync
public static async Task<NupkgEntry> OpenNupkgStreamAsync(
HttpSource httpSource,
PackageInfo package,
TimeSpan cacheAgeLimit,
Reports reports)
{
for (int retry = 0; retry != 3; ++retry)
{
try
{
using (var data = await httpSource.GetAsync(
package.ContentUri,
cacheKey: $"nupkg_{package.Id}.{package.Version}",
cacheAgeLimit: retry == 0 ? cacheAgeLimit : TimeSpan.Zero,
ensureValidContents: stream => EnsureValidPackageContents(stream, package)))
{
return new NupkgEntry
{
TempFileName = data.CacheFileName
};
}
}
catch (Exception ex)
{
var isFinalAttempt = (retry == 2);
var message = ex.Message;
if (ex is TaskCanceledException)
{
message = ErrorMessageUtils.GetFriendlyTimeoutErrorMessage(ex as TaskCanceledException, isFinalAttempt, ignoreFailure: false);
}
if (isFinalAttempt)
{
reports.Error.WriteLine(
$"Error: DownloadPackageAsync: {package.ContentUri}{Environment.NewLine} {message}".Red().Bold());
throw;
}
else
{
reports.Information.WriteLine(
$"Warning: DownloadPackageAsync: {package.ContentUri}{Environment.NewLine} {message}".Yellow().Bold());
}
}
}
return null;
}
开发者ID:noahfalk,项目名称:dnx,代码行数:46,代码来源:PackageUtilities.cs
示例20: Execute
public void Execute(IPackage package, string packagePath)
{
try
{
var packageInfo = new PackageInfo
{
Package = package,
PackagePath = packagePath
};
Container.RegisterInstance<PackageInfo>(packageInfo, new ContainerControlledLifetimeManager());
MainViewModel.ShowDialog();
}
catch (Exception exception)
{
MessageBox.Show(exception.Message, "Error", MessageBoxButton.OK, MessageBoxImage.Error);
}
}
开发者ID:krdbigsa,项目名称:NuGetPackageExplorer.Plugins,代码行数:18,代码来源:DeletePackageCommand.cs
注:本文中的PackageInfo类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论