• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# System.Platform类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



Platform类属于System命名空间,在下文中一共展示了Platform类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: Get

 public string Get(Platform platform, Version version)
 {
     var path = Plugins.PluginLocator.GetAutoTestDirectory();
     var platformString = getPlatformString(platform);
     var frameworkString = getFrameworkString(version);
     return Path.Combine(path, string.Format("AutoTest.TestRunner{0}{1}.exe", platformString, frameworkString));
 }
开发者ID:Vernathic,项目名称:ic-AutoTest.NET4CTDD,代码行数:7,代码来源:TestProcessSelector.cs


示例2: SalesHomePage

        public SalesHomePage(IApp app, Platform platform)
            : base(app, platform, "WEEKLY AVERAGE", "WEEKLY AVERAGE")
        {
            if (OnAndroid)
            {
                FirstLead = x => x.Marked("50% - Value Proposition");
                ListView = x => x.Id("content");
                AddLeadButton = x => x.Class("FloatingActionButton");
                LeadCell = x => x.Class("ViewCellRenderer_ViewCellContainer");
                ChartIdentifier = x => x.Id("stripLinesLayout");
            }
            if (OniOS)
            {
                FirstLead = x => x.Class("UITableViewCellContentView");
                ListView = x => x.Class("UILayoutContainerView");
                AddLeadButton = x => x.Id("add_ios_gray");
            }

            //Verifying page has loaded
            app.WaitForElement(LeadCell);
            app.WaitForElement(ChartIdentifier);

            app.WaitForNoElement(SalesDataLoading, timeout: TimeSpan.FromSeconds(20));
            app.WaitForNoElement(LeadsLoading, timeout: TimeSpan.FromSeconds(20));
        }
开发者ID:XnainA,项目名称:app-crm,代码行数:25,代码来源:SalesHomePage.cs


示例3: Train

 //===================================================================== INITIALIZE
 public Train(Platform platform)
 {
     _id = CurrentID;
     CurrentID++;
     _platform = platform;
     _nextTrack = MathUtils.Rand(0, platform.Destinations.Count - 1);
 }
开发者ID:LRih,项目名称:Train-Network-Simulator,代码行数:8,代码来源:Train.cs


示例4: Get

 public string Get(Platform platform, Version version)
 {
     var path = Path.GetDirectoryName(new Uri(Assembly.GetExecutingAssembly().CodeBase).LocalPath);
     var platformString = getPlatformString(platform);
     var frameworkString = getFrameworkString(version);
     return Path.Combine(path, string.Format("AutoTest.TestRunner{0}{1}.exe", platformString, frameworkString));
 }
开发者ID:jeremywiebe,项目名称:AutoTest.Net,代码行数:7,代码来源:TestProcessSelector.cs


示例5: ModulePropertiesForSerialization

 internal ModulePropertiesForSerialization(
     Guid persistentIdentifier,
     ushort fileAlignment,
     string targetRuntimeVersion,
     Platform platform,
     bool trackDebugData,
     ulong baseAddress,
     ulong sizeOfHeapReserve,
     ulong sizeOfHeapCommit,
     ulong sizeOfStackReserve,
     ulong sizeOfStackCommit,
     bool enableHighEntropyVA,
     bool strongNameSigned,
     bool configureToExecuteInAppContainer,
     SubsystemVersion subsystemVersion)
 {
     this.PersistentIdentifier = (persistentIdentifier == default(Guid)) ? Guid.NewGuid() : persistentIdentifier;
     this.FileAlignment = fileAlignment;
     this.TargetRuntimeVersion = targetRuntimeVersion;
     this.Platform = platform;
     this.TrackDebugData = trackDebugData;
     this.BaseAddress = baseAddress;
     this.SizeOfHeapReserve = sizeOfHeapReserve;
     this.SizeOfHeapCommit = sizeOfHeapCommit;
     this.SizeOfStackReserve = sizeOfStackReserve;
     this.SizeOfStackCommit = sizeOfStackCommit;
     this.EnableHighEntropyVA = enableHighEntropyVA;
     this.StrongNameSigned = strongNameSigned;
     this.ConfigureToExecuteInAppContainer = configureToExecuteInAppContainer;
     this.SubsystemVersion = subsystemVersion.Equals(SubsystemVersion.None)
         ? SubsystemVersion.Default(OutputKind.ConsoleApplication, this.Platform)
         : subsystemVersion;
 }
