當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。