public static void OnGUI(EditorStates states) { States = states; EditorState curState = states.curState; CanvasGUI.BeginGroup(new Rect(curState.panDelta, curState.canvasSize), (states.curSpace | EventSpace.CanvasSpace) == EventSpace.CanvasSpace); for (int i = 0; i < Cache.Nodes.Count; i++) { Cache.Nodes.Get(i).DrawConnection(); } if (curState.connectionIndex > -1) { BaseNodule startNodule = curState.selectedObject as BaseNodule; if (curState.connectionIndex > startNodule.Nodules.Count - 1) { InputHandlers.OnSelectConnection(states); } else { CanvasGUI.DrawConnection(startNodule, startNodule.Nodules.Get(curState.connectionIndex), Color.red); } } Cache.Nodes.OnGUI(); CanvasGUI.EndGroup(); CanvasGUI.BeginGroup(CanvasGUI.OptionRect, GUI.skin.box, states.curSpace == EventSpace.Actor); switch (tab) { case OptionTab.actor: Cache.Actors.OnGUI(); break; case OptionTab.condition: Cache.Conditions.OnGUI(); break; } if (CanvasGUI.Button(new Rect(5, 5, 70, 20), "Conditions")) { tab = OptionTab.condition; } else if (CanvasGUI.Button(new Rect(80, 5, 50, 20), "Actors")) { tab = OptionTab.actor; } CanvasGUI.EndGroup(); }
public void PopulateCollection() { OptionTabsCollection = new ObservableCollection <OptionTab>(); OptionTab generalTab = new OptionTab() { Header = "General", Content = GeneralTabContent, TabPosition = TabPosition.Above }; OptionTab displayTab = new OptionTab() { Header = "Display", Content = DisplayTabContent, TabPosition = TabPosition.Above }; OptionTabsCollection.Add(generalTab); OptionTabsCollection.Add(displayTab); }
public void SetTabLabelColor(OptionTab index) { switch (index) { case OptionTab.Account: { Utility.SetLabelColor(tab_account_label, Color.white); Utility.SetLabelColor(tab_game_label, Color.gray); Utility.SetLabelColor(tab_notice_label, Color.gray); Utility.SetLabelColor(tab_etc_label, Color.gray); } break; case OptionTab.Game: { Utility.SetLabelColor(tab_account_label, Color.gray); Utility.SetLabelColor(tab_game_label, Color.white); Utility.SetLabelColor(tab_notice_label, Color.gray); Utility.SetLabelColor(tab_etc_label, Color.gray); } break; case OptionTab.Notice: { Utility.SetLabelColor(tab_account_label, Color.gray); Utility.SetLabelColor(tab_game_label, Color.gray); Utility.SetLabelColor(tab_notice_label, Color.white); Utility.SetLabelColor(tab_etc_label, Color.gray); } break; case OptionTab.ETC: { Utility.SetLabelColor(tab_account_label, Color.gray); Utility.SetLabelColor(tab_game_label, Color.gray); Utility.SetLabelColor(tab_notice_label, Color.gray); Utility.SetLabelColor(tab_etc_label, Color.white); } break; } }
/// <summary> /// To Create Select Multiple Items from a List Global Question /// </summary> public string CreateGQ_SelectMultipleitems(DataRow dr) { if (dr != null) { reference = dr["Reference"].ToString() + "_" + DateTime.Now.ToString().Replace(' ', '_').Replace(':', '_').Replace('/', '_'); TxtReference.Clear(); TxtReference.SendKeys(reference); if (dr["Active"].ToString().ToLower() == "yes") { RdoActiveYes.Click(); } else { RdoActiveNo.Click(); } TxtLabel(dr["Label"].ToString()); if (dr["Required"].ToString().ToLower() == "yes") { RdoRequiredYes.Click(); } else { RdoRequiredNo.Click(); } BaseMethods.DdlSelectByText(DdlAnswerFormat, dr["AnswerFormat"].ToString()); BtnSubmit.Click(); Thread.Sleep(2000); Assert.IsTrue(SuccessMessage.Displayed, reference + " - Select Multiple Items from a List Global Question is not " + formSubmitType + " successfully"); ExtentReport.test.Log(LogStatus.Pass, "Success Message is displayed, " + reference + " - Select Multiple Items from a List Global Question " + formSubmitType + " successfully"); if (dr["Options"].ToString().Trim() != string.Empty) { OptionTab.Click(); if (formSubmitType == "created") { #region Adding Answer Options AddOptionButton.Click(); string[] OptionsList = dr["Options"].ToString().Trim().Split(','); for (int i = 0; i < OptionsList.Length; i++) { AnswerOptionsTextBox.SendKeys(OptionsList[i].Trim() + "\r\n"); } BtnSubmit.Click(); Thread.Sleep(2000); Assert.IsTrue(SuccessMessage.Displayed, "Answer Options for the Global Question " + reference + " is not created successfully"); ExtentReport.test.Log(LogStatus.Pass, "Answer Options for the Global Question " + reference + " is created successfully"); #endregion #region Answer Options Moving Up and Down if (OptionsList.Length > 1) { AnswerOption_MoveUp.Click(); ExtentReport.test.Log(LogStatus.Pass, "Answer Options for the Global Question " + reference + " has been moved up successfully"); Thread.Sleep(2000); AnswerOption_MoveDown.Click(); ExtentReport.test.Log(LogStatus.Pass, "Answer Options for the Global Question " + reference + " has been moved down successfully"); } #endregion #region Making Answer Option InActive Thread.Sleep(2000); AnswerOption_Edit.Click(); RdoActiveNo.Click(); BtnSubmit.Click(); Thread.Sleep(2000); Assert.IsTrue(SuccessMessage.Displayed, "Making " + OptionsList[0].Trim() + " - Answer Option InActive was unsuccessfully"); ExtentReport.test.Log(LogStatus.Pass, OptionsList[0].Trim() + " - Answer Option has been made InActive successfully"); #endregion } else { string optionNameBefore = AnswerOption_Name.Text; Thread.Sleep(2000); AnswerOption_Edit.Click(); AnswerOption_NameTxtBx.Clear(); AnswerOption_NameTxtBx.SendKeys(dr["Options"].ToString()); RdoActiveNo.Click(); BtnSubmit.Click(); Assert.AreEqual(dr["Options"].ToString(), AnswerOption_Name.Text, "Answer Options for the Global Question is not edited successfully"); ExtentReport.test.Log(LogStatus.Pass, optionNameBefore + " has been successfully edited to " + AnswerOption_Name.Text + " and made InActive"); } } } return(reference); }