本文整理汇总了C#中Mono.Cecil.AssemblyDefinition.IsSilverlight方法的典型用法代码示例。如果您正苦于以下问题:C# AssemblyDefinition.IsSilverlight方法的具体用法?C# AssemblyDefinition.IsSilverlight怎么用?C# AssemblyDefinition.IsSilverlight使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mono.Cecil.AssemblyDefinition
的用法示例。
在下文中一共展示了AssemblyDefinition.IsSilverlight方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetRepositoryAddress
private static string GetRepositoryAddress(AssemblyDefinition callingAssembly, AssemblyNameReference reference)
{
var builder = new StringBuilder();
builder.AppendFormat("/{0}/", callingAssembly.MainModule.Architecture.ToString());
if (reference.HasSilverlightToken() || callingAssembly.IsSilverlight())
builder.Append("Silverlight");
else
builder.Append(callingAssembly.MainModule.Runtime.ToString());
builder.AppendFormat("/assembly?name={0}", reference.Name);
builder.AppendFormat("&version={0}", reference.Version.ToString());
builder.AppendFormat("&token={0}", reference.GetPublicTokenKeyString());
builder.Append("&specificversion=false");
return builder.ToString();
}
示例2: BrowseAssembly
private void BrowseAssembly(object sender, RoutedEventArgs e)
{
var dialog = new OpenFileDialog { Filter = "Assembly Files(*.exe, *.dll)|*.exe;*.dll" };
if (dialog.ShowDialog() == false)
{
Definition = null;
DialogResult = false;
return;
}
Definition = AssemblyDefinition.ReadAssembly(dialog.File.OpenRead());
if (Definition == null) Debugger.Break();
if (Definition.FullName == _reference.FullName)
{
if (Definition.IsSilverlight())
StorageService.CacheSilverlightAssembly(dialog.File.Name, dialog.File.OpenRead());
else
StorageService.CacheNetAssembly(dialog.File.Name, dialog.File.OpenRead());
ApplicationModel.Current.AssemblyCache.AddAssembly(Definition);
DialogResult = true;
}
}
示例3: LoadOrReplaceAssembly
private void LoadOrReplaceAssembly(AssemblyDefinition definition, AssemblyStream source)
{
var assemblyView = new AssemblyNode(definition, source);
AddOrReplaceAssemblyView(definition.IsSilverlight() ? SilverlightAssemblies : NetAssemblies, assemblyView);
}
示例4: UnloadAssemblyView
private void UnloadAssemblyView(AssemblyDefinition definition)
{
var root = definition.IsSilverlight() ? SilverlightAssemblies : NetAssemblies;
var view = root.Items.OfType<TreeNode>().FirstOrDefault(item => item.Component == definition);
root.Items.Remove(view);
}
示例5: LoadAssembly
private void LoadAssembly(AssemblyDefinition definition, AssemblyStream source)
{
var node = new AssemblyNode(definition, source);
if (definition.IsSilverlight())
SilverlightAssemblies.Items.Add(node);
else
NetAssemblies.Items.Add(node);
}
示例6: LoadOrReplaceAssembly
private void LoadOrReplaceAssembly(AssemblyDefinition definition)
{
var assemblyView = new AssemblyNode(definition);
if (definition.IsSilverlight())
AddOrReplaceAssemblyView(SilverlightAssemblies, assemblyView);
else
AddOrReplaceAssemblyView(NetAssemblies, assemblyView);
}