private void init() { AllowsTransparency = false; this.DataContext = this; consoleTextBox = new TextBox(); consoleTextBox.FontSize = 14; consoleTextBox.AcceptsReturn = true; consoleTextBox.TextWrapping = TextWrapping.Wrap; consoleTextBox.TextChanged += TextChangedEventHandler; consoleTextBox.KeyUp += consoleTextBox_KeyUp; consoleTextBox.KeyDown += ConsoleTextBox_KeyDown; consoleTextBox.PreviewKeyDown += ConsoleTextBox_PreviewKeyDown; consoleTextBox.IsReadOnlyCaretVisible = false; consoleTextBox.IsReadOnly = true; debugPanel = new DebugPanel(); debugPanel.requireDebugAction += handleRequireDebugAction; drawTreePanel = new DrawTreePanel(); errorPanel = new ErrorPanel(); textEditor.editorDelegate = this; idleExec.timeOutAction += IdleExec_timeOutAction; }
void MainFrm_Load(object sender, EventArgs e) { GlobalService.UserId = System.Configuration.ConfigurationManager.AppSettings["CoreId"]; string path = Path.Combine(Path.GetDirectoryName(Application.ExecutablePath), "DockPanel.config"); if (File.Exists(path)) { try { this.m_workspace.LoadFromXml(path, this.m_deserializeDockContent); } catch (Exception ex) { } } else { this.m_errorPanel = new ErrorPanel(); this.m_prjPanel = new ProjectPanel(); this.m_propertyPanel = new PropertyPanel(); //this.m_tabsPanel = new TabsPanel(); m_prjPanel.Show(this.m_workspace, WeifenLuo.WinFormsUI.Docking.DockState.DockLeft); m_errorPanel.Show(this.m_workspace, DockState.DockBottom); m_propertyPanel.Show(this.m_workspace, DockState.DockRight); //var f = new FileTabPanel(); //f.TabText = "1.dm"; //f.Show(this.m_workspace, DockState.Document); } this.Init(); }
private void TransportWorker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs args) { if (args.Cancelled) { RemainingTimeLabel.Text = Tx.T("msg.cancelled"); progressBar1.Value = 0; } else if (args.Error != null) { RemainingTimeLabel.Text = Tx.T("msg.title.error"); ErrorLabel.Text = args.Error.Message; ErrorPanel.Show(); FinishedInfoLabel.Text = Tx.T("transport progress view.select another transport"); FinishedInfoLabel.Show(); } else { RemainingTimeLabel.Text = Tx.T("msg.completed"); finished = true; SuccessPanel.Show(); if (SharedData.Instance.FromShortcut) { FinishedInfoLabel.Text = Tx.T("transport progress view.delete shortcut"); FinishedInfoLabel.Show(); } UpdateButtons(); } }
void Awake() { mNetworkManager = (NetworkManager)GameObject.FindObjectOfType(typeof(NetworkManager)); mGamesList = (dfListbox)GameObject.FindObjectOfType(typeof(dfListbox)); mLoadingPanel = (LoadingPanel)GameObject.FindObjectOfType(typeof(LoadingPanel)); mErrorPanel = (ErrorPanel)GameObject.FindObjectOfType(typeof(ErrorPanel)); }
public IEnumerator uploadScoreData() { Debug.Log("Attempting to Upload Score Data"); WWWForm form = new WWWForm(); form.AddField("score", GameController.MyScore.CurrentScore); form.AddField("gamerID", UserData.GamerID); using (UnityWebRequest www = UnityWebRequest.Post(URL, form)) { yield return(www.SendWebRequest()); if (www.isNetworkError || www.isHttpError || www.error != null) { Debug.Log(www.error); ErrorPanel.ShowError("ERROR: " + www.error); } else { var response = JSON.Parse(www.downloadHandler.text); if (response["code"].AsInt == 200) { Debug.Log("Upload Successfull"); } else { ErrorPanel.ShowError("Upload Unsuccessfull. Reason: " + response["message"]); } } ButtonHelper.ResetClick(); } }
private void RunQuery_Click(object sender, EventArgs e) { try { string Script = ArchiScript.Text; Cli.UpdateHost("Processing query...", 0, false, true); Response R = Cli.QueryServer(Script) as Response; if (R.Attachment is string) { OutStream.Write(R.Attachment as string); Cli.Workspace_Lower.Controls.Add(OutStream); } else if (R.Attachment is Table) { Cli.Workspace_Lower.Controls.Add(new TablePreview(R.Attachment as Table, Cli, false, true)); } Cli.UpdateHost("Ready", 6); } catch (Exception ex) { stats_lbl.Text = ex.Message; ErrorPanel.Visible = true; ErrorSign.Visible = true; ErrorPanel.BringToFront(); } }
public IEnumerator Login() { Debug.Log("Attempting Login"); WWWForm form = new WWWForm(); form.AddField("email", UserData.EmailID); form.AddField("password", UserData.Password); using (UnityWebRequest www = UnityWebRequest.Post(AuthenticateURL, form)) { yield return(www.SendWebRequest()); if (www.isNetworkError || www.isHttpError || www.error != null) { Debug.Log(www.error); ErrorPanel.ShowError("ERROR: " + www.error); } else { var response = JSON.Parse(www.downloadHandler.text); Debug.Log("Sign In Successfull"); UserData.GamerID = response["gamerID"]; GameController.MyScore.CurrentScore = 0; GameController.MyScore.HighScore = 0; StartCoroutine(fetchGameData()); Debug.Log(response["message"]); } } ButtonHelper.ResetClick(); }
public void ShowError(string message) { if (InvokeRequired) { Invoke(new Action <string>(ShowError), message); return; } ErrorPanel.ShowError(this, message, null); }
public void ReportCancelled() { if (InvokeRequired) { Invoke(new Action(ReportCancelled)); return; } ErrorPanel.ShowError(this, "Report was cancelled", null); }
protected virtual void Dispose(bool disposing) { if (disposing) { ErrorPanel?.Dispose(); ErrorMessage?.Dispose(); MainPanel?.Dispose(); ServerName?.Dispose(); MemoryAllocation?.Dispose(); RadAjaxManager?.Dispose(); CacheGrid?.Dispose(); } }
private void UpdateActive(bool forceClear) { EnableButtons(false); _treeViewInvalidated = true; try { ViewModel.UpdateActive(forceClear); } catch (Exception ex) { ErrorPanel.ShowError(this, ex.Message, CloseCallback); } }
public void Deactivate(bool forward) { if (TransportWorker.IsBusy) { TransportWorker.CancelAsync(); } if (!forward) { ErrorPanel.Hide(); SuccessPanel.Hide(); FinishedInfoLabel.Hide(); MainForm.Instance.FinishEnabled = false; } }
private void btnSave_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(tbName.Text)) { ErrorPanel.ShowError(this, "You must enter a Name", null); return; } Model.Item.Name = tbName.Text; ViewModel.SavePattern(Model); Close(); }
void Awake() { // This is just for during testing - as the unity master server keeps banning me! // MasterServer.ipAddress = "127.0.0.1"; // MasterServer.port = 23466; mDialogueManager = GameObject.FindObjectOfType <DialogueManager>(); mErrorPanel = GameObject.FindObjectOfType <ErrorPanel>(); mPlayerPrefab = Resources.Load <GameObject>("Prefabs/Player"); mGame = FindObjectOfType <Game>(); /** * Persist the NetworkManager between scenes */ DontDestroyOnLoad(gameObject); }
public ErrorPanel ShowErrorDialog(string message, UnityAction clickButtonEvent) { ErrorPanel NewErrorPanel = Instantiate(errorPanel) as ErrorPanel; NewErrorPanel.SetText(message, clickButtonEvent); NewErrorPanel.transform.SetParent(gameObject.transform); NewErrorPanel.transform.localScale = new Vector3(1, 1, 1); RectTransform rctr = NewErrorPanel.GetComponent <RectTransform>(); rctr.offsetMax = new Vector2(0, 0); rctr.offsetMin = new Vector2(0, 0); rctr.anchoredPosition3D = new Vector3(0, 0, 0); return(NewErrorPanel); }
public void ACTION_REGISTER() { ButtonHelper.Clicked(); string name = register.transform.Find("name").GetComponent <InputField>().text; string email = register.transform.Find("email").GetComponent <InputField>().text; string password = register.transform.Find("password").GetComponent <InputField>().text; string gamerID = register.transform.Find("gamerID").GetComponent <InputField>().text; string validEmail = FormValidation.ValidEmail(email); string validName = FormValidation.ValidName(name); string validPassword = FormValidation.ValidPassword(password); string validGamerID = FormValidation.ValidGamerID(gamerID); if (validName != null) { ErrorPanel.ShowError(validName); ButtonHelper.ResetClick(); } else if (validGamerID != null) { ErrorPanel.ShowError(validGamerID); ButtonHelper.ResetClick(); } else if (validEmail != null) { ErrorPanel.ShowError(validEmail); ButtonHelper.ResetClick(); } else if (validPassword != null) { ErrorPanel.ShowError(validPassword); ButtonHelper.ResetClick(); } else { OnlineManager.UserData.Name = name; OnlineManager.UserData.EmailID = email; OnlineManager.UserData.Password = password; OnlineManager.UserData.GamerID = gamerID; StartCoroutine(onlineManager.Register()); } }
private IEnumerator wakeUp() { Debug.Log("Attempting WakeUp"); WWWForm form = new WWWForm(); form.AddField("dummy", "dummy"); using (UnityWebRequest www = UnityWebRequest.Post(URL + "/dummy/", form)) { yield return(www.SendWebRequest()); if (www.isNetworkError || www.isHttpError) { Debug.Log(www.error); } else { StringBuilder sb = new StringBuilder(); foreach (KeyValuePair <string, string> dict in www.GetResponseHeaders()) { sb.Append(dict.Key).Append(": \t[").Append(dict.Value).Append("]\n"); } if (www.GetResponseHeader("code") != null) { if (count > 10) { ErrorPanel.ShowError("Fatal Error. Server Not Responding"); count = 0; } else { count++; Debug.Log("Continuing"); StartCoroutine(wakeUp()); } } else { Debug.Log("Success Awake!"); count = 0; } } } }
private void UpdateSelectedGroup(bool forceClear) { if (tvFiles.SelectedNode == null) { return; } EnableButtons(false); _treeViewInvalidated = true; try { ViewModel.UpdateSelectedGroup(tvFiles.SelectedNode, forceClear); } catch (Exception ex) { ErrorPanel.ShowError(this, ex.Message, CloseCallback); } }
public IEnumerator fetchGameData() { Debug.Log("Attempting to Fetch Game Data"); WWWForm form = new WWWForm(); form.AddField("gamerID", UserData.GamerID ?? "__no__"); form.AddField("gamePlatform", GameController.GameData.gamePlatform + "_" + GameController.GameData.gameBuildType + "_" + GameController.GameData.gameVersion); using (UnityWebRequest www = UnityWebRequest.Post(URL, form)) { yield return(www.SendWebRequest()); if (www.isNetworkError || www.isHttpError || www.error != null) { Debug.Log(www.error); ErrorPanel.ShowError("ERROR: " + www.error); } else { var response = JSON.Parse(www.downloadHandler.text); if (response["code"].AsInt == 200) { Debug.Log("Fetch Successfull"); Word_Server.Words = response["words"]; WordManager.Initialize(); GameController.GameData.enabled = response["enabled"]; uiManager.SwitchPage(UIManager.Page.MainMenu); } else if (response["code"].AsInt == 100) { ErrorPanel.ShowError("Error: " + response["message"]); //StartCoroutine(downloadFile()); } else { ErrorPanel.ShowError("Fetch Unsuccessfull. Reason: " + response["message"]); } } } ButtonHelper.ResetClick(); }
public IEnumerator downloadScoreData() { Debug.Log("Attempting to download LeaderBoard Data"); WWWForm form = new WWWForm(); using (UnityWebRequest www = UnityWebRequest.Post(URL, form)) { yield return(www.SendWebRequest()); if (www.isNetworkError || www.isHttpError || www.error != null) { Debug.Log(www.error); ErrorPanel.ShowError("ERROR: " + www.error); } else { var response = JSON.Parse(www.downloadHandler.text); if (response["code"].AsInt == 200) { Debug.Log("Download Successfull"); var data = response["leaderBoardData"].AsArray; List <string> gamerIDs = new List <string>(); List <string> scores = new List <string>(); foreach (JSONObject obj in data) { var key = obj.GetKeys()[0] as string; gamerIDs.Add(key); scores.Add(obj[key]); } uiManager.showLeaderboardData(gamerIDs, scores); uiManager.SwitchPage(UIManager.Page.HighScore); } else { ErrorPanel.ShowError("Fetch Unsuccessfull. Reason: " + response["description"]); } } } ButtonHelper.ResetClick(); }
IEnumerator DownloadFile(string URL) { Debug.Log("Downloading...."); var www = new WWW("URL"); yield return(www); while (!www.isDone) { } if (www.error == null) { File.WriteAllBytes(Environment.GetFolderPath(Environment.SpecialFolder.Desktop) + "/" + "Words", www.bytes); Debug.Log("Download Complete" + www.bytes.ToString()); ErrorPanel.ShowError("Download Complete.\nLaunch Latest Version From Desktop."); Application.Quit(); } else { Debug.Log("Download Failed."); ErrorPanel.ShowError("Download Failed: " + www.error.ToString()); } }
public void Init() { button_style.normal.background = button_up_texture; button_style.active.background = button_down_texture; button_style.normal.textColor = Color.white; button_style.active.textColor = new Color(0.75f, 0.75f, 0.75f); button_style.alignment = TextAnchor.MiddleCenter; button_style.fontSize = 30; remove_style.normal.background = red_button_up_texture; remove_style.active.background = red_button_down_texture; remove_style.normal.textColor = Color.black; remove_style.active.textColor = new Color(0.75f, 0.75f, 0.75f); remove_style.alignment = TextAnchor.MiddleCenter; remove_style.fontSize = 30; code_style.fontSize = 20; code_style.normal.textColor = Color.black; code_style.font = ide_font; code_style.wordWrap = false; shouldPopup = shouldRemove = false; //editorPanel = new Rectangle(0,0,Screen.width*3/4,Screen.height); editorPanel = new EditorPanel(this); editorPanel.setTexture(left_panel_background); //editorPanel.scale((float) 0.5, (float) 0.75); //editorPanel.move(800, 150); errorPanel = new ErrorPanel(this); errorPanel.setTexture(left_panel_background); //errorPanel.scale((float) 2, (float) 0.25); //errorPanel.move(-200, 500); //errorPanel = new Rectangle(Screen.width*3/4+5,0,Screen.width*1/4-5,Screen.height); buttonPanel = new ButtonPanel(this); trashcan = Resources.Load("Crumpled_Paper") as Texture2D; //trashcan.Resize(32, 32); }
public ErrorPanel() { _instance = this; }
public void SaveCharacter() { if (pcName != "" && pcType != "" && pcMotivation != "" && xtra == 0) { Debug.Log("save the Game for the First time"); PCharacter pc = new PCharacter(pcName, pcType, pcMotivation, str, dex, iq, wis, per, hlth, aura, face); SaveGame.current = new SaveGame(); Debug.Log("Setting up new save game slot"); SaveGame.current.GROUP.Add(pc); Debug.Log("adding PC to group"); SaveGame.current.index = -1; //Initial Tags SaveGame.current.TAGS.Add("Thelmore_Tavern_Open"); /* SaveGame.current.thelmoreBank = true; SaveGame.current.thelmoreBarracks = false; SaveGame.current.thelmoreInn = true; * SaveGame.current.thelmoreRoad = false; SaveGame.current.thelmoreSmith = true; SaveGame.current.thelmoreTavern = true; * SaveGame.current.thelmoreTemple = true; SaveGame.current.thelmoreToolShop = true; SaveGame.current.thelmoreTownHall = false; * SaveGame.current.thelmoreVoncar = true; SaveGame.current.thelmoreWell = true; Debug.Log("Started bools"); */ //load rumors SaveAndLoad.LoadDefaultRumorList(); //Create NPCList int randMot, randTyp, randFac; string tempMot = "", tempTyp = "", tempNam = ""; PCharacter[] NPC = new PCharacter[25]; for (int i = 0; i < 25; i++) { //Name tempNam = GameManager.GAME.randomName[Random.Range(0, GameManager.GAME.randomName.Count)]; //Type randTyp = Random.Range(1, 4); if (randTyp == 1) { tempTyp = "Warrior"; } if (randTyp == 2) { tempTyp = "Mage"; } if (randTyp == 3) { tempTyp = "Rogue"; } //Motivation randMot = Random.Range(1, 8); if (randMot == 1) { tempMot = "Money"; } if (randMot == 2) { tempMot = "Power"; } if (randMot == 3) { tempMot = "Honor"; } if (randMot == 4) { tempMot = "Glory"; } if (randMot == 5) { tempMot = "Fate"; } if (randMot == 6) { tempMot = "Duty"; } if (randMot == 7) { tempMot = "Curiosity"; } if (randMot == 4) { tempMot = "Bloodlust"; } randMot = Random.Range(1, 7); //Face randFac = Random.Range(0, 10); //Make NPC NPC[i] = new PCharacter(tempNam, tempTyp, tempMot, randFac); NPC[i].motIndex = randMot; //Add to SaveGame list SaveGame.current.NPCS.Add(NPC[i]); } SaveAndLoad.Save(); Debug.Log("Saving savegame"); SceneManager.LoadScene("ThelmoreTown"); } else { ErrorPanel.SetActive(true); } }
private void Execute_OnClick(object sender, RoutedEventArgs e) { var countOftestcase = MainBlock.Children.Count; for (int i = 0; i < countOftestcase; i++) { var rows = LogicalTreeHelper.FindLogicalNode(MainBlock, "rows" + i); var countOfRow = ((StackPanel)rows).Children.Count; for (var j = 0; j < countOfRow; j++) { var currentAction = LogicalTreeHelper.FindLogicalNode(rows, "ComboBox" + j); if ((currentAction as ComboBox)?.SelectedItem == "Найти элемент") { IResult successResult = new SuccessPanel(); var urlElement = LogicalTreeHelper.FindLogicalNode(MainBlock, "url" + i); var urlContent = (urlElement as TextBox)?.Text; var idElement = LogicalTreeHelper.FindLogicalNode(rows, "id"); var idContent = (idElement as TextBox)?.Text; var chrome = new ChromeDriver(); StackPanel currentRow = (StackPanel)LogicalTreeHelper.FindLogicalNode(rows, "row" + j); var countrow = currentRow.Children.Count; StackPanel currentStatus = (StackPanel)currentRow.Children[countrow - 1]; if (currentStatus.Name == "Success" || currentStatus.Name == "Error") { currentRow.Children.RemoveAt(countrow - 1); } if (string.IsNullOrEmpty(urlContent)) { urlContent = "http://google.com"; } if (string.IsNullOrEmpty(idContent)) { idContent = "lst-ib"; } try { chrome.Navigate().GoToUrl(urlContent); } catch { chrome.Quit(); } try { var query = chrome.FindElement(By.Id(idContent)); query.SendKeys("Фуряева Марина"); query.Submit(); chrome.Quit(); var successPanel = successResult.CreateStackPanel(); currentRow.Children.Add(successPanel); } catch { chrome.Quit(); IResult errorResult = new ErrorPanel(); var errorPanel = errorResult.CreateStackPanel(); currentRow.Children.Add(errorPanel); } } } } }
public void Init() { button_style.normal.background = button_up_texture; button_style.active.background = button_down_texture; button_style.normal.textColor = Color.white; button_style.active.textColor = new Color(0.75f,0.75f,0.75f); button_style.alignment = TextAnchor.MiddleCenter; button_style.fontSize = 30; remove_style.normal.background = red_button_up_texture; remove_style.active.background = red_button_down_texture; remove_style.normal.textColor = Color.black; remove_style.active.textColor = new Color(0.75f,0.75f,0.75f); remove_style.alignment = TextAnchor.MiddleCenter; remove_style.fontSize = 30; code_style.fontSize = 20; code_style.normal.textColor = Color.black; code_style.font = ide_font; code_style.wordWrap = false; shouldPopup = shouldRemove = false; //editorPanel = new Rectangle(0,0,Screen.width*3/4,Screen.height); editorPanel = new EditorPanel(this); editorPanel.setTexture(left_panel_background); //editorPanel.scale((float) 0.5, (float) 0.75); //editorPanel.move(800, 150); errorPanel = new ErrorPanel(this); errorPanel.setTexture(left_panel_background); //errorPanel.scale((float) 2, (float) 0.25); //errorPanel.move(-200, 500); //errorPanel = new Rectangle(Screen.width*3/4+5,0,Screen.width*1/4-5,Screen.height); buttonPanel = new ButtonPanel(this); trashcan = Resources.Load("Crumpled_Paper") as Texture2D; //trashcan.Resize(32, 32); }
private void ErrorButton_Click(object sender, EventArgs e) { ErrorPanel.SendToBack(); ErrorPanel.Visible = false; }
private void handleError(string errorMessage) { ErrorMessage.Text = errorMessage; ErrorPanel.BringToFront(); ErrorPanel.Visible = true; }