开发者ID:riversky,项目名称:roslyn,代码行数:33,代码来源:ModulePropertiesForSerialization.cs


示例6: Pack

        public static void Pack(string sourcePath, string saveFileName, bool updateSng = false, Platform predefinedPlatform = null, bool updateManifest = false, bool fixShowlights = true)
        {
            //  if (!Path.GetFileName(sourcePath).ToLower().Contains("crowd.psarc"))
            DeleteFixedAudio(sourcePath);
            Platform platform = sourcePath.GetPlatform();

            if (predefinedPlatform != null && predefinedPlatform.platform != GamePlatform.None && predefinedPlatform.version != GameVersion.None)
                platform = predefinedPlatform;

            switch (platform.platform)
            {
                case GamePlatform.Pc:
                case GamePlatform.Mac:
                    if (platform.version == GameVersion.RS2012)
                        PackPC(sourcePath, saveFileName, true, updateSng);
                    else if (platform.version == GameVersion.RS2014)
                        Pack2014(sourcePath, saveFileName, platform, updateSng, updateManifest, fixShowlights: fixShowlights);
                    break;
                case GamePlatform.XBox360:
                    PackXBox360(sourcePath, saveFileName, platform, updateSng, updateManifest);
                    break;
                case GamePlatform.PS3:
                    PackPS3(sourcePath, saveFileName, platform, updateSng, updateManifest);
                    break;
                case GamePlatform.None:
                    throw new InvalidOperationException(String.Format("Invalid directory structure of package. {0}Directory: {1}", Environment.NewLine, sourcePath));
            }
        }
开发者ID:aequitas,项目名称:rocksmith-custom-song-toolkit,代码行数:28,代码来源:Packer.cs


示例7: SearchFor

		public static void SearchFor (this IApp app, Platform platform, string searchString)
		{
			var ios = platform == Platform.iOS;

			app.Tap (x => x.Id (ios ? "button_add" : "action_search"));

			app.Screenshot ("Start Search");


			try {

				// type in each char one at a time
				foreach (var item in searchString)
					app.EnterText (item.ToString ());

			} catch (Exception) {

				// clear and try again
				app.ClearText ();

				foreach (var item in searchString)
					app.EnterText (ios ? "Search" : "search_src_text", item.ToString ());

			}

			app.Screenshot ($"Locations Search: '{searchString}'");
		}
开发者ID:colbylwilliams,项目名称:XWeather,代码行数:27,代码来源:TestExtensions.cs


示例8: Main

        public static void Main( string[] args )
        {
            // Init
            Platform = DeterminePlatform();
            FixOSXLibraryPaths();
            SetupEmbeddedAssemblies();
            Arguments = new ProgramArguments( args );
            Language = DetermineLanguage();

            // Determine UI to run
            string gui = Arguments.GetString( "gui" );
            if( gui == null )
            {
                if( Platform == Platform.Windows )
                {
                    gui = "winforms";
                }
                else
                {
                    gui = "gtk";
                }
            }

            // Run UI
            if( gui == "winforms" )
            {
                WinFormsInterface.Run();
            }
            else if( gui == "gtk" )
            {
                GTKInterface.Run();
            }
        }
开发者ID:RamiLego4Game,项目名称:PlatformerWorld-Launcher,代码行数:33,代码来源:Program.cs


