本文整理汇总了C#中ProcessorArchitecture类的典型用法代码示例。如果您正苦于以下问题:C# ProcessorArchitecture类的具体用法?C# ProcessorArchitecture怎么用?C# ProcessorArchitecture使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ProcessorArchitecture类属于命名空间,在下文中一共展示了ProcessorArchitecture类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: GetFrameworkPath
private static string GetFrameworkPath(
string subfolder, ProcessorArchitecture architecture, string windowsFolder, bool is64BitOperatingSystem)
{
Guard.AgainstNullArgument("windowsFolder", windowsFolder);
switch (architecture)
{
case ProcessorArchitecture.None:
case ProcessorArchitecture.MSIL:
return is64BitOperatingSystem
? Path.Combine(windowsFolder, "Microsoft.NET", "Framework64", subfolder, "MSBuild.exe")
: Path.Combine(windowsFolder, "Microsoft.NET", "Framework", subfolder, "MSBuild.exe");
case ProcessorArchitecture.X86:
return Path.Combine(windowsFolder, "Microsoft.NET", "Framework", subfolder, "MSBuild.exe");
case ProcessorArchitecture.Amd64:
return Path.Combine(windowsFolder, "Microsoft.NET", "Framework64", subfolder, "MSBuild.exe");
default:
var message = string.Format(
CultureInfo.InvariantCulture,
"MSBuild processor architecture '{0}' is not supported.",
architecture.ToString());
throw new NotSupportedException(message);
}
}
开发者ID:modulexcite,项目名称:bau-msbuild,代码行数:27,代码来源:MSBuild.GetPath.cs
示例2: InterpreterConfiguration
/// <summary>
/// <para>Constructs a new interpreter configuration based on the
/// provided values.</para>
/// <para>No validation is performed on the parameters.</para>
/// <para>If winPath is null or empty,
/// <see cref="WindowsInterpreterPath"/> will be set to path.</para>
/// <para>If libraryPath is null or empty and prefixPath is a valid
/// file system path, <see cref="LibraryPath"/> will be set to
/// prefixPath plus "Lib".</para>
/// </summary>
public InterpreterConfiguration(
string prefixPath,
string path,
string winPath,
string libraryPath,
string pathVar,
ProcessorArchitecture arch,
Version version,
InterpreterUIMode uiMode
) {
_prefixPath = prefixPath;
_interpreterPath = path;
_windowsInterpreterPath = string.IsNullOrEmpty(winPath) ? path : winPath;
_libraryPath = libraryPath;
if (string.IsNullOrEmpty(_libraryPath) && !string.IsNullOrEmpty(_prefixPath)) {
try {
_libraryPath = Path.Combine(_prefixPath, "Lib");
} catch (ArgumentException) {
}
}
_pathEnvironmentVariable = pathVar;
_architecture = arch;
_version = version;
Debug.Assert(string.IsNullOrEmpty(_interpreterPath) || !string.IsNullOrEmpty(_prefixPath),
"Anyone providing an interpreter should also specify the prefix path");
_uiMode = uiMode;
}
开发者ID:wenh123,项目名称:PTVS,代码行数:37,代码来源:InterpreterConfiguration.cs
示例3: FormatArchitecture
private static string FormatArchitecture(ProcessorArchitecture arch) {
switch (arch) {
case ProcessorArchitecture.Amd64: return "x64";
case ProcessorArchitecture.X86: return "x86";
default: return "Unknown";
}
}
开发者ID:wenh123,项目名称:PTVS,代码行数:7,代码来源:InterpreterOptions.cs
示例4: CPythonInterpreterConfiguration
public CPythonInterpreterConfiguration(string pythonPath, string pythonwPath, string pathEnvVar, ProcessorArchitecture arch, Version version) {
_pythonPath = pythonPath;
_pythonwPath = pythonwPath;
_arch = arch;
_version = version;
_pathEnvVar = pathEnvVar;
}
开发者ID:wenh123,项目名称:PTVS,代码行数:7,代码来源:CPythonInterpreterConfiguration.cs
示例5: ClientInformation
public ClientInformation()
{
m_operatingSys = OperatingSystem.Win;
m_architecture = ProcessorArchitecture.x86;
Locale = ClientLocale.English;
TimeZone = 0x258;
IPAddress = new XmlIPAddress(System.Net.IPAddress.Loopback);
}
开发者ID:Jeroz,项目名称:WCell,代码行数:8,代码来源:ClientInformation.cs
示例6: CJInterpreterConfiguration
public CJInterpreterConfiguration(string jPath, string jvPath, string pathEnvVar, ProcessorArchitecture arch, Version version)
{
_jPath = jPath;
_jvPath = jvPath;
_arch = arch;
_version = version;
_pathEnvVar = pathEnvVar;
}
开发者ID:borota,项目名称:JTVS,代码行数:8,代码来源:CJInterpreterConfiguration.cs
示例7: CJInterpreterFactory
public CJInterpreterFactory(Version version, Guid id, string description, string jPath, string jvPath, string pathEnvVar, ProcessorArchitecture arch)
{
if (version == default(Version)) {
version = new Version(6, 0, 2);
}
_description = description;
_id = id;
_config = new CJInterpreterConfiguration(jPath, jvPath, pathEnvVar, arch, version);
}
开发者ID:borota,项目名称:JTVS,代码行数:9,代码来源:CJInterpreterFactory.cs
示例8: DiagResult
/// <summary>
/// Initializes a new instance of the <see cref="CyrusBuilt.MonoPluginFramework.Diagnostics.DiagResult"/>
/// class with the result values.
/// </summary>
/// <param name="exists">
/// Set true if the plugin assembly exists.
/// </param>
/// <param name="valid">
/// Set true if the plugin is valid (compatible with this framework).
/// </param>
/// <param name="isAssm">
/// The inspected file is a Mono/.NET assembly.
/// </param>
/// <param name="reasonInvalid">
/// The reason the plugin is not valid.
/// </param>
/// <param name="ver">
/// The plugin version.
/// </param>
/// <param name="pa">
/// The plugin processor architecture.
/// </param>
public DiagResult(Boolean exists, Boolean valid, Boolean isAssm, String reasonInvalid,
Version ver, ProcessorArchitecture pa)
{
this._exists = exists;
this._isValid = valid;
this._isAssembly = isAssm;
this._reasonNotValid = reasonInvalid;
this._assemblyVersion = ver;
this._arch = pa;
}
开发者ID:CodeFork,项目名称:MonoPluginFramework,代码行数:32,代码来源:DiagResult.cs
示例9: Resolver
protected Resolver(string searchPathElement, GetAssemblyName getAssemblyName, Microsoft.Build.Shared.FileExists fileExists, GetAssemblyRuntimeVersion getRuntimeVersion, Version targetedRuntimeVesion, ProcessorArchitecture targetedProcessorArchitecture, bool compareProcessorArchitecture)
{
this.searchPathElement = searchPathElement;
this.getAssemblyName = getAssemblyName;
this.fileExists = fileExists;
this.getRuntimeVersion = getRuntimeVersion;
this.targetedRuntimeVersion = targetedRuntimeVesion;
this.targetProcessorArchitecture = targetedProcessorArchitecture;
this.compareProcessorArchitecture = compareProcessorArchitecture;
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:10,代码来源:Resolver.cs
示例10: FindVC
private static VCCompiler FindVC(string version, ProcessorArchitecture arch) {
string vcDir = null, vsDir = null;
using (var baseKey = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry32))
using (var key1 = baseKey.OpenSubKey("SOFTWARE\\Microsoft\\VisualStudio\\SxS\\VC7"))
using (var key2 = baseKey.OpenSubKey("SOFTWARE\\Microsoft\\VisualStudio\\SxS\\VS7")) {
if (key1 != null) {
vcDir = key1.GetValue(version) as string;
}
if (key2 != null) {
vsDir = key2.GetValue(version) as string;
}
}
if (string.IsNullOrEmpty(vcDir)) {
using (var baseKey = RegistryKey.OpenBaseKey(RegistryHive.CurrentUser, RegistryView.Registry32))
using (var key = baseKey.OpenSubKey("SOFTWARE\\Microsoft\\DevDiv\\VCForPython\\" + version)) {
if (key != null) {
vcDir = key.GetValue("InstallDir") as string;
}
}
}
if (string.IsNullOrEmpty(vcDir)) {
using (var baseKey = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry32))
using (var key = baseKey.OpenSubKey("SOFTWARE\\Microsoft\\DevDiv\\VCForPython\\" + version)) {
if (key != null) {
vcDir = key.GetValue("InstallDir") as string;
}
}
}
if (string.IsNullOrEmpty(vcDir)) {
return null;
}
string bin = Path.Combine(vcDir, "bin"), bins = bin;
if (arch == ProcessorArchitecture.Amd64) {
bin = Path.Combine(bin, "x86_amd64");
bins = bin + ";" + bins;
}
if (!string.IsNullOrEmpty(vsDir)) {
bins += ";" + vsDir;
}
string include = Path.Combine(vcDir, "include");
string lib = Path.Combine(vcDir, "lib");
if (arch == ProcessorArchitecture.Amd64) {
lib = Path.Combine(lib, "amd64");
}
AddWindowsSdk(version, arch, ref include, ref lib);
return new VCCompiler(bin, bins, include, lib);
}
开发者ID:CforED,项目名称:Node.js-Tools-for-Visual-Studio,代码行数:55,代码来源:VCCompiler.cs
示例11: GetLocation
internal static string GetLocation(AssemblyNameExtension strongName, ProcessorArchitecture targetProcessorArchitecture, GetAssemblyRuntimeVersion getRuntimeVersion, Version targetedRuntimeVersion, bool fullFusionName, Microsoft.Build.Shared.FileExists fileExists, GetPathFromFusionName getPathFromFusionName, GetGacEnumerator getGacEnumerator, bool specificVersion)
{
string str = null;
if (((strongName.GetPublicKeyToken() == null) || (strongName.GetPublicKeyToken().Length == 0)) && (strongName.FullName.IndexOf("PublicKeyToken", StringComparison.OrdinalIgnoreCase) != -1))
{
return str;
}
getPathFromFusionName = getPathFromFusionName ?? pathFromFusionName;
getGacEnumerator = getGacEnumerator ?? gacEnumerator;
if (!strongName.HasProcessorArchitectureInFusionName)
{
if ((targetProcessorArchitecture != ProcessorArchitecture.MSIL) && (targetProcessorArchitecture != ProcessorArchitecture.None))
{
string str2 = ResolveAssemblyReference.ProcessorArchitectureToString(targetProcessorArchitecture);
if (fullFusionName)
{
str = CheckForFullFusionNameInGac(strongName, str2, getPathFromFusionName);
}
else
{
str = GetLocationImpl(strongName, str2, getRuntimeVersion, targetedRuntimeVersion, fileExists, getPathFromFusionName, getGacEnumerator, specificVersion);
}
if ((str != null) && (str.Length > 0))
{
return str;
}
}
if (fullFusionName)
{
str = CheckForFullFusionNameInGac(strongName, "MSIL", getPathFromFusionName);
}
else
{
str = GetLocationImpl(strongName, "MSIL", getRuntimeVersion, targetedRuntimeVersion, fileExists, getPathFromFusionName, getGacEnumerator, specificVersion);
}
if ((str != null) && (str.Length > 0))
{
return str;
}
}
if (fullFusionName)
{
str = CheckForFullFusionNameInGac(strongName, null, getPathFromFusionName);
}
else
{
str = GetLocationImpl(strongName, null, getRuntimeVersion, targetedRuntimeVersion, fileExists, getPathFromFusionName, getGacEnumerator, specificVersion);
}
if ((str != null) && (str.Length > 0))
{
return str;
}
return null;
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:54,代码来源:GlobalAssemblyCache.cs
示例12: GetConfiguration
private static InterpreterConfiguration GetConfiguration(ProcessorArchitecture arch) {
var prefixPath = IronPythonResolver.GetPythonInstallDir();
return new InterpreterConfiguration(
prefixPath,
Path.Combine(prefixPath, arch == ProcessorArchitecture.Amd64 ? "ipy64.exe" : "ipy.exe"),
Path.Combine(prefixPath, arch == ProcessorArchitecture.Amd64 ? "ipyw64.exe" : "ipyw.exe"),
Path.Combine(prefixPath, "Lib"),
"IRONPYTHONPATH",
arch,
new Version(2, 7));
}
开发者ID:omnimark,项目名称:PTVS,代码行数:11,代码来源:IronPythonInterpreterFactory.cs
示例13: RegisterInterpreters
private void RegisterInterpreters(HashSet<string> registeredPaths, RegistryKey python, ProcessorArchitecture? arch) {
foreach (var key in python.GetSubKeyNames()) {
Version version;
if (Version.TryParse(key, out version)) {
if (version.Major == 2 && version.Minor <= 4) {
// 2.4 and below not supported.
continue;
}
var installPath = python.OpenSubKey(key + "\\InstallPath");
if (installPath != null) {
var basePathObj = installPath.GetValue("");
if (basePathObj == null) {
// http://pytools.codeplex.com/discussions/301384
// messed up install, we don't know where it lives, we can't use it.
continue;
}
string basePath = basePathObj.ToString();
if (basePath.IndexOfAny(Path.GetInvalidPathChars()) != -1) {
// Invalid path in registry
continue;
}
if (!registeredPaths.Add(basePath)) {
// registered in both HCKU and HKLM
continue;
}
var actualArch = arch;
if (!actualArch.HasValue) {
actualArch = NativeMethods.GetBinaryType(Path.Combine(basePath, "python.exe"));
}
var id = _cpyInterpreterGuid;
var description = "Python";
if (actualArch == ProcessorArchitecture.Amd64) {
id = _cpy64InterpreterGuid;
description = "Python 64-bit";
}
_interpreters.Add(
new CPythonInterpreterFactory(
version,
id,
description,
Path.Combine(basePath, "python.exe"),
Path.Combine(basePath, "pythonw.exe"),
"PYTHONPATH",
actualArch ?? ProcessorArchitecture.None
)
);
}
}
}
}
开发者ID:wenh123,项目名称:PTVS,代码行数:54,代码来源:CPythonInterpreterFactoryProvider.cs
示例14: UpdateChecker
public UpdateChecker(
Version applicationVersion,
ProcessorArchitecture processorArchitecture,
string variant,
IUpdateNotificationClient updateNotificationClient)
{
this.applicationVersion = applicationVersion;
this.processorArchitecture = processorArchitecture;
this.variant = variant;
this.updateNotificationClient = updateNotificationClient;
}
开发者ID:johnhk,项目名称:SyncTrayzor,代码行数:11,代码来源:UpdateChecker.cs
示例15: FormatForUserAgent
/// <summary>
/// Format a ProcessorArchitecture as it would be expected in a user agent of a browser.
/// </summary>
/// <returns>String containing the format processor architecture.</returns>
private static string FormatForUserAgent(ProcessorArchitecture architecture)
{
switch (architecture)
{
case ProcessorArchitecture.AMD64:
return "x64";
case ProcessorArchitecture.ARM:
return "ARM";
default:
return "";
}
}
开发者ID:TechSmith,项目名称:CSharpAnalytics,代码行数:16,代码来源:WindowsStoreSystemInformation.cs
示例16: Dependency
/// <summary>
/// Initializes a new instance of <see cref="Dependency"/>.
/// </summary>
/// <param name="name">The assembly name.</param>
/// <param name="verson">The asembly version.</param>
/// <param name="culture">The assembly culture.</param>
/// <param name="architecture">The compatible architecture of the assembly.</param>
public Dependency(string name, Version version, CultureInfo culture, ProcessorArchitecture architecture)
{
// Input validation
Ensure.That(name, "name").IsNotNullOrWhiteSpace();
Ensure.That(version, "version").IsNotNull();
Ensure.That(culture, "culture").IsNotNull();
// Initializes
this.Name = name;
this.Version = version;
this.Culture = culture;
this.Architecture = architecture;
}
开发者ID:defrancea,项目名称:fadm,代码行数:20,代码来源:Dependency.cs
示例17: Check
public override void Check()
{
var architectures = new Dictionary<string, ProcessorArchitecture>();
var architecture = Assembly.GetExecutingAssembly().GetName().ProcessorArchitecture;
var exes = AppHelper.GetFiles(".", "*.exe");
// Exclude x360ce files.
exes = exes.Where(x => !x.ToLower().Contains("x360ce")).ToArray();
// If single executable was found then...
if (exes.Length == 1 && CheckFile)
{
CheckFile = false;
// Update current settings file.
MainForm.Current.Invoke((Action)delegate ()
{
MainForm.Current.GameSettingsPanel.ProcessExecutable(exes[0]);
});
}
foreach (var exe in exes)
{
var pa = Engine.Win32.PEReader.GetProcessorArchitecture(exe);
architectures.Add(exe, pa);
}
var fi = new FileInfo(Application.ExecutablePath);
// Select all architectures of executables.
var archs = architectures.Select(x => x.Value).ToArray();
var x86Count = archs.Count(x => x == ProcessorArchitecture.X86);
var x64Count = archs.Count(x => x == ProcessorArchitecture.Amd64);
// If executables are 32-bit, but this program is 64-bit then...
if (x86Count > 0 && x64Count == 0 && architecture == ProcessorArchitecture.Amd64)
{
Description = "This folder contains 32-bit game. You should use 32-bit X360CE Application:\r\n" +
"http://www.x360ce.com/Files/x360ce.zip";
_architecture = ProcessorArchitecture.X86;
FixName = "Download";
Severity = IssueSeverity.Moderate;
return;
}
// If executables are 64-bit, but this program is 32-bit then...
if (x64Count > 0 && x86Count == 0 && architecture == ProcessorArchitecture.X86)
{
Description = "This folder contains 64-bit game. You should use 64-bit X360CE Application:\r\n" +
"http://www.x360ce.com/Files/x360ce_x64.zip";
_architecture = ProcessorArchitecture.Amd64;
FixName = "Download";
Severity = IssueSeverity.Moderate;
return;
}
Severity = IssueSeverity.None;
}
开发者ID:Grommini,项目名称:x360ce,代码行数:49,代码来源:ArchitectureIssue.cs
示例18: ProfiledProcess
public ProfiledProcess(string exe, string interpreterArgs, string script, string scriptArgs, string dir, Dictionary<string, string> envVars, ProcessorArchitecture arch, string launchUrl, int? port, bool startBrowser, bool justMyCode) {
if (arch != ProcessorArchitecture.X86 && arch != ProcessorArchitecture.Amd64) {
throw new InvalidOperationException(String.Format("Unsupported architecture: {0}", arch));
}
if (dir.EndsWith("\\")) {
dir = dir.Substring(0, dir.Length - 1);
}
if (String.IsNullOrEmpty(dir)) {
// run from where the script is by default (the UI enforces this)
Debug.Assert(Path.IsPathRooted(script));
dir = Path.GetDirectoryName(script);
}
_exe = exe;
_args = interpreterArgs;
_dir = dir;
_arch = arch;
_launchUrl = launchUrl;
_port = port;
_startBrowser = startBrowser;
_justMyCode = justMyCode;
var processInfo = new ProcessStartInfo(_exe);
processInfo.WorkingDirectory = dir;
processInfo.CreateNoWindow = false;
processInfo.UseShellExecute = false;
processInfo.RedirectStandardOutput = false;
if (_startBrowser && _port == null) {
_port = GetFreePort();
}
if (_port != null) {
if (envVars == null) {
envVars = new Dictionary<string, string>();
}
envVars["PORT"] = port.ToString();
}
if (envVars != null) {
foreach (var keyValue in envVars) {
processInfo.EnvironmentVariables[keyValue.Key] = keyValue.Value;
}
}
processInfo.Arguments = String.Format("{1} --prof \"{0}\" {2}", script, interpreterArgs, scriptArgs);
_process = new Process();
_process.StartInfo = processInfo;
}
开发者ID:CforED,项目名称:Node.js-Tools-for-Visual-Studio,代码行数:48,代码来源:ProfiledProcess.cs
示例19: DeterminesFrameworkFolderPerArchitecture
public static void DeterminesFrameworkFolderPerArchitecture(
ProcessorArchitecture architecture, bool is64BitOperatingSystem, bool expect64Bit)
{
// arrange
var root = "root";
var msbuild = new Derived { MSBuildVersion = "net45", MSBuildArchitecture = architecture };
var expectedFilename = expect64Bit
? Path.Combine(root, "Microsoft.NET", "Framework64", "v4.0.30319", "MSBuild.exe")
: Path.Combine(root, "Microsoft.NET", "Framework", "v4.0.30319", "MSBuild.exe");
// act
var startInfo = msbuild.GetStartInfoFramework(root, is64BitOperatingSystem);
// assert
startInfo.FileName.Should().Be(expectedFilename);
}
开发者ID:modulexcite,项目名称:bau-msbuild,代码行数:16,代码来源:MSBuildFacts.cs
示例20: CreateConfigurableInterpreterFactory
public IJInterpreterFactory CreateConfigurableInterpreterFactory(Guid id, string path, string vocPath, string pathEnvVar, string description, ProcessorArchitecture archValue, Version ver)
{
var fact = _defaultCreator.CreateInterpreterFactory(
new Dictionary<InterpreterFactoryOptions, object>() {
{ InterpreterFactoryOptions.Version, ver },
{ InterpreterFactoryOptions.Guid, id },
{ InterpreterFactoryOptions.Description, description },
{ InterpreterFactoryOptions.JPath, path },
{ InterpreterFactoryOptions.JVocabularyPath, vocPath },
{ InterpreterFactoryOptions.PathEnvVar, pathEnvVar },
{ InterpreterFactoryOptions.ProcessorArchitecture, archValue }
}
);
return new ConfigurableJInterpreterFactory(fact);
}
开发者ID:borota,项目名称:JTVS,代码行数:16,代码来源:ConfigurableJInterpreterFactoryProvider.cs
注:本文中的ProcessorArchitecture类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论