本文整理汇总了C#中PackageDescriptor类的典型用法代码示例。如果您正苦于以下问题:C# PackageDescriptor类的具体用法?C# PackageDescriptor怎么用?C# PackageDescriptor使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PackageDescriptor类属于命名空间,在下文中一共展示了PackageDescriptor类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: when_finding_packages
protected void when_finding_packages(string dependency)
{
var dep = new PackageDescriptor();
((IPackageDescriptor)dep).Dependencies.Add(DependsParser.ParseDependsLine(dependency));
FoundPackage = Repository.PackagesByName.FindAll(dep.Dependencies.First()).FirstOrDefault();
}
示例2: when_finding_packages
protected void when_finding_packages(string dependency)
{
var dep = new PackageDescriptor();
new DependsParser().Parse(dependency, dep);
FoundPackage = Repository.FindAll(dep.Dependencies.First()).FirstOrDefault();
}
示例3: Parse
public void Parse(string line, PackageDescriptor descriptor)
{
var match = _regex.Match(line);
if (!match.Success)
return;
ParseContent(match.Groups["content"].Value, descriptor);
}
示例4: GetAssemblyReferences
public static IEnumerable<IAssemblyReferenceExportItem> GetAssemblyReferences(this IPackageResolver resolver,
bool includeContentOnly,
ExecutionEnvironment exec,
PackageDescriptor descriptor,
params IPackageRepository[] repositories)
{
return GetAssemblyReferences(resolver.TryResolveDependencies(descriptor, repositories), exec, includeContentOnly);
}
示例5: CleanProjectPackages
public IPackageCleanResult CleanProjectPackages(PackageDescriptor packages, IPackageRepository projectRepository, string name, PackageCleanOptions options = PackageCleanOptions.Default)
{
if (packages == null) throw new ArgumentNullException("packages");
if (projectRepository == null) throw new ArgumentNullException("projectRepository");
var repoForClean = projectRepository as ISupportCleaning;
if (repoForClean == null) throw new ArgumentException("projectRepository must implement ISupportCleaning");
return new PackageCleanResultIterator(CleanProjectPackagesCore(packages, repoForClean, x => name.EqualsNoCase(x)));
}
示例6: DefaultPackageInfo
public DefaultPackageInfo(string packageFileName, Version versionFileContent, PackageDescriptor descriptor)
{
_descriptor = descriptor;
_packageVersion = versionFileContent
?? descriptor.Version
?? PackageNameUtility.GetVersion(packageFileName);
_packageName = PackageNameUtility.GetName(packageFileName);
Identifier = new PackageIdentifier(Name, Version);
}
示例7: Lock
public static IPackageDescriptor Lock(this IPackageDescriptor descriptor, IPackageRepository repository, string scope = null)
{
scope = scope ?? string.Empty;
var lockedRepo = repository.Feature<ISupportLocking>();
if (lockedRepo == null)
return descriptor;
var lockedDescriptor = new PackageDescriptor(descriptor);
var lockedPackages = lockedRepo.LockedPackages[scope];
return Lock(lockedDescriptor, lockedPackages);
}
示例8: Write
public void Write(PackageDescriptor descriptor, Stream descriptorStream)
{
var streamWriter = new StreamWriter(descriptorStream, Encoding.UTF8);
var lines = from parser in _lineParsers
from parserLine in parser.Write(descriptor)
select parserLine;
var content = lines.Join("\r\n");
streamWriter.Write(content);
streamWriter.Flush();
}
示例9: InMemoryEnvironment
public InMemoryEnvironment(IDirectory currentDirectory, IDirectory configDirectory)
{
CurrentDirectory = currentDirectory;
SystemRepository = new InMemoryRepository("System repository");
RemoteRepository = new InMemoryRepository("Remote repository");
CurrentDirectoryRepository = new InMemoryRepository("Current directory repository");
RemoteRepositories = new List<InMemoryRepository> { RemoteRepository };
DescriptorFile = CurrentDirectory.GetFile("descriptor.wrapdesc");
Descriptor = new PackageDescriptor();
ConfigurationDirectory = configDirectory;
}
示例10: dependency_resolver_context
public dependency_resolver_context()
{
DependencyDescriptor = new PackageDescriptor
{
Name = "test",
SemanticVersion = "1.0".ToSemVer()
};
ProjectRepository = new InMemoryRepository("Local repository");
SystemRepository = new InMemoryRepository("System repository");
RemoteRepository = new InMemoryRepository("Remote repository");
CurrentDirectoryRepository = new InMemoryRepository("Current repository");
}
示例11: Read
public PackageDescriptor Read(Stream content)
{
var stringReader = new StreamReader(content, true);
var lines = stringReader.ReadToEnd().GetUnfoldedLines();
var descriptor = new PackageDescriptor();
foreach (var line in lines)
foreach (var parser in _lineParsers)
parser.Parse(line, descriptor);
return descriptor;
}
示例12: GenerateDescriptorFile
static PackageContent GenerateDescriptorFile(PackageDescriptor descriptor)
{
var descriptorStream = new MemoryStream();
new PackageDescriptorReaderWriter().Write(descriptor, descriptorStream);
return new PackageContent
{
FileName = descriptor.Name + ".wrapdesc",
RelativePath = ".",
Stream = descriptorStream.ResetOnRead(),
Size = descriptorStream.Length
};
}
示例13: InMemoryEnvironment
public InMemoryEnvironment(IDirectory currentDirectory, IDirectory configDirectory)
{
CurrentDirectory = currentDirectory;
SystemRepository = new InMemoryRepository("System repository");
RemoteRepository = new InMemoryRepository("Remote repository");
CurrentDirectoryRepository = new InMemoryRepository("Current directory repository");
RemoteRepositories = new List<InMemoryRepository> { RemoteRepository };
DescriptorFile = CurrentDirectory.GetFile("descriptor.wrapdesc").MustExist();
Descriptor = new PackageDescriptor();
ConfigurationDirectory = configDirectory;
ScopedDescriptors = new Dictionary<string, FileBased<IPackageDescriptor>>(StringComparer.OrdinalIgnoreCase);
ScopedDescriptors[string.Empty] = FileBased.New(DescriptorFile, Descriptor);
}
示例14: AddProjectPackage
public IPackageAddResult AddProjectPackage(PackageRequest packageToAdd,
IEnumerable<IPackageRepository> sourceRepositories,
PackageDescriptor projectDescriptor,
IPackageRepository projectRepository,
PackageAddOptions options = PackageAddOptions.Default)
{
Check.NotNull(packageToAdd, "packageToAdd");
Check.NoNullElements(sourceRepositories, "sourceRepositories");
Check.NotNull(projectDescriptor, "projectDescriptor");
Check.NotNull(projectRepository, "projectRepository");
return new PackageAddResultIterator(AddProjectPackageCore(packageToAdd, sourceRepositories, projectDescriptor, projectRepository, options));
}
示例15: GetPackage
/// <summary>
/// Retrieves a suitable package to put a certain type into.
/// </summary>
/// <param name="type">type for which a suitable package is desired</param>
/// <returns>suitable package</returns>
public PackageDescriptor GetPackage(Type type)
{
string pkgName = type.Namespace;
if (pkgName == null)
pkgName = "DefaultPackage";
PackageDescriptor pd;
if (!_pkgMap.TryGetValue(pkgName, out pd))
{
pd = new PackageDescriptor(pkgName);
}
_pkgMap[pkgName] = pd;
_design.AddChild(pd, pd.Name);
return pd;
}