本文整理汇总了C#中FrameworkVersion类的典型用法代码示例。如果您正苦于以下问题:C# FrameworkVersion类的具体用法?C# FrameworkVersion怎么用?C# FrameworkVersion使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
FrameworkVersion类属于命名空间,在下文中一共展示了FrameworkVersion类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Framework
public Framework this[FrameworkVersion version]
{
get
{
return new Framework(version);
}
}
示例2: Create
public static UpdateInfo Create(ReleaseEntry currentVersion, IEnumerable<ReleaseEntry> availableReleases, string packageDirectory, FrameworkVersion appFrameworkVersion)
{
Contract.Requires(availableReleases != null);
Contract.Requires(!String.IsNullOrEmpty(packageDirectory));
var latestFull = availableReleases.MaxBy(x => x.Version).FirstOrDefault(x => !x.IsDelta);
if (latestFull == null) {
throw new Exception("There should always be at least one full release");
}
if (currentVersion == null) {
return new UpdateInfo(currentVersion, new[] { latestFull }, packageDirectory, appFrameworkVersion);
}
if (currentVersion.Version == latestFull.Version) {
return new UpdateInfo(currentVersion, Enumerable.Empty<ReleaseEntry>(), packageDirectory, appFrameworkVersion);
}
var newerThanUs = availableReleases.Where(x => x.Version > currentVersion.Version)
.OrderBy(v => v.Version);
var deltasSize = newerThanUs.Where(x => x.IsDelta).Sum(x => x.Filesize);
return (deltasSize < latestFull.Filesize && deltasSize > 0)
? new UpdateInfo(currentVersion, newerThanUs.Where(x => x.IsDelta).ToArray(), packageDirectory, appFrameworkVersion)
: new UpdateInfo(currentVersion, new[] { latestFull }, packageDirectory, appFrameworkVersion);
}
示例3: UpdateManager
public UpdateManager(string urlOrPath,
string applicationName,
FrameworkVersion appFrameworkVersion,
string rootDirectory = null,
IFileDownloader urlDownloader = null)
{
Contract.Requires(!String.IsNullOrEmpty(urlOrPath));
Contract.Requires(!String.IsNullOrEmpty(applicationName));
updateUrlOrPath = urlOrPath;
this.applicationName = applicationName;
this.appFrameworkVersion = appFrameworkVersion;
this.urlDownloader = urlDownloader ?? new FileDownloader();
if (rootDirectory != null) {
this.rootAppDirectory = Path.Combine(rootDirectory, applicationName);
return;
}
// Determine the rootAppDirectory in such a way so that Portable
// Apps are more likely to work
var entry = Assembly.GetEntryAssembly();
if (entry != null) {
rootDirectory = Path.GetFullPath(Path.Combine(Path.GetDirectoryName(entry.Location), "..", ".."));
}
this.rootAppDirectory = Path.Combine(rootDirectory ?? getLocalAppDataDirectory(), applicationName);
}
示例4: GetReferencedAssemblies
public static List<string> GetReferencedAssemblies(FrameworkVersion frameworkVersion)
{
switch (frameworkVersion)
{
case FrameworkVersion.Version11:
break;
case FrameworkVersion.Version20:
break;
case FrameworkVersion.Version30:
break;
case FrameworkVersion.Version35:
break;
case FrameworkVersion.Version40:
break;
}
List<string> collection = new List<string>();
//string[] list = new string[] { "MicroSoft.VisualBasic.dll", "System.dll", "System.Data.dll", "System.xml.dll", "System.Windows.Forms.dll"};
//collection.AddRange(list);
//collection.Add(Path.GetFileName(typeof(CodeCompilerFactory).Assembly.Location));
//collection.Add(Path.GetFileName(System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName));
foreach (Assembly asm in AppDomain.CurrentDomain.GetAssemblies())
{
collection.Add(asm.Location);
}
return collection;
}
示例5: DetectFrameworkVersion
public void DetectFrameworkVersion(string packageName, FrameworkVersion expected)
{
var path = IntegrationTestHelper.GetPath("fixtures", packageName);
var zip = new ZipPackage(path);
Assert.Equal(expected, zip.DetectFrameworkVersion());
}
示例6: PathToBuildTool
public string PathToBuildTool(IPackageTree packageTree, FrameworkVersion version)
{
var path = Path.Combine(packageTree.Root.CurrentDirectory.FullName, "buildengines");
path = Path.Combine(path, "Phantom");
path = Path.Combine(path, "Phantom.exe");
return new FileInfo(path).FullName;
}
示例7: ShimmerConfiguration
public ShimmerConfiguration(string applicationName, string url, string projectName = null, FrameworkVersion frameworkVersion = FrameworkVersion.Net45)
{
this.projectName = projectName;
ApplicationName = applicationName;
FrameworkVersion = frameworkVersion;
UrlOrPath = !SystemInspector.Debugger.IsAttached ? CompleteUrl(url) : UrlOrDebugPath(url);
}
示例8: CommandLineArguments
public string CommandLineArguments(string pathToBuildFile, BuildEngine buildEngine, IPackageTree packageTree, FrameworkVersion version)
{
Console.WriteLine(pathToBuildFile);
Console.WriteLine(buildEngine);
Console.WriteLine(packageTree);
Console.WriteLine(version);
return string.Empty;
}
示例9: UpdateInfo
protected UpdateInfo(ReleaseEntry currentlyInstalledVersion, IEnumerable<ReleaseEntry> releasesToApply, string packageDirectory, FrameworkVersion appFrameworkVersion)
{
// NB: When bootstrapping, CurrentlyInstalledVersion is null!
CurrentlyInstalledVersion = currentlyInstalledVersion;
ReleasesToApply = releasesToApply ?? Enumerable.Empty<ReleaseEntry>();
FutureReleaseEntry = ReleasesToApply.MaxBy(x => x.Version).FirstOrDefault();
AppFrameworkVersion = appFrameworkVersion;
this.packageDirectory = packageDirectory;
}
示例10: GetFrameworkVersionForBuildTool
public string GetFrameworkVersionForBuildTool(FrameworkVersion version)
{
switch (version)
{
case FrameworkVersion.FrameworkVersion2:
return "2.0";
case FrameworkVersion.FrameworkVersion35:
return "3.5";
}
throw new InvalidEnumArgumentException("Invalid Framework Version", (int)version, typeof(FrameworkVersion));
}
示例11: GetFrameworkVersionForBuildTool
public string GetFrameworkVersionForBuildTool(FrameworkVersion version)
{
switch (version)
{
case FrameworkVersion.FrameworkVersion2:
return "v2.0";
case FrameworkVersion.FrameworkVersion35:
return "v3.5";
default:
throw new ArgumentException(string.Format("Unknown framework Version: {0}", version));
}
}
示例12: BuildEngine
public BuildEngine(IBuildTool buildTool, string buildFile, FrameworkVersion version, IDependencyDispatcher dependencyDispatcher)
{
BuildTool = buildTool;
BuildFile = buildFile;
Version = version;
Dependencies = new List<Dependency>();
Exclusions = new List<string>();
this.dependencyDispatcher = dependencyDispatcher;
Modes = new Dictionary<string, IModeSettings>();
var defaultMode = new ModeSettings( DefaultModeName );
Modes.Add( DefaultModeName, defaultMode );
CurrentModeSettings = defaultMode;
}
示例13: MethodWriter
public MethodWriter(GenerationManifest artifacts, FrameworkVersion version, MethodInfoWrapper methodInfo)
: base(artifacts, version, methodInfo)
{
this._methodInfo = methodInfo;
// true when this is an Async method and the unity version is present
this._unityVersionOfAsyncExists = NDocUtilities.FindDocumentationUnityAsync(Artifacts.NDocForPlatform("unity"), methodInfo) != null;
// refer to asynchronous versions if the synchronous version doesn't exist but the async version does
this._referAsyncAlternativeUnity = (NDocUtilities.FindDocumentationUnityAsyncAlternative(Artifacts.NDocForPlatform("unity"), methodInfo) != null) &&
(Artifacts.NDocForPlatform("unity") != null) &&
(NDocUtilities.FindDocumentation(Artifacts.NDocForPlatform("unity"), methodInfo) == null);
this._referAsyncAlternativePCL = (NDocUtilities.FindDocumentationPCLAsyncAlternative(Artifacts.NDocForPlatform("pcl"), methodInfo) != null) &&
(Artifacts.NDocForPlatform("pcl") != null) &&
(NDocUtilities.FindDocumentation(Artifacts.NDocForPlatform("pcl"), methodInfo) == null);
}
示例14: GeneratorProjectInfo
private GeneratorProjectInfo(string target, string @out, IProjectGenerationError error)
{
this.Target = target;
this.Out = @out;
this.Language = CSharp.GetLanguage(CSharpVersion.V4);
this.VisualStudioVersion = VisualStudioVersion.VS2013;
this.frameworkVersion = FrameworkVersion.v4_5_2;
this.IsDefaultFrameworkVersion = true;
this.AddDocumentation = true;
this.RenameInvalidMembers = true;
this.Error = error;
}
示例15: CommandLineArguments
public string CommandLineArguments(string pathToBuildFile, BuildEngine buildEngine, IPackageTree packageTree,
FrameworkVersion version)
{
var cmdLine = new StringBuilder();
cmdLine.AppendFormat(
"{0} /p:OutputPath=\"{1}\" /p:TargetFrameworkVersion={2} /p:NoWarn=1591 /consoleloggerparameters:Summary",
pathToBuildFile.QuotePath(), Path.Combine(packageTree.WorkingDirectory.FullName, buildEngine.BuildRootDirectory),
GetFrameworkVersionForBuildTool(version));
AppendTasks(buildEngine, cmdLine);
AppendParameters(buildEngine, cmdLine);
return cmdLine.ToString();
}