示例9: Tapstream

 private Tapstream(string accountName, string developerSecret, string hardware)
 {
     del = new DelegateImpl(this);
     platform = new PlatformImpl();
     listener = new CoreListenerImpl();
     core = new Core(del, platform, listener, accountName, developerSecret, hardware);
 }
开发者ID:sobri909,项目名称:tapstream-sdk,代码行数:7,代码来源:Tapstream.cs


示例10: ToString

        public string ToString(Platform platform)
        {
            var renderer = new StringRenderer(platform);
            this.Render(renderer);
            return renderer.ToString();

        }
开发者ID:gh0std4ncer,项目名称:reko,代码行数:7,代码来源:MachineInstruction.cs


示例11: StartApp

        public static IApp StartApp(Platform platform)
        {
            if (platform == Platform.Android)
            {
                string currentFile = new Uri(Assembly.GetExecutingAssembly().CodeBase).LocalPath;
                FileInfo fi = new FileInfo(currentFile);
                string dir = fi.Directory.Parent.Parent.Parent.FullName;

                // PathToAPK is a property or an instance variable in the test class
                apkPath = Path.Combine(dir, "MyDriving.Android", "bin", "XTC", "com.microsoft.mydriving-Signed.apk");

                app = ConfigureApp
                    .Android
                    .ApkFile(apkPath)
                    .StartApp(Xamarin.UITest.Configuration.AppDataMode.Clear);
            }
            else
            {
                app = ConfigureApp
                    .iOS
                    //.AppBundle(appPath)
                    .InstalledApp("com.microsoft.mydriving")
                    .StartApp(Xamarin.UITest.Configuration.AppDataMode.Clear);
            }

            return app;
        }
开发者ID:ChrisRisner,项目名称:MyDriving,代码行数:27,代码来源:AppInitializer.cs


示例12: GetJsonString

        /// <summary>
        /// 获取通知的Json格式字符串
        /// <example>
        /// 格式:{"n_builder_id":"通知样式","n_title":"通知标题","n_content":"通知内容", "n_extras":{"ios":{"badge":8, "sound":"happy"}, "user_param_1":"value1", "user_param_2":"value2"}}
        /// </example>
        /// </summary>
        /// <param name="platform">The platform.</param>
        /// <returns></returns>
        public string GetJsonString(Platform platform = Platform.Android|Platform.iOS)
        {
            IDictionary<string, object> data = new Dictionary<string, object> { { "n_title", this.Title ?? string.Empty }, { "n_content", this.Content ?? string.Empty } };
            IDictionary<string, object> extra = new Dictionary<string, object>();
            if (this.CustomizedValue != null)
                foreach (string key in this.CustomizedValue.Keys)
                {
                    extra[key] = this.CustomizedValue[key];
                }
            if (platform.Contains(Platform.Android))
            {
                if (this.Android_BuilderId > 0 && this.Android_BuilderId <= 1000)
                    data["n_builder_id"] = this.Android_BuilderId;
            }
            if (platform.Contains(Platform.iOS))
            {
                IDictionary<string, object> iOSExtra = new Dictionary<string, object>();

                iOSExtra["badge"] = this.iOS_Badge;

                if (!string.IsNullOrWhiteSpace(this.iOS_Sound))
                    iOSExtra["sound"] = this.iOS_Sound;
                extra["ios"] = iOSExtra;
            }
            data.Add("n_extras", extra);
            return JsonConvert.SerializeObject(data);
        }
开发者ID:zzxiaotao,项目名称:YuYu.Components,代码行数:35,代码来源:Message.cs


示例13: Initialize

        protected override void Initialize()
        {
            this.identityTransform = Matrix.Identity;
            this.platform = WaveServices.Platform;

            base.Initialize();
        }
开发者ID:dezol,项目名称:QuickStarters,代码行数:7,代码来源:DrawableCurve2D.cs


