当前位置: 首页>>代码示例>>C#>>正文


C# ProcessorArchitecture类代码示例

本文整理汇总了C#中ProcessorArchitecture的典型用法代码示例。如果您正苦于以下问题:C# ProcessorArchitecture类的具体用法?C# ProcessorArchitecture怎么用?C# ProcessorArchitecture使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ProcessorArchitecture类属于命名空间,在下文中一共展示了ProcessorArchitecture类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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


注:本文中的ProcessorArchitecture类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。