private static void ShowErrorPopUp(string message) { var errorPopup = new ErrorPopup(); errorPopup.lbl_errorPopupLabel.Text = message; errorPopup.ShowDialog(); }
public void InitErrorPopup(Action tryAgainCallback = null, Action homeCallback = null) { GameObject popupObject = Utils.Spawn(ErrorPrefab, Root); ErrorPopup errorPopup = popupObject.GetComponent <ErrorPopup>(); errorPopup.Init(tryAgainCallback, homeCallback); }
/// <summary> /// Displays a popup to the user indicating an error occured. /// </summary> private async Task ReportErrorAsync(string message) { await DispatchAwaitableUITask(async() => { ErrorPopupText.Text = "Something went wrong.\r\n" + message + "\r\nThe app will now exit."; var results = await ErrorPopup.ShowAsync(); Application.Current.Exit(); }); }
private void Button_Click(object sender, RoutedEventArgs e) { try { throw new ArgumentException("Test"); } catch (Exception ex) { _logger.LogError(ex, "Error Button clicked"); var popup = new ErrorPopup("Test", ex); popup.Show(); } }
public static ErrorPopup show(ErrorPopupOptions options) { if (prefab == null) { prefab = Resources.Load("ErrorPopup") as GameObject; } GameObject popupPrefab = Instantiate(prefab) as GameObject; ErrorPopup popup = popupPrefab.GetComponent <ErrorPopup>(); popup.updateContent(options); return(popup); }
private IEnumerator loadErrorPopup() { AssetRequest <GameObject> assetRequest = Content.LoadAsync(ErrorPopup.DefaultContentKey); yield return(assetRequest); GameObject asset = Object.Instantiate(assetRequest.Asset); asset.transform.SetParent(parentContainer, worldPositionStays: false); ErrorPopup errorPopup = asset.GetComponent <ErrorPopup>(); string errorMessage = Service.Get <ErrorsMap>().GetErrorMessage(errorId); errorPopup.ShowErrorMessage(errorMessage, position); }
public void ShowPopup() { ErrorPopup err = new ErrorPopup(); err.Height = this.ActualHeight; err.Width = this.ActualWidth; this.popup.Child = err; flag = HamburgerMenu.IsPaneOpen; this.HamburgerMenu.IsPaneOpen = false; popup.IsOpen = true; this.Opacity = 0.2; }
public void Setup() { var go = new GameObject("Error Popup Test Fixture"); Canvas = go.AddComponent <Canvas>(); var errorPopupAsset = AssetDatabase.LoadAssetAtPath <GameObject>("Assets/Shopify/UIToolkit/Themes/Generic/Assets/Error Popup/Error Popup.prefab"); var errorPopupGo = GameObject.Instantiate(errorPopupAsset, Vector3.zero, Quaternion.identity); errorPopupGo.transform.SetParent(Canvas.transform, false); Popup = errorPopupGo.GetComponent <ErrorPopup>(); // Speed up the animator for the tests... Popup.Animator.speed = 10f; }
public override void OnPhotonCreateRoomFailed(object[] codeAndMsg) { Debug.Log("방 생성 실패"); PhotonNetwork.Disconnect(); ErrorPopup error = ErrorPopup.show(new ErrorPopupOptions { popupDelegate = () => { Debug.Log("Error OK"); }, message = "방 입장에 실패하였습니다." }); OnClickGameButton(); }
private void Start() { processName = tbProcessName.Text.Trim(); if (processName == String.Empty) { ErrorPopup.SetError(tbProcessName, "Введите имя процесса."); ErrorPopup.ShowPopup(); return; } try { interval = Convert.ToInt32(nudCheclInterval.Value) * 1000; if (interval <= 0) { throw new Exception(); } timer.Interval = interval; } catch { ErrorPopup.SetError(nudCheclInterval, "Укажите корректный интервал."); ErrorPopup.ShowPopup(); return; } startFilePath = tbStartFilePath.Text; if (startFilePath.Trim() == String.Empty || !File.Exists(startFilePath)) { ErrorPopup.SetError(tbStartFilePath, "Укажите существующий файл."); ErrorPopup.ShowPopup(); } startFile = chbStartFile.Checked; timer.Start(); btStart.Enabled = false; btStop.Enabled = true; tbProcessName.Enabled = false; nudCheclInterval.Enabled = false; chbStartFile.Enabled = false; tbStartFilePath.Enabled = false; tbStatus.Text = "Работает"; AddMessage("Запуск призведён"); }
void Awake() { DontDestroyOnLoad(this); errorHandler = new ErrorPopup(); gameObject.AddComponent<Dataharvester>(); sServer = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); IPAddress remoteIPAddress = IPAddress.Parse(serverAddress); IPEndPoint remoteEndPoint = new IPEndPoint(remoteIPAddress, serverPort); singleton = this; try { sServer.Connect(remoteEndPoint); } catch (Exception e) { Debug.Log("Connectionerror"); errorHandler.add("Connection Failed", e.ToString()); } }
public void OnGUI(Rect r, float minY, float maxY, File model) { if (this.isDir == false) { return; } if (this.canDisplay == false) { GUI.Label(r, "No change detected."); return; } r.height = 16F; if (Event.current.type == EventType.Repaint && r.Contains(Event.current.mousePosition) == true) { EditorGUI.DrawRect(r, File.HighlightBackground); } else if (Event.current.type == EventType.MouseMove && r.Contains(Event.current.mousePosition) == true) { Utility.RepaintEditorWindow(typeof(NGSyncFoldersWindow)); } EditorGUI.BeginChangeCheck(); this.open = EditorGUI.Foldout(r, this.open, this.name, true); if (EditorGUI.EndChangeCheck() == true) { this.InvalidateHeight(); } if (this.open == false) { return; } r.y += r.height; if (r.y > maxY) { return; } float w = r.width; EditorGUI.indentLevel++; for (int i = 0; i < this.children.Count; i++) { if (this.children[i].isDir == true) { if (this.children[i].canDisplay == true) { File m = this.children[i].GetCacheModel(model, this.children[i].name); r.height = this.children[i].GetHeight(m); if (r.yMax >= minY) { this.children[i].OnGUI(r, minY, maxY, m); } r.y += r.height; if (r.y > maxY) { break; } } } else { if (this.isMaster == true) { if (this.children[i].masterState != MasterState.Same) { r.height = 16F; if (r.yMax >= minY) { Color color = default(Color); if (this.children[i].masterState == MasterState.Created) { color = NGSyncFoldersWindow.CreateColor; } else if (this.children[i].masterState == MasterState.Altered) { color = NGSyncFoldersWindow.RestoreColor; } else if (this.children[i].masterState == MasterState.Deleted) { color = NGSyncFoldersWindow.DeleteColor; } if (Event.current.type == EventType.Repaint && r.Contains(Event.current.mousePosition) == true) { EditorGUI.DrawRect(r, color); } else if (Event.current.type == EventType.MouseMove && r.Contains(Event.current.mousePosition) == true) { Utility.RepaintEditorWindow(typeof(NGSyncFoldersWindow)); } EditorGUI.LabelField(r, Utility.Color(this.children[i].name, color), GeneralStyles.RichLabel); } r.y += r.height; if (r.y > maxY) { break; } } } else { File m = this.children[i].GetCacheModel(model, this.children[i].name); Action action = this.children[i].ChooseAction(m); if (action != Action.Nothing) { r.height = 16F; if (r.yMax >= minY) { Color color = default(Color); if (action == Action.Create) { color = NGSyncFoldersWindow.CreateColor; } else if (action == Action.Change) { color = NGSyncFoldersWindow.RestoreColor; } else if (action == Action.Delete) { color = NGSyncFoldersWindow.DeleteColor; } if (Event.current.type == EventType.Repaint && r.Contains(Event.current.mousePosition) == true) { EditorGUI.DrawRect(r, color * .2F); } else if (Event.current.type == EventType.MouseMove && r.Contains(Event.current.mousePosition) == true) { Utility.RepaintEditorWindow(typeof(NGSyncFoldersWindow)); } r.width -= 75F; if (this.children[i].actionException != null) { r.width -= 75F; } EditorGUI.LabelField(r, Utility.Color(this.children[i].name, color), GeneralStyles.RichLabel); r.x += r.width; if (this.children[i].actionException != null) { r.width = 75F; using (BgColorContentRestorer.Get(Color.red)) { if (GUI.Button(r, "Error") == true) { ErrorPopup e = new ErrorPopup(NGSyncFoldersWindow.Title); e.exception = this.children[i].actionException; e.OpenError(r); } } r.x += r.width; } using (BgColorContentRestorer.Get(action == Action.Create ? NGSyncFoldersWindow.CreateColor : (action == Action.Change ? NGSyncFoldersWindow.RestoreColor : NGSyncFoldersWindow.DeleteColor))) { r.width = 75F; if (GUI.Button(r, action.ToString()) == true) { this.children[i].Sync(m); } r.x -= w - 75F; if (this.actionException != null) { r.x -= 75F; } r.width = w; } } r.y += r.height; if (r.y > maxY) { break; } } } } } EditorGUI.indentLevel--; }