public void loadDefaults(environmentVarsCore envars) { // ToDo check default font files are present var FontFileName = new FileInfo(envars.fontsPath + fontTitleFile); FontFileName.Refresh(); if (FontFileName.Exists) { envars.layoutDesign.fontTitle.AddFontFile(envars.fontsPath + fontTitleFile); } else { MessageBox.Show("font file not found. reinstall the program"); throw new Exception("font file not found"); } FontFileName = new FileInfo(envars.fontsPath + fontTextFile); FontFileName.Refresh(); if (FontFileName.Exists) { envars.layoutDesign.fontText.AddFontFile(envars.fontsPath + fontTextFile); } else { MessageBox.Show("font file not found. reinstall the program"); throw new Exception("font file not found"); } }
/* TODO ERROR: Skipped EndRegionDirectiveTrivia */ /* TODO ERROR: Skipped RegionDirectiveTrivia */ public loadEnvironment(AeonLabs.Environment.environmentVarsCore _enVars, int settings = -100) { enVars = _enVars; enVars.loadEnvironmentcoreDefaults(); dataLoaded = false; dataLoadedStatusQueue = 0; load(settings); }
/* TODO ERROR: Skipped EndRegionDirectiveTrivia */ /* TODO ERROR: Skipped RegionDirectiveTrivia */ public void CopyFieldsFromCore(AeonLabs.Environment.environmentVarsCore enVarsCore) { var bindingFlagsSelection = BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public; var fieldValues = enVarsCore.GetType().GetFields(bindingFlagsSelection); foreach (var field in fieldValues) { var info = GetType().GetMember(field.Name); FieldInfo meField = info[0] as FieldInfo; meField.SetValue(this, field.GetValue(enVarsCore)); } }
public void loadCustomizationFile(environmentVarsCore envars) { // ToDo check if customization file is present var custom = new FileInfo(envars.libraryPath + "custom.eon"); custom.Refresh(); if (custom.Exists) { } // TODO LOAD FILE else { // TODO LOAD BLANK UNCONFIGURED APP - MAKE AN external APP for building this file } }
/* TODO ERROR: Skipped EndRegionDirectiveTrivia */ /* TODO ERROR: Skipped RegionDirectiveTrivia */ public void loadSettings() { changeDataLoadedState(true); var settings = new Settings.Settings(enVars); enVars = settings.load(); if (settings.hasError) { enVars.settingsLoaded = false; enVars.stateErrorMessage = settings.errorMessage; return; } var configFile = new FileInfo(Path.Combine(enVars.libraryPath, "ScrewDriver.cfg")); configFile.Refresh(); if (configFile.Exists) { loadConfig(); } changeDataLoadedState(false, LOAD_SETTINGS); }
public MessageBoxChild(global::System.String _message, global::System.String _title, MessageBoxButtons _buttons, MessageBoxIcon _icon, global::System.Int32 posx = -1, global::System.Int32 posy = -1, AeonLabs.Environment.environmentVarsCore _state = default) { base.Load += message_box_frm_load; base.Shown += message_box_frm_show; this.SetStyle(ControlStyles.DoubleBuffer | ControlStyles.AllPaintingInWmPaint, true); this.SetStyle(ControlStyles.UserPaint, true); // This call is required by the designer. this.SuspendLayout(); InitializeComponent(); this.ResumeLayout(); titleMsg = _title; messageText = _message; iconImage = _icon; buttons = _buttons; if (_state == null) { enVars = new AeonLabs.Environment.environmentVarsCore(); enVars.loadEnvironmentcoreDefaults(); } else { enVars = _state; } title.Font = new Font(enVars.layoutDesign.fontTitle.Families[0], enVars.layoutDesign.DialogTitleFontSize, FontStyle.Bold); message.Font = new Font(enVars.layoutDesign.fontText.Families[0], enVars.layoutDesign.RegularTextFontSize, FontStyle.Regular); ContinueBtn.Font = new Font(enVars.layoutDesign.fontTitle.Families[0], enVars.layoutDesign.buttonFontSize, FontStyle.Bold); cancelBtn.Font = new Font(enVars.layoutDesign.fontTitle.Families[0], enVars.layoutDesign.buttonFontSize, FontStyle.Bold); ContinueBtn.BackColor = Color.FromArgb(200, Color.Black); ContinueBtn.Parent = AlphaGradientPanel1; ContinueBtn.Location = new Point(40, this.Height - 10 - this.ContinueBtn.Height); cancelBtn.BackColor = Color.FromArgb(200, Color.Black); cancelBtn.Parent = AlphaGradientPanel1; cancelBtn.Location = new Point(this.Width - 40 - this.cancelBtn.Width, this.Height - 10 - this.cancelBtn.Height); }
public void RaiseEnventUpDateEnvironemnt(object sender, environmentVarsCore envars) { UpDateEnvironemnt?.Invoke(sender, envars); }
/* TODO ERROR: Skipped EndRegionDirectiveTrivia */ /* TODO ERROR: Skipped RegionDirectiveTrivia */ public void loadConfig() { changeDataLoadedState(true); var cfgstate = new AeonLabs.Environment.environmentVarsCore(); cfgstate.secretKey = enVars.secretKey; var encryption = new AesCipher(cfgstate); var settingsFile = new FileInfo(Path.Combine(cfgstate.libraryPath, "ScrewDriver.cfg")); settingsFile.Refresh(); if (settingsFile.Exists) { { var withBlock = enVars; try { var bytes = File.ReadAllBytes(Path.Combine(cfgstate.libraryPath, "ScrewDriver.cfg")); string encrypted = Convert.ToBase64String(bytes, 0, bytes.Length); string decrypted = encryption.decrypt(encrypted); var data = JsonConvert.DeserializeObject <Dictionary <string, object> >(decrypted); // datatable color schemes withBlock.layoutDesign.buttonColor = Color.FromArgb(Conversions.ToInteger(data["buttonColor"].ToString())); withBlock.layoutDesign.dividerColor = Color.FromArgb(Conversions.ToInteger(data["dividerColor"].ToString())); withBlock.colorSite = Color.FromArgb(Conversions.ToInteger(data["colorSite"].ToString())); withBlock.colorSection = Color.FromArgb(Conversions.ToInteger(data["colorSection"].ToString())); withBlock.colorCompany = Color.FromArgb(Conversions.ToInteger(data["colorCompany"].ToString())); withBlock.colorWorkCategories = Color.FromArgb(Conversions.ToInteger(data["colorWorkCategories"].ToString())); withBlock.colorAbsense = Color.FromArgb(Conversions.ToInteger(data["colorAbsense"].ToString())); withBlock.colorWithoutRecord = Color.FromArgb(Conversions.ToInteger(data["colorWithoutRecord"].ToString())); withBlock.colorWeekends = Color.FromArgb(Conversions.ToInteger(data["colorWeekends"].ToString())); withBlock.colorHolidays = Color.FromArgb(Conversions.ToInteger(data["colorHolidays"].ToString())); withBlock.colorWithRecord = Color.FromArgb(Conversions.ToInteger(data["colorWithRecord"].ToString())); withBlock.colorAbsentDay = Color.FromArgb(Conversions.ToInteger(data["colorAbsentDay"].ToString())); withBlock.colorFermetureAnnual = Color.FromArgb(Conversions.ToInteger(data["colorFermetureAnnual"].ToString())); withBlock.colorPartialDayValidated = Color.FromArgb(Conversions.ToInteger(data["colorPartialDayValidated"].ToString())); withBlock.colorPlannedChangeOfSite = Color.FromArgb(Conversions.ToInteger(data["colorPlannedChangeOfSite"].ToString())); withBlock.colorPlannedTeam = Color.FromArgb(Conversions.ToInteger(data["colorPlannedTeam"].ToString())); withBlock.colorFullDayValidated = Color.FromArgb(Conversions.ToInteger(data["colorFullDayValidated"].ToString())); withBlock.layoutDesign.colorMainMenu = Color.FromArgb(Conversions.ToInteger(data["colorMainMenu"].ToString())); // font files withBlock.layoutDesign.fontTitleFile = data["fontTitleFile"].ToString(); withBlock.layoutDesign.fontTextFile = data["fontTextFile"].ToString(); // delay Days Validation Attendance withBlock.delayDaysValidationAttendance = Conversions.ToInteger(data["delayDaysValidationAttendance"].ToString()); withBlock.layoutDesign.fontTitle.AddFontFile(withBlock.fontsPath + withBlock.layoutDesign.fontTitleFile); withBlock.layoutDesign.fontText.AddFontFile(withBlock.fontsPath + withBlock.layoutDesign.fontTextFile); } catch (Exception ex) { withBlock.stateErrorMessage = ex.ToString(); } } } else { System.Threading.Thread.CurrentThread.CurrentUICulture = System.Globalization.CultureInfo.GetCultureInfo(enVars.currentLang); enVars.stateErrorMessage = My.Resources.strings.errorDataFileNotFound; } changeDataLoadedState(false, LOAD_CONFIG); }
public EnvironmentAssembliesLoadClass(environmentVarsCore _enVars) { enVarsAssemblies = _enVars.assemblies; enVars = _enVars; }