本文整理汇总了C#中IPackageInfo类的典型用法代码示例。如果您正苦于以下问题:C# IPackageInfo类的具体用法?C# IPackageInfo怎么用?C# IPackageInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IPackageInfo类属于命名空间,在下文中一共展示了IPackageInfo类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DeployDependency
public void DeployDependency(IPackageInfo resolvedPackage,
IPackagePublisher publisher)
{
var source = resolvedPackage.Load();
using (var packageStream = source.OpenStream())
publisher.Publish(resolvedPackage.FullName + ".wrap", packageStream);
}
示例2: ReadPackage
public void ReadPackage(IPackageInfo package, IPackageLog log)
{
_currentPackage = package;
//double dispatch - hard to follow - at the moment
package.LoadAssemblies(this);
}
示例3: LogAssembly
// TODO: Try to find the assembly file version here.
public void LogAssembly(IPackageInfo package, Assembly assembly, string provenance)
{
LogObject(assembly, provenance);
var packageLog = LogFor(package);
packageLog.Trace("Loaded assembly " + assembly.GetName().FullName);
packageLog.AddChild(assembly);
}
示例4: AddPackage
public void AddPackage(IPackageInfo package)
{
PackageButton button = new PackageButton("button" + buttons.Count, package);
button.Click += new EventHandler<MouseButtonEventArgs>(button_Click);
buttons.Add(button);
vScroll.Maximum = System.Math.Max(1, buttons.Count - maxVisibleButtons);
base.AddWidget(button);
VerifyButtons();
}
示例5: PackageInstaller
public PackageInstaller(string packagePath, string packageDataDirectory, string basePath, IPackageInfo package, IPackageLoader loader)
{
this.packagePath = packagePath;
this.packageDataDirectory = packageDataDirectory;
this.basePath = basePath;
this.package = package;
this.loader = loader;
packageZip = new ZipFile(packagePath);
}
示例6: VisitDependencyNode
bool VisitDependencyNode(IPackageInfo from, PackageDependency dependency, IPackageInfo to, PackageVisitor visitor, Dictionary<string,int> visitsLeft)
{
if (!visitor(from, dependency, to)) return false;
if (DecreaseVisitCount(visitsLeft, to.Name) <= 0)
{
foreach (var dependencyNode in to.Dependencies)
if (!VisitDependencyNode(to, dependencyNode, _byName[dependencyNode.Name], visitor, visitsLeft))
return false;
}
return true;
}
示例7: InMemoryPackage
public InMemoryPackage(IPackageInfo packageToCopy)
: this()
{
Created = packageToCopy.Created;
Dependencies = packageToCopy.Dependencies.ToList();
Anchored = packageToCopy.Anchored;
Description = packageToCopy.Description;
Name = packageToCopy.Name;
Nuked = packageToCopy.Nuked;
Source = packageToCopy.Source;
Title = packageToCopy.Title;
Version = packageToCopy.Version;
}
示例8: ResolveAllDependencies
IEnumerable<ResolvedDependency> ResolveAllDependencies(IPackageInfo parent, IEnumerable<WrapDependency> dependencies, IDictionary<string,string> dependencyOverrides, IEnumerable<IPackageRepository> repositories)
{
var packages = from dependency in dependencies
let package = repositories
.Where(x=> x != null)
.Select(x => x.Find(dependency))
.FirstOrDefault(x=>x != null)
select new ResolvedDependency { Dependency = dependency, Package = package, ParentPackage = parent };
foreach (var package in packages.Where(p=>p.Package != null))
packages = packages.Concat(ResolveAllDependencies(package.Package, package.Package.Dependencies, dependencyOverrides, repositories));
return packages.ToList();
}
示例9: PackageButton
public PackageButton(string name, IPackageInfo attachedPackage)
: base(name)
{
this.attachedPackage = attachedPackage;
this.Size = new Size(200, 50);
base.Font = Graphics.FontManager.LoadFont("tahoma", 12);
base.BackColor = Color.SteelBlue;
base.HighlightType = SdlDotNet.Widgets.HighlightType.Color;
base.HighlightColor = Color.LightSteelBlue;
installedSurf = Graphics.SurfaceManager.LoadSurface(IO.Paths.GfxPath + "Updater\\package-installed.png");
base.Text = attachedPackage.FullID;
base.Paint += new EventHandler(PackageButton_Paint);
}
示例10: LogAssembly
public void LogAssembly(IPackageInfo package, Assembly assembly, string provenance)
{
try
{
var assVer = getVersion(assembly);
LogObject(assembly, provenance);
var packageLog = LogFor(package);
packageLog.Trace("Loaded assembly '{0}' v{1}".ToFormat(assembly.GetName().FullName,assVer.FileVersion));
packageLog.AddChild(assembly);
}
catch (Exception ex)
{
throw new Exception("Trying to log assembly '{0}' in package '{1}' at {2}".ToFormat(assembly.FullName, package.Name, assembly.Location), ex);
}
}
示例11: LoadPackage
public void LoadPackage(byte[] assembly, IPackageInfo packageInfo)
{
if (packageAppDomain != null) {
Unload();
}
this.assemblyPath = assemblyPath;
string fileNamespace = packageInfo.FullID;
string dir = Path.GetDirectoryName(assemblyPath);
//AppDomainSetup setup = AppDomain.CurrentDomain.SetupInformation;
//setup.ApplicationBase = Environment.CurrentDirectory;
packageAppDomain = AppDomain.CreateDomain(fileNamespace, null);
// TODO: Load all the of the dependancies into memory too!
//this.packageAppDomain.Load()
Assembly loadedAssembly = this.packageAppDomain.Load(assembly);
this.package = this.packageAppDomain.CreateInstance(loadedAssembly.FullName, "UpdatePackage.UpdatePackage").Unwrap() as IUpdatePackage;
}
示例12: ExplodeAssembly
public void ExplodeAssembly(string applicationDirectory, Assembly assembly, IPackageInfo packageInfo)
{
var directory = BottleFiles.GetDirectoryForExplodedPackage(applicationDirectory, assembly.GetName().Name);
var request = new ExplodeRequest{
Directory = directory,
GetVersion = () => assembly.GetName().Version.ToString(),
LogSameVersion = () => ConsoleWriter.Write("Assembly {0} has already been 'exploded' onto disk".ToFormat(assembly.GetName().FullName)),
ExplodeAction = () => explodeAssembly(assembly, directory)
};
explode(request);
_fileSystem.ChildDirectoriesFor(directory).Each(child =>
{
var name = Path.GetFileName(child);
packageInfo.Files.RegisterFolder(name, child.ToFullPath());
});
}
示例13: VisitNodes
protected bool VisitNodes(IPackageInfo from, PackageDependency dependency, IPackageInfo to)
{
visited.Add(to);
return true;
}
示例14: LogPackage
public void LogPackage(IPackageInfo package, IPackageLoader loader)
{
LogObject(package, "Loaded by " + loader);
LogFor(loader).AddChild(package);
}
示例15: LogDuplicateAssembly
// just in log to package
public void LogDuplicateAssembly(IPackageInfo package, string assemblyName)
{
LogFor(package).Trace("Assembly '{0}' was ignored because it is already loaded".ToFormat(assemblyName));
}