本文整理汇总了C#中MonoDevelop.Core.Assemblies.TargetFramework类的典型用法代码示例。如果您正苦于以下问题:C# TargetFramework类的具体用法?C# TargetFramework怎么用?C# TargetFramework使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TargetFramework类属于MonoDevelop.Core.Assemblies命名空间,在下文中一共展示了TargetFramework类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetAssemblyLocation
public override string GetAssemblyLocation (string assemblyName, string package, TargetFramework fx)
{
string loc = base.GetAssemblyLocation (assemblyName, package, fx);
if (loc != null)
return loc;
string baseDirectory = AppDomain.CurrentDomain.BaseDirectory;
string name;
int i = assemblyName.IndexOf (',');
if (i == -1)
name = assemblyName;
else
name = assemblyName.Substring (0,i).Trim ();
// Look in initial path
if (!string.IsNullOrEmpty (baseDirectory)) {
string localPath = Path.Combine (baseDirectory, name);
if (File.Exists (localPath))
return localPath;
}
// Look in assembly directories
foreach (string path in GetAssemblyDirectories ()) {
string localPath = Path.Combine (path, name);
if (File.Exists (localPath))
return localPath;
}
// Look in the gac
return GetGacFile (assemblyName, true);
}
示例2: GetPackages
public IEnumerable<SystemPackage> GetPackages (TargetFramework fx)
{
foreach (IAssemblyContext ctx in sources) {
foreach (SystemPackage p in ctx.GetPackages (fx))
yield return p;
}
}
示例3: CreatePortableProfileViewModel
PortableProfileViewModel CreatePortableProfileViewModel (
TargetFramework fx,
IEnumerable<TargetFrameworkMoniker> selectedTargetFrameworks)
{
bool enabled = selectedTargetFrameworks.Contains (fx.Id);
return new PortableProfileViewModel (fx, enabled);
}
示例4: SupportsFramework
public override bool SupportsFramework (TargetFramework framework)
{
if (!framework.IsCompatibleWithFramework (TargetFrameworkMoniker.PORTABLE_4_0))
return false;
else
return base.SupportsFramework (framework);
}
示例5: SupportsFramework
public override bool SupportsFramework (TargetFramework framework)
{
// DotNetAssemblyProject can only generate assemblies for the regular framework.
// Special frameworks such as Moonlight or MonoTouch must subclass DotNetProject directly.
if (!framework.IsCompatibleWithFramework (TargetFrameworkMoniker.NET_1_1))
return false;
else
return base.SupportsFramework (framework);
}
示例6: MonoMacExecutionCommand
public MonoMacExecutionCommand (TargetRuntime runtime, TargetFramework framework, FilePath appPath,
FilePath launchScript, bool debugMode)
{
this.AppPath = appPath;
this.LaunchScript = launchScript;
this.Framework = framework;
this.Runtime = runtime;
this.DebugMode = debugMode;
}
示例7: PortableRuntimeOptionsPanelWidget
public PortableRuntimeOptionsPanelWidget(PortableDotNetProject project, IEnumerable<ItemConfiguration> configurations)
{
this.target = project.TargetFramework;
this.project = project;
this.Build ();
// Aggregate all SupportedFrameworks from .NETPortable TargetFrameworks
targetFrameworks = GetPortableTargetFrameworks ().ToList ();
targetFrameworks.Sort (CompareFrameworks);
supportedFrameworks = new SortedDictionary<string, List<SupportedFramework>> ();
if (!targetFrameworks.Contains (project.TargetFramework)) {
missingFramework = project.TargetFramework;
targetFrameworks.Insert (0, project.TargetFramework);
}
foreach (var fx in targetFrameworks) {
foreach (var sfx in fx.SupportedFrameworks) {
List<SupportedFramework> list;
if (!supportedFrameworks.TryGetValue (sfx.DisplayName, out list)) {
list = new List<SupportedFramework> ();
supportedFrameworks.Add (sfx.DisplayName, list);
}
list.Add (sfx);
}
}
// Now create a list of config options from our supported frameworks
options = new List<OptionCombo> ();
foreach (var fx in supportedFrameworks) {
var combo = new OptionCombo (fx.Key);
var dict = new SortedDictionary<string, OptionComboItem> ();
foreach (var sfx in fx.Value) {
var label = GetDisplayName (sfx);
OptionComboItem item;
if (!dict.TryGetValue (label, out item)) {
item = new OptionComboItem (label, sfx);
dict.Add (label, item);
}
item.Targets.Add (sfx.TargetFramework);
}
combo.Items = dict.Values.ToList ();
options.Add (combo);
}
CreateUI ();
CurrentProfileChanged (project.TargetFramework);
}
示例8: SupportsFramework
public override bool SupportsFramework (TargetFramework framework)
{
if (framework.Id.Identifier == TargetFrameworkMoniker.ID_PORTABLE && framework.Id.Version == "4.0")
return true;
if (!framework.CanReferenceAssembliesTargetingFramework (TargetFrameworkMoniker.PORTABLE_4_0))
return false;
return base.SupportsFramework (framework);
}
示例9: GetFxVersion
internal static string GetFxVersion (TargetFramework fx)
{
switch (fx.Id) {
case "SL2.0":
return "2.0";
case "SL3.0":
return "3.0";
default:
throw new InvalidOperationException ("Cannot handle unknown target framework '" + fx.Id +"'");
}
}
示例10: SupportedFramework
internal SupportedFramework (TargetFramework target)
{
MinimumVersionDisplayName = string.Empty;
MinimumVersion = NoMinumumVersion;
MaximumVersion = NoMaximumVersion;
DisplayName = string.Empty;
Identifier = string.Empty;
Profile = string.Empty;
TargetFramework = target;
}
示例11: MonoDroidExecutionCommand
public MonoDroidExecutionCommand (string packageName, FilePath apkPath,
TargetRuntime runtime, TargetFramework framework, bool debugMode)
{
this.PackageName = packageName;
this.ApkPath = apkPath;
this.Runtime = runtime;
this.Framework = framework;
this.DebugMode = debugMode;
DebugPort = MonoDroidSettings.DebuggerPort;
OutputPort = MonoDroidSettings.DebuggerOutputPort;
}
示例12: LoadFrom
public void LoadFrom (FilePath assemblyPath)
{
FileName = assemblyPath;
var tid = Runtime.SystemAssemblyService.GetTargetFrameworkForAssembly (Runtime.SystemAssemblyService.DefaultRuntime, assemblyPath);
if (tid != null)
targetFramework = Runtime.SystemAssemblyService.GetTargetFramework (tid);
AssemblyDefinition adef = AssemblyDefinition.ReadAssembly (assemblyPath);
MdbReaderProvider mdbProvider = new MdbReaderProvider ();
try {
ISymbolReader reader = mdbProvider.GetSymbolReader (adef.MainModule, assemblyPath);
adef.MainModule.ReadSymbols (reader);
} catch {
// Ignore
}
var files = new HashSet<FilePath> ();
foreach (TypeDefinition type in adef.MainModule.Types) {
foreach (MethodDefinition met in type.Methods) {
if (met.HasBody && met.Body.Instructions != null && met.Body.Instructions.Count > 0) {
SequencePoint sp = met.Body.Instructions[0].SequencePoint;
if (sp != null)
files.Add (sp.Document.Url);
}
}
}
FilePath rootPath = FilePath.Empty;
foreach (FilePath file in files) {
AddFile (file, BuildAction.Compile);
if (rootPath.IsNullOrEmpty)
rootPath = file.ParentDirectory;
else if (!file.IsChildPathOf (rootPath))
rootPath = FindCommonRoot (rootPath, file);
}
if (!rootPath.IsNullOrEmpty)
BaseDirectory = rootPath;
/*
foreach (AssemblyNameReference aref in adef.MainModule.AssemblyReferences) {
if (aref.Name == "mscorlib")
continue;
string asm = assemblyPath.ParentDirectory.Combine (aref.Name);
if (File.Exists (asm + ".dll"))
References.Add (new ProjectReference (ReferenceType.Assembly, asm + ".dll"));
else if (File.Exists (asm + ".exe"))
References.Add (new ProjectReference (ReferenceType.Assembly, asm + ".exe"));
else
References.Add (new ProjectReference (ReferenceType.Package, aref.FullName));
}*/
}
示例13: GetSystemWebDom
static ICompilation GetSystemWebDom (TargetRuntime runtime, TargetFramework targetFramework)
{
string file = runtime.AssemblyContext.GetAssemblyNameForVersion (sysWebAssemblyName, targetFramework);
if (string.IsNullOrEmpty (file))
throw new Exception ("System.Web assembly name not found for framework " + targetFramework.Id);
file = runtime.AssemblyContext.GetAssemblyLocation (file, targetFramework);
if (string.IsNullOrEmpty (file))
throw new Exception ("System.Web assembly file not found for framework " + targetFramework.Id);
var dom = new SimpleCompilation (TypeSystemService.LoadAssemblyContext (runtime, targetFramework, file));
if (dom == null)
throw new Exception ("System.Web parse database not found for framework " + targetFramework.Id + " file '" + file + "'");
return dom;
}
示例14: IPhoneExecutionCommand
public IPhoneExecutionCommand (TargetRuntime runtime, TargetFramework framework, FilePath appPath,
FilePath logDirectory, bool debugMode, IPhoneSimulatorTarget target,
IPhoneSdkVersion minimumOSVersion, TargetDevice supportedDevices)
{
this.AppPath = appPath;
this.LogDirectory = logDirectory;
this.Framework = framework;
this.Runtime = runtime;
this.DebugMode = debugMode;
this.SimulatorTarget = target;
this.MinimumOSVersion = minimumOSVersion;
this.SupportedDevices = supportedDevices;
}
示例15: GetSystemWebDom
static ProjectDom GetSystemWebDom (TargetRuntime runtime, TargetFramework targetFramework)
{
string file = runtime.AssemblyContext.GetAssemblyNameForVersion (sysWebAssemblyName, targetFramework);
if (string.IsNullOrEmpty (file))
throw new Exception ("System.Web assembly name not found for framework " + targetFramework.Id);
file = runtime.AssemblyContext.GetAssemblyLocation (file, targetFramework);
if (string.IsNullOrEmpty (file))
throw new Exception ("System.Web assembly file not found for framework " + targetFramework.Id);
ProjectDom dom = ProjectDomService.GetAssemblyDom (runtime, file);
if (dom == null)
throw new Exception ("System.Web parse database not found for framework " + targetFramework.Id + " file '" + file + "'");
return dom;
}