public frmMain() { Application.ThreadException += new ThreadExceptionEventHandler(Application_ThreadException); AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException); InitializeComponent(); m_DelegateUpdateStatus = updateStatusInBox; m_DelegateProgressStatus = updateProgress; SetupListboxWrap(); EnableUserInput(true); }
public frmMain(string[] args) { Thread.CurrentThread.Priority = ThreadPriority.AboveNormal; //System.Threading.Thread.CurrentThread.CurrentUICulture CultureInfo tci = new CultureInfo("nl-NL"); Thread.CurrentThread.CurrentCulture = tci; splash = new frmSplash(); splash.Show(); System.Windows.Forms.Application.DoEvents(); InitializeComponent(); m_AFRMap = new AFRMap(); m_AFRMap.onCellLocked += m_AFRMap_onCellLocked; m_AFRMap.onFuelmapCellChanged += m_AFRMap_onFuelmapCellChanged; try { sndplayer = new System.Media.SoundPlayer(); } catch (Exception E) { logger.Debug(E.Message); } if (args.Length > 0) { if (args[0].ToUpper().EndsWith(".BIN")) { if(File.Exists(args[0])) { m_commandLineFile = args[0]; m_startFromCommandLine = true; } } } m_DelegateUpdateRealTimeValue = UpdateRealtimeInformationValue; m_DelegateUpdateBDMProgress = ReportBDMProgress; m_DelegateUpdateMapViewer = UpdateMapViewer; m_DelegateUpdateStatus = updateStatusInBox; m_DelegateProgressStatus = SetProgressPercentage; m_DelegateCanFrame = trionic7_onCanFrame; trionic7.onReadProgress += trionicCan_onReadProgress; trionic7.onWriteProgress += trionicCan_onWriteProgress; trionic7.onCanInfo += trionicCan_onCanInfo; trionic7.onCanFrame += trionicCan_onCanFrame; try { RegistryKey TempKeyCM = null; TempKeyCM = Registry.ClassesRoot.CreateSubKey(@"SystemFileAssociations\.bin\shell\Edit in T7 Suite\command"); string StartKey = System.Windows.Forms.Application.ExecutablePath + " \"%1\""; TempKeyCM.SetValue("", StartKey); TempKeyCM.Close(); } catch (Exception E) { logger.Debug(E.Message); } try { RegistryKey TempKeyCM = null; TempKeyCM = Registry.ClassesRoot.CreateSubKey(@"SystemFileAssociations\.bin\shell\Auto detect Trionic file type\command"); string StartKey = System.Windows.Forms.Application.StartupPath + "\\SuiteLauncher.exe" + " \"%1\""; TempKeyCM.SetValue("", StartKey); TempKeyCM.Close(); } catch (Exception E) { logger.Debug(E.Message); } try { // should be done only once! this.fio_callback = this.on_fio; BdmAdapter_SetFIOCallback(this.fio_callback); logger.Debug("BDM adapter callback set!"); // should be done only once! } catch (Exception BDMException) { logger.Debug("BDM init failed: " + BDMException.Message); } try { m_DelegateStartReleaseNotePanel = this.StartReleaseNotesViewer; } catch (Exception E) { logger.Debug(E.Message); } }