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


C# String.Any方法代码示例

本文整理汇总了C#中String.Any方法的典型用法代码示例。如果您正苦于以下问题:C# String.Any方法的具体用法?C# String.Any怎么用?C# String.Any使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在String的用法示例。


在下文中一共展示了String.Any方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: LoadPrincipiaDllAndInitGoogleLogging

 public static string LoadPrincipiaDllAndInitGoogleLogging()
 {
     if (loaded_principia_dll_) {
       return null;
     }
     bool is_32_bit = IntPtr.Size == 4;
     if (is_32_bit) {
       return "32-bit platforms are no longer supported; " +
      "use the 64-bit KSP executable.";
     }
     String[] possible_dll_paths = null;
     bool can_determine_cxx_installed;
     Func<bool> is_cxx_installed;
     string required_cxx_packages;
     switch (Environment.OSVersion.Platform) {
       case PlatformID.Win32NT:
     can_determine_cxx_installed = true;
     is_cxx_installed = () => IsVCRedistInstalled(is_32_bit);
     required_cxx_packages =
     "the Visual C++ Redistributable Packages for Visual Studio " +
     "2015 on " + (is_32_bit ? "x86" : "x64");
     possible_dll_paths =
     new String[] {@"GameData\Principia\" +
               (is_32_bit ? "Win32" : "x64") + @"\principia.dll"};
     break;
       // Both Mac and Linux report |PlatformID.Unix|, so we treat them together
       // (we probably don't actually encounter |PlatformID.MacOSX|.
       case PlatformID.Unix:
       case PlatformID.MacOSX:
     possible_dll_paths = new String[] {
     @"GameData/Principia/Linux64/principia.so",
     @"GameData/Principia/MacOS64/principia.so"};
     can_determine_cxx_installed = false;
     is_cxx_installed = null;
     required_cxx_packages = "libc++ and libc++abi 3.5-2";
     break;
       default:
     return "The operating system " + Environment.OSVersion +
        " is not supported at this time.";
     }
     if (!possible_dll_paths.Any(File.Exists)) {
       return "The principia DLL was not found at '" +
      String.Join("', '", possible_dll_paths) + "'.";
     }
     try {
       loaded_principia_dll_ = true;
       Log.InitGoogleLogging();
       return null;
     } catch (Exception e) {
       UnityEngine.Debug.LogException(e);
       if (can_determine_cxx_installed && !is_cxx_installed()) {
     return "Dependencies, namely " + required_cxx_packages +
        ", were not found.";
       } else {
     return "An unknown error occurred; detected OS " +
        Environment.OSVersion + " " + (is_32_bit ? "32" : "64") +
        "-bit; tried loading dll at '" +
        String.Join("', '", possible_dll_paths) + "'. Note that " +
        required_cxx_packages + " are required.";
       }
     }
 }
开发者ID:pdn4kd,项目名称:Principia,代码行数:62,代码来源:loader.cs


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