示例14: Convert

        public static string Convert(string sourcePackage, Platform sourcePlatform, Platform targetPlatform, string appId)
        {
            var needRebuildPackage = sourcePlatform.IsConsole != targetPlatform.IsConsole;
            var tmpDir = Path.GetTempPath();

            var fileName = Path.GetFileNameWithoutExtension(sourcePackage);
            if (sourcePlatform.platform == GamePlatform.PS3)
                if (fileName.Contains(".psarc"))
                    fileName = fileName.Substring(0, fileName.LastIndexOf("."));

            var unpackedDir = Packer.Unpack(sourcePackage, tmpDir, false, true, false, sourcePlatform);

            // DESTINATION
            var nameTemplate = (!targetPlatform.IsConsole) ? "{0}{1}.psarc" : "{0}{1}";

            var packageName = Path.GetFileNameWithoutExtension(sourcePackage);
            if (packageName.EndsWith(new Platform(GamePlatform.Pc, GameVersion.None).GetPathName()[2]) ||
                    packageName.EndsWith(new Platform(GamePlatform.Mac, GameVersion.None).GetPathName()[2]) ||
                    packageName.EndsWith(new Platform(GamePlatform.XBox360, GameVersion.None).GetPathName()[2]) ||
                    packageName.EndsWith(new Platform(GamePlatform.PS3, GameVersion.None).GetPathName()[2] + ".psarc"))
            {
                packageName = packageName.Substring(0, packageName.LastIndexOf("_"));
            }
            var targetFileName = Path.Combine(Path.GetDirectoryName(sourcePackage), String.Format(nameTemplate, Path.Combine(Path.GetDirectoryName(sourcePackage), packageName), targetPlatform.GetPathName()[2]));

            // CONVERSION
            if (needRebuildPackage)
                ConvertPackageRebuilding(unpackedDir, targetFileName, targetPlatform, appId);
            else
                ConvertPackageForSimilarPlatform(unpackedDir, targetFileName, sourcePlatform, targetPlatform, appId);

            DirectoryExtension.SafeDelete(unpackedDir);

            return String.Empty;
        }
开发者ID:Jamedjo,项目名称:rocksmith-custom-song-toolkit,代码行数:35,代码来源:DLCPackageConverter.cs


示例15: Resolve

        public void Resolve(Stream stream)
        {
            _platform = Platform.Unknown;
            using (var reader = new StreamReader(stream))
            {
                string buffer = reader.ReadToEnd();
                bool resolvedIdAndPlatform =
                    Resolve(buffer, DogtagsBlockStart);
                if (!resolvedIdAndPlatform)
                    Resolve(buffer, UnlocksBlockStart);

                if (_userId <= 0)
                {
                    Messenger.Default.Send(new BattlelogResponseMessage(UnableToParse, false));
                    return;
                }

                if (_platform == Platform.Unknown)
                {
                    Messenger.Default.Send(new BattlelogResponseMessage(UnableToParse, false));
                    return;
                }
                Messenger.Default.Send(new UserIdAndPlatformResolvedMessage(_userId, _platform));
            }
        }
开发者ID:Microsoft1080,项目名称:battlelogmobile,代码行数:25,代码来源:UserIdAndPlatformResolver.cs


示例16: StartApp

        public static IApp StartApp(Platform platform)
        {
            // TODO: If the iOS or Android app being tested is included in the solution 
            // then open the Unit Tests window, right click Test Apps, select Add App Project
            // and select the app projects that should be tested.
            //
            // The iOS project should have the Xamarin.TestCloud.Agent NuGet package
            // installed. To start the Test Cloud Agent the following code should be
            // added to the FinishedLaunching method of the AppDelegate:
            //
            //    #if ENABLE_TEST_CLOUD
            //    Xamarin.Calabash.Start();
            //    #endif
            if (platform == Platform.Android)
            {
                return ConfigureApp
                    .Android
                // TODO: Update this path to point to your Android app and uncomment the
                // code if the app is not included in the solution.
                //.ApkFile ("../../../Droid/bin/Debug/xamarinforms.apk")
                    .StartApp();
            }

            return ConfigureApp
                .iOS
            // TODO: Update this path to point to your iOS app and uncomment the
            // code if the app is not included in the solution.
            //.AppBundle ("../../../iOS/bin/iPhoneSimulator/Debug/XamarinForms.iOS.app")
                .StartApp();
        }
