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


C# System.Platform类代码示例

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


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


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