public meteo_frm(environmentVars stateIni, MainMdiForm _mainmdiform) { SetStyle(ControlStyles.DoubleBuffer | ControlStyles.AllPaintingInWmPaint, true); SetStyle(ControlStyles.UserPaint, true); stateCore = stateIni; mainForm = _mainmdiform; SuspendLayout(); InitializeComponent(); ResumeLayout(); if (!stateCore.addonsLoaded || !stateCore.addons.ContainsKey("weather")) { translations.load("errorMessages"); string message3 = translations.getText("errorWeatherAddonNotFound") + ". " + translations.getText("contactEnterpriseSupport"); translations.load("messagebox"); msgbox = new messageBoxForm(message3 + ". ", translations.getText("warning"), MessageBoxButtons.OK, MessageBoxIcon.Information, Location.X + Width / (double)2, Location.Y + Height / (double)2); msgbox.ShowDialog(); mainForm.busy.Close(true); return; } _weather_pic.Name = "weather_pic"; _city_txt.Name = "city_txt"; _site_combo.Name = "site_combo"; _select_location_lbl.Name = "select_location_lbl"; _descricao_txt.Name = "descricao_txt"; _meteo_txt.Name = "meteo_txt"; _PictureBoxDoubleBuffer1.Name = "PictureBoxDoubleBuffer1"; _AlphaGradientPanel1.Name = "AlphaGradientPanel1"; _LabelDoubleBuffer1.Name = "LabelDoubleBuffer1"; _LabelDoubleBuffer2.Name = "LabelDoubleBuffer2"; _Label1.Name = "Label1"; }
public static bool saveCrash(Exception e) { var state = new environmentVars(LOAD_SETTINGS); if (state.SendDiagnosticData.Equals(false)) { return(true); } var trace = new StackTrace(e, true); string line = Strings.Right(trace.ToString(), 5); int Xcont = 0; string report = e.Message.ToString().Replace("'", "") + Environment.NewLine; report += "--------- Stack trace ---------" + Environment.NewLine; report += "----------" + DateTime.Now.ToString() + "----------" + Environment.NewLine; report += "----------OS version:" + Assembly.GetExecutingAssembly().GetName().Version.ToString + "----------" + Environment.NewLine; report += " Error Line:" + Strings.Right(trace.ToString(), 5) + Environment.NewLine; report += "-------------------------------" + Environment.NewLine; report += "--------- Cause ---------" + Environment.NewLine; foreach (StackFrame sf in trace.GetFrames()) { Xcont = Xcont + 1; report += Xcont + "- " + sf.GetMethod().ReflectedType.ToString().Replace("'", "") + " " + sf.GetMethod().Name.Replace("'", "") + Environment.NewLine; } report += "-------------end report---------------" + Environment.NewLine; Single start; start = Conversions.ToSingle(DateAndTime.Timer); try { System.IO.StreamWriter file; file = Computer.FileSystem.OpenTextFileWriter(Path.Combine(string.Format(@"{0}\", Environment.CurrentDirectory), "crash.log"), true); file.WriteLine(report + Environment.NewLine); file.Close(); } catch (Exception ex) { return(false); } return(true); }
private void meteo_frm_Load(object sender, EventArgs e) { state = mainForm.state; translations = new languageTranslations(state); SuspendLayout(); closeBtn.BackColor = state.buttonColor; StartBtn.BackColor = state.buttonColor; closeBtn.Font = new Font(state.fontText.Families(0), state.RegularTextFontSize, FontStyle.Regular); StartBtn.Font = new Font(state.fontText.Families(0), state.RegularTextFontSize, FontStyle.Regular); translations.load("commonForm"); closeBtn.Text = translations.getText("closeBtn"); translations.load("smartcard"); StartBtn.Text = translations.getText("newCard"); readCodeOnly.Text = translations.getText("readCodeOnly"); cardIdCode.Text = translations.getText("cardId") + ": - -"; authCode_lbl.Text = translations.getText("authCode") + ": - -"; ResumeLayout(); }
public initializeSmartCard(MainMdiForm _mainMdiForm, environmentVars _state, Dictionary <string, string> _currentFormData) { mainForm = _mainMdiForm; state = _state; currentFormData = _currentFormData; // has: cardId, authString, userCode, pin SetStyle(ControlStyles.DoubleBuffer | ControlStyles.AllPaintingInWmPaint, true); SetStyle(ControlStyles.UserPaint, true); SuspendLayout(); InitializeComponent(); ResumeLayout(); _closeBtn.Name = "closeBtn"; _Panel1.Name = "Panel1"; _authCode_lbl.Name = "authCode_lbl"; _readCodeOnly.Name = "readCodeOnly"; _cardIdCode.Name = "cardIdCode"; _progressBar.Name = "progressBar"; _StartBtn.Name = "StartBtn"; _PictureBox1.Name = "PictureBox1"; }
public void preLoadData(setupWizardMainForm _mainForm) { mainform = _mainForm; stateCore = mainform.enVars; }