public override void SetUp () { base.SetUp (); ServiceContainer.Register<IPlatformUtils> (platformUtils = new PlatformUtils ()); ServiceContainer.Register<ISettingsStore> (settingStore = new SettingStore ()); ServiceContainer.Register<ExperimentManager> (new ExperimentManager ()); upgradeManager = new UpgradeManger (); }
public VodContainer() { _plats = PlatformUtils.FormatVodPlatform(); VideoNodeKeyArray.Instance.Init(); var dic = new Dictionary <VideoNodeKey, VodContent>(VideoNodeKeyArray.Instance.Items.Count); foreach (var v in VideoNodeKeyArray.Instance.Items.Keys) { dic[v] = new VodContent(); } _dic = dic; }
private bool onChatBarOpened(ChatEvents.InputBarLoaded evt) { if (PlatformUtils.GetAspectRatioType() == AspectRatioType.Landscape) { StateMachine component = GetComponent <StateMachine>(); if (component.CurrentStateName == "EmoteInput") { component.SendEvent("keyboardOpen"); } } return(false); }
public void CheckPerformance() { // Sample program properties string folder = "Compiler" + Path.DirectorySeparatorChar + "Pipeline" + Path.DirectorySeparatorChar + "Samples"; string textName = "BigBatch"; DocumentFormat documentFormat = DocumentFormat.RDZReferenceFormat; // Create a FileCompiler for this program DirectoryInfo localDirectory = new DirectoryInfo(PlatformUtils.GetPathForProjectFile(folder)); if (!localDirectory.Exists) { throw new Exception(String.Format("Directory : {0} does not exist", localDirectory.FullName)); } CompilationProject project = new CompilationProject("test", localDirectory.FullName, new string[] { ".cbl", ".cpy" }, documentFormat.Encoding, documentFormat.EndOfLineDelimiter, documentFormat.FixedLineLength, documentFormat.ColumnsLayout, new TypeCobolOptions()); FileCompiler compiler = new FileCompiler(null, textName, project.SourceFileProvider, project, documentFormat.ColumnsLayout, new TypeCobolOptions(), null, false, project); // Execute a first (complete) compilation compiler.CompileOnce(); // Append one line in the middle of the program ITextLine newLine = new TextLineSnapshot(9211, "094215D DISPLAY '-ICLAUA = ' ICLAUA. 0000000", null); TextChangedEvent textChangedEvent = new TextChangedEvent(); textChangedEvent.TextChanges.Add(new TextChange(TextChangeType.LineInserted, 9211, newLine)); compiler.CompilationResultsForProgram.UpdateTextLines(textChangedEvent); // Execute a second (incremental) compilation compiler.CompileOnce(); // Display a performance report StringBuilder report = new StringBuilder(); report.AppendLine("Program properties :"); report.AppendLine("- " + compiler.CompilationResultsForProgram.CobolTextLines.Count + " lines"); report.AppendLine("- " + compiler.CompilationResultsForProgram.CodeElementsDocumentSnapshot.CodeElements.Count() + " code elements"); report.AppendLine("First compilation performance"); report.AppendLine("- " + compiler.CompilationResultsForProgram.PerfStatsForText.FirstCompilationTime + " ms : text update"); report.AppendLine("- " + compiler.CompilationResultsForProgram.PerfStatsForScanner.FirstCompilationTime + " ms : scanner"); report.AppendLine("- " + compiler.CompilationResultsForProgram.PerfStatsForPreprocessor.FirstCompilationTime + " ms : preprocessor"); report.AppendLine("- " + compiler.CompilationResultsForProgram.PerfStatsForCodeElementsParser.FirstCompilationTime + " ms : code elements parser"); report.AppendLine("- " + compiler.CompilationResultsForProgram.PerfStatsForProgramClassParser.FirstCompilationTime + " ms : program class parser"); report.AppendLine("Incremental compilation performance"); report.AppendLine("- " + compiler.CompilationResultsForProgram.PerfStatsForText.LastRefreshTime + " ms : text update"); report.AppendLine("- " + compiler.CompilationResultsForProgram.PerfStatsForScanner.LastRefreshTime + " ms : scanner"); report.AppendLine("- " + compiler.CompilationResultsForProgram.PerfStatsForPreprocessor.LastRefreshTime + " ms : preprocessor"); report.AppendLine("- " + compiler.CompilationResultsForProgram.PerfStatsForCodeElementsParser.LastRefreshTime + " ms : code elements parser"); report.AppendLine("- " + compiler.CompilationResultsForProgram.PerfStatsForProgramClassParser.LastRefreshTime + " ms : program class parser"); Console.WriteLine(report.ToString()); }
private void ResetCamera() { CinematographyEvents.CameraLogicResetEvent evt = default(CinematographyEvents.CameraLogicResetEvent); GameObject gameObject = ((PlatformUtils.GetPlatformType() == PlatformType.Mobile) ? board.CameraPosition : board.StandaloneCameraPosition); evt.Controller = gameObject.GetComponent <CameraController>(); dispatcher.DispatchEvent(evt); dispatcher.DispatchEvent(new CinematographyEvents.ChangeCameraTarget(localPlayerGameObject.transform)); Camera.main.cullingMask |= 1 << LayerMask.NameToLayer("AllPlayerInteractibles"); Camera.main.cullingMask |= 1 << LayerMask.NameToLayer("PhysicsObjects"); Camera.main.cullingMask |= 1 << LayerMask.NameToLayer("LocalPlayer"); }
private static void PreloaderMain() { PlatformUtils.SetPlatform(); if (UnityPreloader.ConfigApplyRuntimePatches.Value) { XTermFix.Apply(); ConsoleSetOutFix.Apply(); } UnityPreloader.Run(EnvVars.DOORSTOP_MANAGED_FOLDER_DIR); }
public void quitApplication() { if (PlatformUtils.isTouchUser() && Input.GetKeyDown(KeyCode.Escape)) { if (isDoubleCheck()) { Debug.Log("Is Double Click"); // 返回主界面 Application.Quit(); } } }
public void ForbiddenInit() { var plats = PlatformUtils.FormatVodPlatform(); var fb = new Dictionary <VideoNodeKey, bool>(plats.Count); foreach (var f in plats) { var key = new VideoNodeKey(f.PlatformName, 0, f.Licence); fb.Add(key, f.IsForbiddenSupport); } _forbidden = fb; }
public static void InitializeBaseSystems() { Settings.Load(); PlatformUtils.Initialize(); DpiScaling.Initialize(); Theme.Initialize(); NesApu.Initialize(); #if FAMISTUDIO_WINDOWS WinUtils.Initialize(); PerformanceCounter.Initialize(); #endif }
private async Task RegisterTokenCacheAsync(IPublicClientApplication app) { Context.Trace.WriteLine( "Configuring Microsoft Authentication token cache to instance shared with Microsoft developer tools..."); if (!PlatformUtils.IsWindows() && !PlatformUtils.IsPosix()) { string osType = PlatformUtils.GetPlatformInformation().OperatingSystemType; Context.Trace.WriteLine($"Token cache integration is not supported on {osType}."); return; } string clientId = app.AppConfig.ClientId; // We use the MSAL extension library to provide us consistent cache file access semantics (synchronisation, etc) // as other Microsoft developer tools such as the Azure PowerShell CLI. MsalCacheHelper helper = null; try { var storageProps = CreateTokenCacheProps(clientId, useLinuxFallback: false); helper = await MsalCacheHelper.CreateAsync(storageProps); // Test that cache access is working correctly helper.VerifyPersistence(); } catch (MsalCachePersistenceException ex) { Context.Streams.Error.WriteLine("warning: cannot persist Microsoft Authentication data securely!"); Context.Trace.WriteLine("Cannot persist Microsoft Authentication data securely!"); Context.Trace.WriteException(ex); // On Linux the SecretService/keyring might not be available so we must fall-back to a plaintext file. if (PlatformUtils.IsLinux()) { Context.Trace.WriteLine("Using fall-back plaintext token cache on Linux."); var storageProps = CreateTokenCacheProps(clientId, useLinuxFallback: true); helper = await MsalCacheHelper.CreateAsync(storageProps); } } if (helper is null) { Context.Streams.Error.WriteLine("error: failed to set up Microsoft Authentication token cache!"); Context.Trace.WriteLine("Failed to integrate with shared token cache!"); } else { helper.RegisterCache(app.UserTokenCache); Context.Trace.WriteLine("Microsoft developer tools token cache configured."); } }
// init audio private void initAudioCtrl() { AudioPlayCtrl.init(audioManager); PlayerAudioCtrl.init(audioManager); BackgroundAudioCtrl.init(audioManager); ObstacleAudioCtrl.init(audioManager); // close contain feature when in the runtime. if (PlatformUtils.isTouchUser()) { isDevelop = false; } }
/// <summary> /// 初始化平台索引 /// </summary> private Dictionary <RecommandKey, List <LiveRecommandNode> > InitIndex(List <int> modes) { var dic = new Dictionary <RecommandKey, List <LiveRecommandNode> >(); foreach (var f in PlatformUtils.FormatLivePlatform()) { foreach (var mode in modes) { dic.Add(new RecommandKey(mode, f.PlatformName, f.Licence), new List <LiveRecommandNode>()); } } return(dic); }
public void SetGraphicsQuality() { string text = ""; if (PlatformUtils.GetPlatformType() == PlatformType.Standalone) { text = "Standalone_"; } else if (PlatformUtils.GetPlatformType() == PlatformType.Mobile) { text = "Mobile_"; } else { string message = Enum.GetName(typeof(string), PlatformUtils.GetPlatformType()); Log.LogErrorFormatted("Quality setting not defined on Platform {0}", message); } if (graphicsQualityToggleHigh.isOn) { antiAliasingToggle.isOn = true; cameraPostToggle.isOn = true; lodPenguinQualityToggleHigh.isOn = true; text += "High"; SetTogglesInteractable(true, antiAliasingToggle, cameraPostToggle); SetPenguinTogglesInteractable(true, lodPenguinQualityToggleHigh, lodPenguinQualityToggleMedium); } else if (graphicsQualityToggleMedium.isOn) { antiAliasingToggle.isOn = true; cameraPostToggle.isOn = false; lodPenguinQualityToggleMedium.isOn = true; text += "Medium"; SetTogglesInteractable(true, antiAliasingToggle); SetTogglesInteractable(false, cameraPostToggle); SetPenguinTogglesInteractable(true, lodPenguinQualityToggleMedium); SetPenguinTogglesInteractable(false, lodPenguinQualityToggleHigh); } else if (graphicsQualityToggleLow.isOn) { antiAliasingToggle.isOn = false; cameraPostToggle.isOn = false; lodPenguinQualityToggleLow.isOn = true; text += "Low"; SetTogglesInteractable(false, antiAliasingToggle, cameraPostToggle); SetPenguinTogglesInteractable(false, lodPenguinQualityToggleHigh, lodPenguinQualityToggleMedium); } if (isInitialized) { customGraphicsService.SetGraphicsLevel(text); } }
public async Task <Node> ReadNodeAsync(string serverUrl, string nodeIdStr) { try { Session session = await GetSessionAsync(serverUrl); NodeId nodeToRead = PlatformUtils.ParsePlatformNodeIdString(nodeIdStr); var node = session.ReadNode(nodeToRead); return(node); }catch (Exception e) { return(null); } }
private bool TryFindHelperExecutablePath(out string path) { string helperName = Constants.MicrosoftAuthHelperName; if (PlatformUtils.IsWindows()) { helperName += ".exe"; } string executableDirectory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); path = Path.Combine(executableDirectory, helperName); return(Context.FileSystem.FileExists(path)); }
static PreprocessorUtils() { DirectivesProject = new CompilationProject("directives", PlatformUtils.GetPathForProjectFile(Root + Path.DirectorySeparatorChar + "DirectiveTestFiles"), new string[] { ".cbl", ".cpy" }, Encoding.Unicode, EndOfLineDelimiter.CrLfCharacters, 0, ColumnsLayout.CobolReferenceFormat, CompilerOptions); CopyProject = new CompilationProject("copy", PlatformUtils.GetPathForProjectFile(Root + Path.DirectorySeparatorChar + "CopyTestFiles"), new string[] { ".cbl", ".cpy" }, Encoding.Unicode, EndOfLineDelimiter.CrLfCharacters, 0, ColumnsLayout.CobolReferenceFormat, CompilerOptions); ReplaceProject = new CompilationProject("replace", PlatformUtils.GetPathForProjectFile(Root + Path.DirectorySeparatorChar + "ReplaceTestFiles"), new string[] { ".cbl", ".cpy" }, Encoding.Unicode, EndOfLineDelimiter.CrLfCharacters, 0, ColumnsLayout.CobolReferenceFormat, CompilerOptions); }
public Shell.ExecuteArgs ToExecuteArgs() { string str = this.CompilerExecutable.ToString(); if (PlatformUtils.IsWindows()) { str = this.CompilerExecutable.InQuotes(); } return(new Shell.ExecuteArgs { Arguments = this.Arguments.SeparateWithSpaces(), EnvVars = this.EnvVars, Executable = str }); }
// 外传的计时器 public void timer() { if (_owner.getState() != PlayerState.Idle) { return; } if (PlatformUtils.isKeyBoardUser()) { keyBoardEvent(); } // 为了能够有管控,因为 mobile 平台上 gesture 替代了 keyboard 所以要有与之对应的管控。parry 设置同理。 GestureCtrl.getInstance().timer(); }
private void setupCamera() { if (outlineCamera == null) { GameObject gameObject = new GameObject("OutlineCamera"); gameObject.layer = OutlineLayer; outlineCamera = gameObject.AddComponent <Camera>(); outlineCamera.transform.SetParent(referenceCamera.transform, worldPositionStays: false); outlineCamera.transform.localPosition = Vector3.zero; outlineCamera.transform.localRotation = Quaternion.identity; AudioListener component = outlineCamera.GetComponent <AudioListener>(); if (component != null) { Object.Destroy(component); } } outlineCamera.CopyFrom(referenceCamera); outlineCamera.rect = new Rect(0f, 0f, 1f, 1f); int num = 1 << OutlineLayer; outlineCamera.cullingMask = num; referenceCamera.cullingMask &= ~num; outlineCamera.clearFlags = CameraClearFlags.Color; outlineCamera.backgroundColor = Color.black; bool flag = PlatformUtils.GetPlatformType() == PlatformType.Standalone; MaxRenderTextureSize = (flag ? 512 : 512); int num2 = MaxRenderTextureSize; int num3 = MaxRenderTextureSize; if (referenceCamera.aspect > 1f) { num3 = Mathf.RoundToInt((float)num2 / referenceCamera.aspect); } else { num2 = Mathf.RoundToInt((float)num3 * referenceCamera.aspect); } outlineRtt = new RenderTexture(num2, num3, 24); if (flag) { outlineRtt.antiAliasing = 2; } outlineCamera.targetTexture = outlineRtt; ClothingOutlinerImageEffect component2 = referenceCamera.gameObject.GetComponent <ClothingOutlinerImageEffect>(); outlinerEffect = component2 ?? referenceCamera.gameObject.AddComponent <ClothingOutlinerImageEffect>(); outlinerEffect.OutlineTexture = outlineRtt; outlinerEffect.AnimationCurve = OutlinerAnimationCurve; }
private void UpdateLightbar() { totalTimeActive += Time.deltaTime; float num = UWE.Utils.SineWaveNegOneToOne(totalTimeActive * 0.5f) * 100f; int num2 = Mathf.FloorToInt(150f + num); num2 = Mathf.Clamp(num2, 13, 255); lightbarColor.r = (float)num2; PlatformUtils.SetLightbarColor(lightbarColor, 0); }
protected bool TryFindHelperExecutablePath(string envar, string configName, string defaultValue, out string path) { bool isOverride = false; if (Context.Settings.TryGetSetting( envar, Constants.GitConfiguration.Credential.SectionName, configName, out string helperName)) { Context.Trace.WriteLine($"UI helper override specified: '{helperName}'."); isOverride = true; } else { // Use the default helper if none was specified. // On Windows append ".exe" for the default helpers only. If a user has specified their own // helper they should append the correct extension. helperName = PlatformUtils.IsWindows() ? $"{defaultValue}.exe" : defaultValue; } // If the user set the helper override to the empty string then they are signalling not to use a helper if (string.IsNullOrEmpty(helperName)) { path = null; return(false); } if (Path.IsPathRooted(helperName)) { path = helperName; } else { string executableDirectory = Path.GetDirectoryName(Context.ApplicationPath); path = Path.Combine(executableDirectory !, helperName); } if (!Context.FileSystem.FileExists(path)) { // Only warn for missing helpers specified by the user, not in-box ones if (isOverride) { Context.Trace.WriteLine($"UI helper '{helperName}' was not found at '{path}'."); Context.Streams.Error.WriteLine($"warning: could not find configured UI helper '{helperName}'"); } return(false); } return(true); }
/// <summary> /// 自刷新行为 /// </summary> public override void RefreshCache() { string hql = "from LiveRecommandInfo l order by l.Rank"; var recommands = LiveRecommandInfo.Execute(new HqlReadQuery <LiveRecommandInfo>(hql)) as IList <LiveRecommandInfo>; var modes = recommands.Select(r => r.Mode).Distinct().ToPerfectList(); var dic = InitIndex(modes); foreach (var plat in PlatformUtils.FormatLivePlatform()) { var query = from r in recommands join recrel in ChannelLiveRecomRelCache.Instance.Items on r.ID equals recrel.LiveRecommandID into recrels let x = FormatRecommands(dic, r, plat, recrels) select x; query.Count(); } _cache = dic; }
private void openIglooList() { if (!isLoadingPrefab) { isLoadingPrefab = true; if (PlatformUtils.GetAspectRatioType() == AspectRatioType.Portrait) { ClubPenguin.SceneRefs.FullScreenPopupManager.CreatePopup(contentPrefabContentKey, "Accessibility.Popup.Title.IglooList", useCameraSpace: false, onPrefabCreated); } else { Content.LoadAsync(onContainerPrefabLoaded, containerPrefabContentKey); } } }
public IActionResult GetProfile() { var userId = PlatformUtils.GetIdentityUserId(User); var entity = AuthorizationLayer.GetUserById(userId); //verifico validità dell'entità if (entity == null) { return(NotFound()); } //Serializzazione e conferma return(Ok(ContractUtils.GenerateContract(entity))); }
public override void OnEnter() { PlatformType platformType = PlatformUtils.GetPlatformType(); PlatformType platformType2 = platformType; if (platformType2 == PlatformType.Standalone) { base.Fsm.Event(OnStandalone); } else { base.Fsm.Event(OnMobile); } Finish(); }
static TizenSDKUtilities() { if (PlatformUtils.IsLinux()) { SDKDirectory = new NPath(NPath.HomeDirectory + "/tizen-2.4.0-linux"); } else { if (!PlatformUtils.IsOSX()) { throw new NotSupportedException("Building Tizen on Windows is not supported."); } SDKDirectory = new NPath(NPath.HomeDirectory + "/tizen-2.4.0-macosx"); } }
public static void saveGame() { GameObject gameMainUI = ScreenManager.instance().get("GameMainUI"); if (gameMainUI != null) { MainState mainState = gameMainUI.GetComponent <MainState>(); if (gameMainUI.activeSelf || mainState.paused()) { GameSaveData saveData = mainState.saveGame(); Debug.Log("save game " + saveData); PlatformUtils.writeObject(gameTempSavePath, saveData); } } }
public static void PreloaderMain(string[] args) { string bepinPath = Path.GetDirectoryName(Path.GetDirectoryName(Path.GetFullPath(EnvVars.DOORSTOP_INVOKE_DLL_PATH))); PlatformUtils.SetPlatform(); Paths.SetExecutablePath(EnvVars.DOORSTOP_PROCESS_PATH, bepinPath); Preloader.IL2CPPUnhollowedPath = Path.Combine(Paths.BepInExRootPath, "unhollowed"); AppDomain.CurrentDomain.AssemblyResolve += LocalResolve; AppDomain.CurrentDomain.AssemblyResolve -= DoorstopEntrypoint.ResolveCurrentDirectory; Preloader.Run(); }
public override void RefreshCache() { var livetypes = LiveTypeCache.Instance.Items; var list = new List <LiveTypeNode>(livetypes.Count); var types = from livetype in livetypes join rel in ChannelLiveRelCache.Instance.Items on livetype.ID equals rel.LiveTypeID into rels select new { Type = livetype, Rels = rels.OrderBy(r => r.Rank) }; foreach (var type in types) { var count = type.Rels.Count(); if (count <= 0) { continue; } var node = new LiveTypeNode() { Language = SimpleLanguageHandler.ProcessLang(type.Type.TypeName, type.Type.TypeNameEng), PicLink = type.Type.PicLink, ID = type.Type.ID, Channels = new Dictionary <VideoNodeKey, List <int> >(PlatformUtils.FormatVodPlatform().Count) }; foreach (var rel in type.Rels) { LiveVideoNode v; if (LiveListCache.Instance.Dictionary.TryGetValue(rel.ChannelID, out v)) { foreach (var plat in v.PlatForms) { var vk = new VideoNodeKey(plat.PlatformName, 0, plat.Licence); if (!node.Channels.ContainsKey(vk)) { node.Channels.Add(vk, new List <int>(count)); } node.Channels[vk].Add(v.Main.ChannelID); } } } list.Add(node); } _cache = list; }
public ICredential GetCredentials(string resource, string userName) { EnsureArgument.NotNullOrWhiteSpace(resource, nameof(resource)); ThrowIfUserInteractionDisabled(); // TODO: we only support system GUI prompts on Windows currently if (Context.SessionManager.IsDesktopSession && PlatformUtils.IsWindows()) { return(GetCredentialsByUi(resource, userName)); } ThrowIfTerminalPromptsDisabled(); return(GetCredentialsByTty(resource, userName)); }
//public void Reinit() => Init(); public void Init() { s_window = this; P.Load(); m_currentPlatform = null; m_supportBuildTarget = PlatformUtils.GetSupportList(); _enableAssetBundle = EditorHelper.HasMenuItem(Window_AssetBundle_Browser); _enableBuildReport = EditorHelper.HasMenuItem(Window_Show_Build_Report); MakeDrawBuildTarget(); OnFocus(); }