private void btnFindDuplicates_Click(object sender, EventArgs e) { for (int i = 0; i < listUrls.Items.Count; ++i) { int found = findDup(i + 1, listUrls.Items[i].Text); if (found >= 0) { clearSelection(); listUrls.Items[i].Focused = listUrls.Items[i].Selected = true; listUrls.Items[found].Focused = listUrls.Items[found].Selected = true; listUrls.EnsureVisible(i); CppUtils.CenteredMessageBox(this, Properties.Resources.DUPITEM_FOUND, Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Information); return; } } CppUtils.CenteredMessageBox(this, Properties.Resources.NO_DUPITEM_FOUND, Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Information); }
private void copyToolStripMenuItem_Click(object sender, EventArgs e) { StringBuilder sb = new StringBuilder(); bool first = true; foreach (ListViewItem item in listUrls.SelectedItems) { if (!first) { sb.AppendLine(); } else { first = false; } sb.Append(item.Text); } try { Clipboard.SetText(sb.ToString()); } catch (Exception ex) { CppUtils.Alert(ex); } }
private void btnOK_Click(object sender, EventArgs e) { string newName = textName.Text; if (string.IsNullOrEmpty(newName)) { CppUtils.CenteredMessageBox(this, Properties.Resources.ENTER_FILENAME, Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Asterisk); return; } if (-1 != newName.IndexOfAny(Program.damemoji.ToCharArray())) { CppUtils.CenteredMessageBox(this, Properties.Resources.FOLLOWING_UNABLE_FILENAME + Environment.NewLine + Environment.NewLine + Program.damemoji, Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Asterisk); return; } this.DialogResult = DialogResult.OK; Close(); }
private void btnAbout_Click(object sender, EventArgs e) { StringBuilder sbMessage = new StringBuilder(); sbMessage.AppendLine(string.Format("{0} v{1}", Application.ProductName, AmbLib.getAssemblyVersion(Assembly.GetExecutingAssembly(), 3))); sbMessage.AppendLine(); sbMessage.AppendLine(AmbLib.getAssemblyCopyright(Assembly.GetExecutingAssembly())); sbMessage.AppendLine(); sbMessage.AppendLine(Program.Url); sbMessage.AppendLine(Properties.Resources.PRESS_CTRL_OK); CppUtils.CenteredMessageBox(this, sbMessage.ToString(), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Information); if (CppUtils.IsCtrlPressed()) { try { Process.Start(Program.Url); } catch (Exception ex) { CppUtils.Alert(ex); } } }
private void btnStart_Click(object sender, EventArgs e) { IsResultOpenURL = radioOpenUrl.Checked; if (IsResultOpenURL) { return; } ResultURLs = txtEnterURLs.Lines; foreach (string u in ResultURLs) { if (u.IndexOf('[') >= 0 && u.IndexOf(']') >= 0) { if (DialogResult.Yes != CppUtils.CenteredMessageBox(this, Properties.Resources.URL_INCLUDES_BLANCKET_CONTINUE, Application.ProductName, MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2)) { DialogResult = DialogResult.None; return; } } } }
private void btnOK_Click(object sender, EventArgs e) { string newName = txtName.Text; if (string.IsNullOrEmpty(newName)) { CppUtils.CenteredMessageBox(this, Properties.Resources.ENTER_FILENAME, Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } if (-1 != newName.IndexOfAny(Program.damemoji.ToCharArray())) { showDamemojiError(); return; } List <Control> backToEnables = disableAll(); if (!Program.RenameIt(this, txtName.Tag.ToString(), newName)) { enableAll(backToEnables); return; } enableAll(backToEnables); this.DialogResult = DialogResult.OK; Close(); }
private void itemExistingFolder_Click(object sender, EventArgs e) { ToolStripMenuItem item = sender as ToolStripMenuItem; if (item == null) { return; } string dir = item.Tag as string; if (dir == null) { // LANG CppUtils.Fatal(dir + " is not a directory"); return; } else if (!System.IO.Directory.Exists(dir)) { if (DialogResult.Yes != CppUtils.YesOrNo(string.Format(Properties.Resources.DIR_NOT_EXIST_DO_YOU_WANT_TO_REMOVE, dir), MessageBoxDefaultButton.Button2)) { return; } removeFromDiskDirs(dir); return; } moveToAndClose(dir); }
static void ShowHelp() { CppUtils.CenteredMessageBox(GetHelpMessage(), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Information); }
private void FormMain_FormClosed(object sender, FormClosedEventArgs e) { bool success = true; HashIni ini = Profile.ReadAll(IniPath); success &= Profile.WriteBool(SECTION_OPTION, KEY_CHECK_SINGLECLICK, chkShowSingleClick.Checked, ini); success &= Profile.WriteBool(SECTION_OPTION, KEY_CHECK_DOUBLECLICK, chkShowDoubleClick.Checked, ini); success &= Profile.WriteBool(SECTION_OPTION, KEY_CHECK_UP, chkShowUp.Checked, ini); success &= Profile.WriteBool(SECTION_OPTION, KEY_CHECK_DOWN, chkShowDown.Checked, ini); success &= Profile.WriteBool(SECTION_OPTION, KEY_CHECK_WHEEL, chkShowWheel.Checked, ini); success &= Profile.WriteBool(SECTION_OPTION, KEY_CHECK_MOVE, chkShowMove.Checked, ini); success &= AmbLib.SaveFormXYWH(this, SECTION_LOCATION, ini); success &= Profile.WriteInt(SECTION_OPTION, KEY_SPLITTER_DISTANCE, splitMain.SplitterDistance, ini); if (success) { try { success &= Profile.WriteAll(ini, IniPath, true); } catch (Exception) { success = false; } } if (!success) { CppUtils.Alert(Properties.Resources.SAVE_FAILED); } }
void FatalExit(string message, bool bExit) { CppUtils.Alert(message); if (bExit) { Environment.Exit(1); } }
void Info(string message) { CppUtils.CenteredMessageBox(this, message, ProductName, MessageBoxButtons.OK, MessageBoxIcon.Information); }
void showDamemojiError() { CppUtils.CenteredMessageBox(this, Properties.Resources.FOLLOWING_UNABLE_FILENAME + Environment.NewLine + Program.damemoji, Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Warning); }
void Alert(string message) { CppUtils.CenteredMessageBox(this, message, ProductName, MessageBoxButtons.OK, MessageBoxIcon.Warning); }
DialogResult YesOrNo(string message) { return(CppUtils.CenteredMessageBox(this, message, ProductName, MessageBoxButtons.YesNo, MessageBoxIcon.Question)); }
private void itemClearFolder_Click(object sender, EventArgs e) { if (DialogResult.Yes != CppUtils.YesOrNo(Properties.Resources.ARE_YOU_SURE_CLEAR_ALL_ITEMS, MessageBoxDefaultButton.Button2)) { return; } DiskDirs = new string[0]; }
static void ShowHelp() { CppUtils.CenteredMessageBox(GetHelpMessage(), string.Format("{0} ver{1}", Application.ProductName, AmbLib.getAssemblyVersion(Assembly.GetExecutingAssembly(), 3)), MessageBoxButtons.OK, MessageBoxIcon.Information); }
static bool preRun() { if (!FolderConfigHelper.IsFolderAccessible(ConfigDir)) { CppUtils.Alert(string.Format(Properties.Resources.ALERT_DIRECTORY_UNAVAILABLE, ConfigDir)); return(false); } return(true); }
private void tsmiRemoveAll_Click(object sender, EventArgs e) { if (DialogResult.Yes != CppUtils.YesOrNo(string.Format("sure all items?"), MessageBoxDefaultButton.Button2)) { return; } listMain.Items.Clear(); }
static GfxDevice() { if (NativeSignatureResolver.IsUnityVersionOverOrEqual(MelonUtils.GetUnityVersion(), new[] { "2020.2.7", "2020.3.0", "2021.1.0" })) { // `FrameTimingManager_CUSTOM_CaptureFrameTimings()` calls `GetRealGfxDevice()` after 4 bytes. m_GetRealGfxDevice = (GetRealGfxDeviceDelegate)Marshal.GetDelegateForFunctionPointer( CppUtils.ResolveRelativeInstruction( (IntPtr)((long)UnityInternals.ResolveICall("UnityEngine.FrameTimingManager::CaptureFrameTimings") + (MelonUtils.IsGame32Bit() ? 0 : 4))), typeof(GetRealGfxDeviceDelegate)); } }
private void btnCopyPath_Click(object sender, EventArgs e) { try { Clipboard.SetText(this.txtName.Tag.ToString()); } catch (Exception ex) { CppUtils.Fatal(ex.Message); } }
private void btnCopy_Click(object sender, EventArgs e) { try { Clipboard.SetText(txtName.Text); } catch (Exception ex) { CppUtils.Fatal(ex.Message); } }
private void goToWebPageToolStripMenuItem_Click(object sender, EventArgs e) { try { Process.Start("https://github.com/erasoni/SendToTools"); } catch (Exception ex) { CppUtils.Fatal(ex); } }
private void openToolStripMenuItem_Click(object sender, EventArgs e) { try { Process.Start(listUrls.SelectedItems[0].Text); } catch (Exception ex) { CppUtils.CenteredMessageBox(this, ex.Message, Application.ProductName); } }
// private readonly List<string> generalExt_ = new List<string>( "bin","txt","xml"); private void btnChangeExt_Click(object sender, EventArgs e) { try { { string src = InputFile; FileInfo srcinfo = new FileInfo(src); int extlen = srcinfo.Extension.Length; // What is this? //if (extlen >= 5) // extlen = 0; string srcwithoutext = srcinfo.FullName.Substring(0, srcinfo.FullName.Length - extlen); string ext = txtExt.Text; ext = ext.Split(' ')[0]; string dstname = srcwithoutext + '.' + ext; if (!option.IsSkipWarning) { string message = string.Format(Properties.Resources.Q_RENAME_EXTENSION, string.IsNullOrEmpty(Path.GetExtension(src)) ? Properties.Resources.NO_EXTENSION : Path.GetExtension(src), Path.GetExtension(dstname)); if (DialogResult.Yes != CppUtils.CenteredMessageBox( this, message, Application.ProductName, MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2)) { return; } } srcinfo.MoveTo(dstname); InputFile = dstname; analyzefile(dstname); if (option.IsCloseAfterRenaming) { Close(); return; } } } catch (Exception ex) { CppUtils.CenteredMessageBox(ex.Message, Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Stop); } }
private void btnOK_Click(object sender, EventArgs e) { try { Serialize(true); } catch (Exception ex) { CppUtils.Alert(ex); DialogResult = DialogResult.None; } }
private static IntPtr[] GetPointers(IntPtr unityplayer, int unityplayer_size, string[] possible_signatures) { foreach (string signature in possible_signatures) { IntPtr[] ptrs = CppUtils.SigscanAll(unityplayer, unityplayer_size, signature); if (ptrs.Length > 0) { return(ptrs); } } return(null); }
static void ShowAlert(string message) { StringBuilder sbMessage = new StringBuilder(); sbMessage.AppendLine(message); sbMessage.AppendLine(); sbMessage.AppendLine(GetHelpMessage()); CppUtils.CenteredMessageBox(sbMessage.ToString(), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Warning); }
private void tssbInsertURLs_ButtonClick(object sender, EventArgs e) { try { string all = Clipboard.GetText(); txtTmp.Text = all; foreach (string line in txtTmp.Lines) { listUrls.Items.Add(line); } } catch (Exception ex) { CppUtils.CenteredMessageBox(this, ex.Message, Application.ProductName); } }
private void FormMain_FormClosed(object sender, FormClosedEventArgs e) { HashIni ini = Profile.ReadAll(IniPath); AmbLib.SaveFormXYWH(this, SECTION_LOCATION, ini); AmbLib.SaveListViewColumnWidth(listMain, SECTION_OPTION, KEY_COLUMN_WIDTH, ini); AmbLib.SaveComboBox(cmbApplication, SECTION_APP_COMBO, MAX_COMBO_SAVE, ini); AmbLib.SaveComboBox(cmbArguments, SECTION_ARG_COMBO, MAX_COMBO_SAVE, ini); if (!Profile.WriteAll(ini, IniPath)) { CppUtils.Alert("Failed to save ini"); } }
private void btnClear_Click(object sender, EventArgs e) { if (Running) { return; } if (DialogResult.Yes != CppUtils.YesOrNo("Clear?", MessageBoxDefaultButton.Button2)) { return; } ClearAllListIndicator(); }