static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); OptionForm formOptions = new OptionForm(); Application.Run(formOptions); }
void PickupLine() { string code0010; string code00800004; string code0003 = TextForm.GetLineBreak(); if (OptionForm.text_escape() == OptionForm.text_escape_enum.FEditorAdv) { code0010 = "[LoadFace]"; code00800004 = "[LoadOverworldFaces]"; } else { code0010 = "@0010"; code00800004 = "@0080@0004"; } int snipPoint; string r = TextForm.ConvertEscapeText(this.CurrentSubtile); r = r.Replace("\r\n", "\n"); if (this.CountOf00800004 > 0) { r = PickupLineSub(r, this.CountOf00800004, code00800004, out snipPoint); } else { r = PickupLineSub(r, this.CountOf0010, code0010, out snipPoint); } int snipPoint2; r = PickupLineSub(r, this.CountOf0003, code0003, out snipPoint2); int startPoint = snipPoint + snipPoint2; //キーワードハイライトト TextForm.KeywordHighLight(this.Subtile); Color displayBackColor = OptionForm.Color_NotifyWrite_BackColor(); Color displayForeColor = OptionForm.Color_NotifyWrite_ForeColor(); //表示部分の選択 this.Subtile.SelectionStart = startPoint; this.Subtile.SelectionLength = r.Length; this.Subtile.SelectionColor = displayForeColor; this.Subtile.SelectionBackColor = displayBackColor; //選択位置の調整 this.Subtile.SelectionStart = startPoint; this.Subtile.SelectionLength = 0; }
private Size DrawEventList(ListBox lb, int index, Graphics g, Rectangle listbounds, bool isWithDraw) { if (index < 0 || index >= this.ErrorList.Count || this.MapID == U.NOT_FOUND) { return(new Size(listbounds.X, listbounds.Y)); } FELint.ErrorSt est = this.ErrorList[index]; SolidBrush brush = new SolidBrush(lb.ForeColor); SolidBrush errorBrush = new SolidBrush(OptionForm.Color_Error_ForeColor()); Font normalFont = lb.Font; Font boldFont = new Font(lb.Font, FontStyle.Bold); Rectangle bounds = listbounds; int lineHeight = (int)lb.Font.Height; int maxWidth = 0; string text = TypeToString(est.DataType, est.Addr, est.Tag); U.DrawText(text, g, boldFont, errorBrush, isWithDraw, bounds); if (Program.LintCache.CheckFast(est.Addr)) { string comment = "//" + R._("このエラーは非表示になっています。理由:「{0}」", Program.LintCache.At(est.Addr)); bounds.X = listbounds.X + (lineHeight * 25); SolidBrush commentBrush = new SolidBrush(OptionForm.Color_Comment_ForeColor()); bounds.X += U.DrawText(comment, g, normalFont, commentBrush, isWithDraw, bounds); commentBrush.Dispose(); maxWidth = Math.Max(maxWidth, bounds.X); } bounds.Y += lineHeight; text = est.ErrorMessage; bounds.X = listbounds.X; Size size = U.DrawTextMulti(text, g, normalFont, brush, isWithDraw, bounds); bounds.X += size.Width; maxWidth = Math.Max(maxWidth, bounds.X); brush.Dispose(); boldFont.Dispose(); bounds.X = maxWidth; bounds.Y += size.Height + lineHeight; return(new Size(bounds.X, bounds.Y)); }
public static bool CheckTBLAndAntiHuffman() { if (OptionForm.textencoding() == OptionForm.textencoding_enum.Auto || OptionForm.textencoding() == OptionForm.textencoding_enum.Shift_JIS || OptionForm.textencoding() == OptionForm.textencoding_enum.LAT1 || OptionForm.textencoding() == OptionForm.textencoding_enum.UTF8) { return(true); } DialogResult dr = R.ShowNoYes("現在TBLを利用しています。\r\nTBLを利用しながらun-haffman patchを利用すると予期しないトラブルが発生することがあります。\r\n「はい」を選択すると、パッチのインストールを強行します。\r\n「いいえ」を選択すると、パッチ適応を取りやめます。(推奨)\r\n\r\nどうしますか?"); return(dr == DialogResult.Yes); }
private void FontButton_Click(object sender, EventArgs e) { if (Program.ROM.RomInfo.is_multibyte()) { OptionForm.textencoding_enum textencoding = OptionForm.textencoding(); if (textencoding == OptionForm.textencoding_enum.ZH_TBL) { InputFormRef.JumpForm <FontZHForm>(); return; } } InputFormRef.JumpForm <FontForm>(); }
void CloseAndResetInstance(int autocolor = 0) { using (InputFormRef.AutoPleaseWait pleaseWait = new InputFormRef.AutoPleaseWait(this)) { OptionForm.ClearCache(); this.SettingPleaseWait = pleaseWait; OptionForm f = new OptionForm(); f.AutoClose(autocolor); } this.DialogResult = System.Windows.Forms.DialogResult.Retry; this.Close(); }
public DropboxNemiro(MainForm mainForm, OptionForm optionForm) { if (mainForm != null) { this.mainForm = mainForm; } if (optionForm != null) { this.optionForm = optionForm; } consumerKey = "9sd472e7xntjrd6"; consumerSecret = "2w4fs2o2i3fgnju"; }
public NotifyPleaseWaitUserControl() { InitializeComponent(); Color Color_NotifyWrite_BackColor = OptionForm.Color_NotifyWrite_BackColor(); Color Color_NotifyWrite_ForeColor = OptionForm.Color_NotifyWrite_ForeColor(); this.BackColor = Color_NotifyWrite_BackColor; this.ForeColor = Color_NotifyWrite_ForeColor; this.BIG_TEXT.BackColor = Color_NotifyWrite_BackColor; this.BIG_TEXT.ForeColor = Color_NotifyWrite_ForeColor; }
public MapStyleEditorFormWarningVanillaTileOverraideForm() { InitializeComponent(); string lang = OptionForm.lang(); if (lang == "ja") { HelpTextBox.Text = "https://dw.ngmansion.xyz/doku.php?id=guide:febuildergba:%E3%82%BF%E3%82%A4%E3%83%AB%E3%83%91%E3%83%AC%E3%83%83%E3%83%88%E3%81%AE%E5%A4%89%E6%9B%B4"; } else { HelpTextBox.Text = "https://dw.ngmansion.xyz/doku.php?id=en:guide:febuildergba:how_to_change_tile_style_en"; } }
public static Size DrawASM(ListBox lb, int index, Graphics g, Rectangle listbounds, bool isWithDraw) { if (index < 0 || index >= lb.Items.Count) { return(new Size(listbounds.X, listbounds.Y)); } string text = lb.Items[index].ToString(); int commentPos = text.IndexOf("//"); if (commentPos < 0) { commentPos = text.IndexOf("# pointer:"); } string mainText; string commentText; if (commentPos < 0) { mainText = text; commentText = ""; } else { mainText = text.Substring(0, commentPos); commentText = text.Substring(commentPos); } SolidBrush brush = new SolidBrush(lb.ForeColor); Font normalFont = lb.Font; Rectangle bounds = listbounds; int lineHeight = (int)lb.Font.Height; bounds.X += U.DrawText(mainText, g, normalFont, brush, isWithDraw, bounds); brush.Dispose(); //コメントの表示 if (commentPos >= 0) { SolidBrush commentBrush = new SolidBrush(OptionForm.Color_Comment_ForeColor()); bounds.X += U.DrawText(commentText, g, normalFont, commentBrush, isWithDraw, bounds); commentBrush.Dispose(); } bounds.Y += lineHeight; return(new Size(bounds.X, bounds.Y)); }
public void CheckUpdateThread() { int func_auto_update = OptionForm.auto_update(); if (func_auto_update == 0) {//自動アップデート確認をしない. return; } DateTime dt = DateTime.Now.AddDays(-func_auto_update); uint now = U.atoi(dt.ToString("yyyyMMdd")); uint LastUpdateCheck = U.atoi(Program.Config.at("LastUpdateCheck", "0")); if (now <= LastUpdateCheck) {//まだアップデート確認する時間じゃない. return; } System.Threading.Thread s1 = new System.Threading.Thread(t => { try { string download_url; string net_version; string error = CheckUpdateURLByGitHub(out download_url, out net_version); UpdateEventArgs args = new UpdateEventArgs(); args.error = error; args.download_url = download_url; args.net_version = net_version; if (Application.OpenForms.Count <= 0) {//通知するべきフォームがない. return; } Form f = Application.OpenForms[0]; if (f == null || f.IsDisposed) { return; } f.Invoke(EventHandler, new object[] { this, args }); } catch (Exception e) { Log.Error(e.ToString()); return; } }); s1.Start(); }
bool SearchFor(string search, int start, int end, bool noListFocus) { if (U.isHexString(search)) {//hexの場合は、先頭のコードだけを見て探索します. uint searchhex = U.atoh(search); for (int i = start; i < end; i++) { if (U.atoh((string)this.TargetistBox.Items[i]) == searchhex) { SelectIndex(i, noListFocus); return(true); } } } //かな入力への配慮 bool isJP = (this.LangCode == "ja"); if (isJP && OptionForm.IsKanaToNumberMode() && U.isAsciiString(search)) { string t = U.KanaToNumber(search); if (t != "") { uint searchhex = U.atoh(t); for (int i = start; i < end; i++) { if (U.atoh((string)this.TargetistBox.Items[i]) == searchhex) { SelectIndex(i, noListFocus); return(true); } } } } search = U.CleanupFindString(search, isJP); //部分一致 for (int i = start; i < end; i++) { string t = U.CleanupFindString((string)this.TargetistBox.Items[i], true); if (t.IndexOf(search) >= 0) { SelectIndex(i, noListFocus); return(true); } } return(false); }
public void AddJPFonts(List <Address> list) { if (!Program.ROM.RomInfo.is_multibyte) {//英語ROMなので無関係 return; } OptionForm.textencoding_enum textencoding = OptionForm.textencoding(); if (textencoding == OptionForm.textencoding_enum.ZH_TBL) {//フォントシステムが違うので無理 return; } if (Program.ROM.RomInfo.version != 8) {//FE8のみ return; } //消したらダメなのを登録 MakeKeepFontFE8J(); //既存のフォントテーブルのクリア uint textFontStart = 0x5942F4; uint textFontEnd = 0x5B8CDC; SerchCustomFonts(false, textFontEnd, list); Address.AddAddress(list , textFontStart , textFontEnd - textFontStart , U.NOT_FOUND , "TextFont Wipe" , Address.DataTypeEnum.BIN ); uint itemFontStart = 0x579CCC; uint itemFontEnd = 0x593ECC; SerchCustomFonts(true, itemFontEnd, list); Address.AddAddress(list , itemFontStart , itemFontEnd - itemFontStart , U.NOT_FOUND , "ItemFont Wipe" , Address.DataTypeEnum.BIN ); //アイテムフォントのテーブルを消す Program.ROM.write_fill(0x57994C, 896, 0); //テキストフォントのテーブルを消す Program.ROM.write_fill(0x593F74, 896, 0); }
private void button_SelectPid_Click(object sender, EventArgs e) { OptionForm optionForm = new OptionForm(OptionForm.OptionType.ProccessId, textBox_ProcessId.Text); if (optionForm.ShowDialog() == System.Windows.Forms.DialogResult.OK) { if (optionForm.ProcessId.Length > 0) { textBox_ProcessId.Text = optionForm.ProcessId; //we choose to use process Id instead of the process name textBox_ProcessName.Text = ""; } } }
public void Init(int trackNumber, bool isMute, string instName) { if (isMute) { label1.Text = R._("トラック({0})をミュート解除にしますか?\r\n{1}", trackNumber, instName); ToggleButton.Text = R._("ミュート解除する"); ToggleButton.ForeColor = OptionForm.Color_Keyword_ForeColor(); } else { label1.Text = R._("トラック({0})をミュートしますか?\r\n{1}", trackNumber, instName); ToggleButton.Text = R._("ミュートする"); ToggleButton.ForeColor = OptionForm.Color_Error_ForeColor(); } }
protected override void WndProc(ref Message m) { if (m.Msg == WM_IME_COMPOSITION) { if (((int)m.LParam & GCS_RESULTSTR) > 0) { PushUndo(); } } base.WndProc(ref m); if (m.Msg == 15) // WM_PAINT == 15 { using (var g = this.CreateGraphics()) { if (this.BackgroundImage != null) { g.DrawImage(this.BackgroundImage, 0, 0); } else if (this.Enabled && !this.ReadOnly && (_Placeholder.Length > 0) && (this.TextLength == 0)) { // 描画を一旦消してしまう Brush b = new System.Drawing.SolidBrush(this.BackColor); g.FillRectangle(b, this.ClientRectangle); b.Dispose(); // プレースホルダのテキスト色を、前景色と背景色の中間として文字列を描画する var placeholderTextColor = System.Drawing.Color.FromArgb( (this.ForeColor.A + this.BackColor.A) / 2 , (this.ForeColor.R + this.BackColor.R) / 2 , (this.ForeColor.G + this.BackColor.G) / 2 , (this.ForeColor.B + this.BackColor.B) / 2); b = new System.Drawing.SolidBrush(placeholderTextColor); g.DrawString(_Placeholder, this.Font, b, 1, 1); b.Dispose(); } //エラーがあれば枠の色を変える. if (_ErrorMessage.Length > 0 && _ToolTipEx != null) { Pen pen = new Pen(OptionForm.Color_Error_ForeColor(), 3); g.DrawRectangle(pen, this.ClientRectangle); pen.Dispose(); } } } }
public static void TranslateLanguageAutoSelect(out int out_from, out int out_to) { //from if (Program.ROM.RomInfo.is_multibyte()) { if (OptionForm.textencoding() == OptionForm.textencoding_enum.ZH_TBL) {//中国語 out_from = 2; } else {//日本語 out_from = 0; } } else {//英語 out_from = 1; } //to string lang = OptionForm.lang(); if (lang == "zh") { out_to = 2; } else if (lang == "en") { out_to = 1; } else { out_to = 0; } //from == to ならば、適当にずらす. if (out_from == out_to) { if (out_to == 0) { out_to = 1; } else { out_to = 0; } } }
bool IsShowGameOptionExetdns(int count) { if (OptionForm.show_gameoption_extends() == OptionForm.show_extends_enum.Show) {//表示する設定の場合は表示する. return(true); } uint addr = Program.ROM.u32(Program.ROM.RomInfo.status_game_option_pointer); if (addr < Program.ROM.RomInfo.extends_address) {//拡張されていないので表示しない return(false); } //拡張されているので表示する return(true); }
bool IsShowSongTableExetdns(int count) { if (OptionForm.show_song_table_extends() == OptionForm.show_extends_enum.Show) {//表示する設定の場合は表示する. return(true); } uint addr = Program.ROM.u32(Program.ROM.RomInfo.sound_table_pointer()); if (addr < Program.ROM.RomInfo.extends_address()) {//拡張されていないので表示しない return(false); } //拡張されているので表示する return(true); }
string ExplainUpdateInfo() { string lang = OptionForm.lang(); string url; if (lang == "ja") { url = "https://dw.ngmansion.xyz/doku.php?id=guide:febuildergba:%E4%BD%9C%E5%93%81%E6%94%AF%E6%8F%B4"; } else { url = "https://dw.ngmansion.xyz/doku.php?id=en:guid:febuildergba:work_support"; } return(url); }
public NotifyDirectInjectionNotifyUserControl() { InitializeComponent(); Color Color_Notify_BackColor = OptionForm.Color_List_HoverColor(); Color Color_Notify_ForeColor = OptionForm.Color_Control_ForeColor(); this.BackColor = Color_Notify_BackColor; this.ForeColor = Color_Notify_ForeColor; this.BIG_TEXT.BackColor = Color_Notify_BackColor; this.BIG_TEXT.ForeColor = Color_Notify_ForeColor; this.AllowLabel.BackColor = Color_Notify_BackColor; this.AllowLabel.ForeColor = Color_Notify_ForeColor; }
private void MainFE6Form_FormClosing(object sender, FormClosingEventArgs e) { if (OptionForm.first_form() == OptionForm.first_form_enum.EASY) { return; } #if DEBUG //デバッグ時はいちいち聞かれると面倒なのでスルーする #else if (!MainFormUtil.IsNotSaveYet(this)) { e.Cancel = true; } #endif }
private void SongTrackImportMidiForm_Load(object sender, EventArgs e) { if (OptionForm.GetMidfix4agb() == "") { UseMidfix4agb_checkBox.Checked = false; UseMidfix4agb_checkBox.Hide(); WARNING_midfix4agb_label.Show(); } else { UseMidfix4agb_checkBox.Checked = true; WARNING_midfix4agb_label.Hide(); UseMidfix4agb_checkBox.Show(); } Mid2agbV.Value = 80; if (OptionForm.IsUsingMidi2agb()) { Mid2agbV.Maximum = 128; Mid2agbV.Value = 128; UseMidi2agb_modsc_Nud.Value = 8; UseMidi2agb_modsc_Nud.Show(); UseMidi2agb_modsc_checkBox.Show(); UseMidi2agb_modsc_checkBox.Checked = true; } else { UseMidi2agb_modsc_Nud.Value = 0; UseMidi2agb_modsc_Nud.Hide(); UseMidi2agb_modsc_checkBox.Hide(); UseMidi2agb_modsc_checkBox.Checked = false; } if (MainFormUtil.CanUseMID2AGB()) { //mid2agbを利用できる. if (OptionForm.midi_importer() == OptionForm.midi_importer_enum.MID2AGB) { //mid2agbがディフォルト this.tabControl1.SelectedIndex = 1; } } else {//mid2agbを利用できない. Explain_mid2agb.Text = R._("mid2agbが設定されていません。\r\n設定画面より、mid2agbの設定をしてください。"); Mid2AGBOKButton.Enabled = false; this.tabControl1.SelectedIndex = 0; } }
private void ShowPreferences(object sender, System.EventArgs e) { OptionForm of = new OptionForm(); of.NewTheme += new ChangedThemeEvent(ChangedTheme); of.ResetLayout += new EventHandler(ResetLayout); of.UnlockDocks += new EventHandler(UnLockDocks); of.LockDocks += new EventHandler(LockDocks); System.Drawing.Icon icon = null; if (miPref.Image is System.Drawing.Bitmap) { icon = System.Drawing.Icon.FromHandle(((System.Drawing.Bitmap)miPref.Image).GetHicon()); } of.Execute(icon); package.UpdateRecentFileMenu(this.miRecent); }
public static Form MainForm() { if (OptionForm.first_form() == OptionForm.first_form_enum.EASY && U.stringbool(U.at(ArgsDic, "--force-detail", "0")) == false) { return(InputFormRef.JumpFormLow <MainSimpleMenuForm>()); } if (Program.ROM.RomInfo.version() == 6) { return(InputFormRef.JumpFormLow <MainFE6Form>()); } else if (Program.ROM.RomInfo.version() == 7) { return(InputFormRef.JumpFormLow <MainFE7Form>()); } return(InputFormRef.JumpFormLow <MainFE8Form>()); }
public static Bitmap DrawUnitsList(uint index, int iconSize, out string errorMessage) { InputFormRef InputFormRef = Init(null); uint addr = InputFormRef.IDToAddr(index); if (!U.isSafetyOffset(addr)) { errorMessage = R._("範囲外のIDを指定しています。\r\n指定できるのは、最大{0}までです。", InputFormRef.DataCount); return(ImageUtil.BlankDummy()); } errorMessage = ""; Bitmap bitmap = new Bitmap((iconSize * 2) * 5, iconSize); Rectangle bounds = new Rectangle(0, 0, bitmap.Width, bitmap.Height); SolidBrush brush = new SolidBrush(OptionForm.Color_Input_ForeColor()); Font font = new Font("MS UI Gothic", 8); using (Graphics g = Graphics.FromImage(bitmap)) { for (uint i = 0; i < 5; i++) { uint classid = Program.ROM.u8(addr + i); if (classid <= 0) { continue; } Bitmap icon = ClassForm.DrawWaitIcon(classid, 2); U.MakeTransparent(icon); Rectangle b = bounds; b.Width = iconSize; b.Height = iconSize; bounds.X += U.DrawPicture(icon, g, true, b); uint probability = Program.ROM.u8(addr + 5 + i); bounds.X += U.DrawText(probability + "", g, font, brush, true, bounds); } } brush.Dispose(); font.Dispose(); return(bitmap); }
private void CategoryListBox_SelectedIndexChanged(object sender, EventArgs e) { string category = GetSelectedCategory(); bool filtered = category.Length > 0; string lang = OptionForm.lang(); bool isJP = (lang == "ja"); string filterString = U.CleanupFindString(this.Filter.Text, isJP); bool showLowCommand = DisplayLowCommandCheckBox.Checked; this.ListBox.BeginUpdate(); this.ListBox.Items.Clear(); this.ScriptCahce.Clear(); foreach (EventScript.Script script in Program.EventScript.Scripts) { if (filtered == true) { if (script.Category.IndexOf(category) < 0) { continue; } } string name = EventScript.makeCommandComboText(script, true); if (filterString.Length > 0) { if (!U.StrStrEx(name + " " + script.PopupHint, filterString, isJP)) {//フィルターで消す. continue; } } if (showLowCommand == false) { if (script.IsLowCommand) {//LOW命令なので消す continue; } } this.ListBox.Items.Add(name); this.ScriptCahce.Add(script); } this.ListBox.EndUpdate(); }
bool IsShowItemIconExetdns(int count) { if (Program.ROM.RomInfo.version() == 8) {//FE8では常に表示する return(true); } if (OptionForm.show_fe76_item_icon_extends() == OptionForm.show_extends_enum.Show) {//表示する設定の場合は表示する. return(true); } if (Program.ROM.p32(Program.ROM.RomInfo.icon_pointer()) == Program.ROM.RomInfo.icon_orignal_address()) {//拡張されていないので表示しない return(false); } //拡張されているので表示する return(true); }
public FontForm() { InitializeComponent(); this.ZoomComboBox.SelectedIndex = 2; this.FontType.SelectedIndex = 0; U.SetIcon(ExportButton, Properties.Resources.icon_arrow); U.SetIcon(ImportButton, Properties.Resources.icon_upload); UseFontNameTextEdit.Text = UseFontNameTextEdit.Font.FontFamily.ToString(); AutoGenbutton.AccessibleDescription = R._("ROMに存在しいフォントをPCに存在するフォントから自動的に作成します。\r\nまとめて複数のフォントを一気に作りたい場合は、ROM翻訳ツールから作ることをお勧めします。"); if (Program.ROM.RomInfo.is_multibyte()) { OptionForm.textencoding_enum textencoding = OptionForm.textencoding(); if (textencoding == OptionForm.textencoding_enum.ZH_TBL) { Debug.Assert(false); } else if (textencoding == OptionForm.textencoding_enum.EN_TBL) { this.FontSample.Text = "AB@cd"; ///No Translate this.SearchChar.Text = "X"; ///No Translate } else { this.FontSample.Text = "あい@うえお"; ///No Translate this.SearchChar.Text = "剣"; ///No Translate } } else { this.FontSample.Text = "AB@cd"; ///No Translate this.SearchChar.Text = "X"; ///No Translate } U.AllowDropFilename(this, ImageFormRef.IMAGE_FILE_FILTER, (string filename) => { using (ImageFormRef.AutoDrag ad = new ImageFormRef.AutoDrag(filename)) { ImportButton_Click(null, null); } }); }
//自動アップデート確認をしてもいいの? public static bool IsAutoUpdateTime() { int func_auto_update = OptionForm.auto_update(); if (func_auto_update == 0) {//自動アップデート確認をしない. return(false); } DateTime dt = DateTime.Now.AddDays(-func_auto_update); uint now = U.atoi(dt.ToString("yyyyMMdd")); uint LastUpdateCheck = U.atoi(Program.Config.at("LastUpdateCheck", "0")); if (now <= LastUpdateCheck) {//まだアップデート確認する時間じゃない. return(false); } return(true); }
private void ClickHandler(object Sender, MouseEventArgs e) { if (e.X < 100) // GUI area { int index = (e.Y + 38) / 75 - 1; if (index == 0) { fmOptions = new OptionForm(); fmOptions.Show(this); } else if (index > 0 && index <= shapeTypes.Length) { selectedIndex = index; } else { selectedIndex = -1; } Invalidate(new System.Drawing.Rectangle(0, 0, 100, Height)); } else if (selectedShape != null) // Editor Area { if (isDrawing) { isDrawing = false; // Finish drawing the shape Pen pen = currentPen.Clone() as Pen; Brush brush = currentBrush.Clone() as Brush; var shapeParams = new object[4] { pen, brush, mouseStart, e.Location }; scene.Add(shapeCreators[selectedShape].Invoke(shapeParams) as Shape); Invalidate(new System.Drawing.Rectangle(100, 0, Width, Height)); } else { // Start drawing the shape isDrawing = true; mouseStart = e.Location; } } }
private static void RunApp(string[] arg) { Process[] runningProcesses = Process.GetProcessesByName("eAd Client"); if (runningProcesses.Length <= 1) { System.Diagnostics.Trace.Listeners.Add(new ClientTraceListener()); System.Diagnostics.Trace.AutoFlush = false; try { if (arg.GetLength(0) > 0) { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); System.Diagnostics.Trace.WriteLine(new LogMessage("Main", "Options Started"), LogType.Info.ToString()); Form formMain = new OptionForm(); Application.Run(formMain); } else { bool createdNew = true; new Mutex(true, "UniqueApplicationName", out createdNew); if (createdNew) { Splasher.Splash = new SplashScreen(); Splasher.ShowSplash(); Trace.WriteLine(new LogMessage("Main", "Client Started"), LogType.Info.ToString()); App app = new App(); app.Run(); } } } catch (Exception ex) { HandleUnhandledException(ex); } // Catch unhandled exceptions AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException); Application.ThreadException += new System.Threading.ThreadExceptionEventHandler(Application_ThreadException); // Always flush at the end System.Diagnostics.Trace.WriteLine(new LogMessage("Main", "Application Finished"), LogType.Info.ToString()); System.Diagnostics.Trace.Flush(); } else { ShowWindowAsync(runningProcesses[0].MainWindowHandle, 6); ShowWindowAsync(runningProcesses[0].MainWindowHandle, 9); } }
public bool? show() { OptionForm f = new OptionForm(this); return f.ShowDialog(); }