开发者ID:RCWade,项目名称:app-coffeecups,代码行数:30,代码来源:AppInitializer.cs


示例17: TestApplication

		public TestApplication(Platform platform)
			: base(platform)
		{
			TestAssemblies = DefaultTestAssemblies().ToList();
			this.Name = "Test Application";
			this.Style = "application";
		}
开发者ID:GilbertoBotaro,项目名称:Eto,代码行数:7,代码来源:TestApplication.cs


示例18: SearchForAndSelect

		public static void SearchForAndSelect (this IApp app, Platform platform, string searchString, string selection, string waitFor)
		{
			var ios = platform == Platform.iOS;

			app.SearchFor (platform, searchString);

			try {

				app.WaitForElement (x => x.Marked (selection));


				app.Tap (x => x.Marked (selection));

				app.WaitForElement (x => x.Marked (waitFor));


			} catch (Exception) {


				app.Tap (x => x.Id (ios ? "LocationSearchTvCell_nameLabel" : "text1").Index (2));
			}


			app.Screenshot ($"Added Location: '{selection}'");
		}
开发者ID:colbylwilliams,项目名称:XWeather,代码行数:25,代码来源:TestExtensions.cs


示例19: UnpackSng

        public static void UnpackSng(Stream input, Stream output, Platform platform) {
            EndianBitConverter conv = platform.GetBitConverter;

            using (var decrypted = new MemoryStream())
            using (var ebrDec = new EndianBinaryReader(conv, decrypted)) {
                byte[] key;
                switch (platform.platform) {
                    case GamePlatform.Mac:
                        key = RijndaelEncryptor.SngKeyMac;
                        break;
                    case GamePlatform.Pc:
                        key = RijndaelEncryptor.SngKeyPC;
                        break;
                    default:
                        key = null;
                        break;
                }
                if (key != null)
                    RijndaelEncryptor.DecryptSngData(input, decrypted, key, conv);
                else {
                    input.CopyTo(decrypted);
                    decrypted.Seek(8, SeekOrigin.Begin);
                }
                //unZip
                long plainLen = ebrDec.ReadUInt32();
                ushort xU = ebrDec.ReadUInt16();
                decrypted.Position -= 2;
                if (xU == 0x78DA || xU == 0xDA78) {//LE 55928 //BE 30938
                    RijndaelEncryptor.Unzip(decrypted, output, false);
                }
            }
        }
开发者ID:aequitas,项目名称:rocksmith-custom-song-toolkit,代码行数:32,代码来源:Sng2014File.cs


示例20: Init

        public static void Init(Platform platform, ToolkitType DefaultToolKit, ToolkitType[] supportedToolkits)
        {
            CurrentPlatform = platform;
            SuportedPlatformToolkits = supportedToolkits;

            bool tkset = false;

            try
            {
                var settings = File.ReadAllLines(SettingsFile);
                foreach (var setting in settings)
                {
                    string[] split = setting.Split('=');
                    if (split[0] == "Toolkit")
                    {
                        try
                        {
                            _toolKitType = (ToolkitType)Enum.Parse(typeof(ToolkitType), split[1]);
                            tkset = true;
                        }
                        catch {
                        }
                    }
                }
            }
            catch
            {
            }

            if(!tkset)
                _toolKitType = DefaultToolKit;
        }
开发者ID:cra0zy,项目名称:SFEditor,代码行数:32,代码来源:Settings.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# System.Point类代码示例发布时间:2022-05-26
下一篇:
C# System.Pixel类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap