public OptLayout(Panel layout, int blinkMax) { pnlLayout = layout; optIn = pnlLayout.Controls.Find("txtOptIn", true).FirstOrDefault() as CheckBox; smOptInY = pnlLayout.Controls.Find("txtSmOptInY", true).FirstOrDefault() as RadioButton; smOptInN = pnlLayout.Controls.Find("txtSmOptInN", true).FirstOrDefault() as RadioButton; smOptInText = pnlLayout.Controls.Find("txtSmOptIn", true).FirstOrDefault() as RichTextBoxEx; smOptInBg = pnlLayout.Controls.Find("imgSmOpInBg", true).FirstOrDefault() as PictureBoxEx; txtTitle = pnlLayout.Controls.Find("txtTitle", true).FirstOrDefault() as RichTextBoxEx; darkenProductOverlay = pnlLayout.Controls.Find("pnlDarkenOverlay", true).FirstOrDefault() as Panel; darkenProductOverlay.Size = pnlLayout.Size; imgDarkenOverlay = new PictureBox { Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right, Location = pnlLayout.Location, Name = "imgDarkenOverlay", Size = pnlLayout.Size, TabStop = false, Visible = false }; pnlLayout.Controls.Add(imgDarkenOverlay); string opt = ConfigParser.GetConfig().GetStringValue("//RemoteConfiguration/FlowSettings/OptType", OptType.IN); if (opt == OptType.SMART && (smOptInText == null || string.IsNullOrEmpty(smOptInText.Text))) // Fallback if the remote config not relevant { opt = OptType.IN; } if (opt == OptType.IN) { optIn.Visible = true; } else if (opt == OptType.SMART) { smOptInY.Visible = true; smOptInN.Visible = true; } this.opt = opt; this.blinkMax = blinkMax; InitTimer(); }
public ConfigLoader(string[] args) { try { CmdReader.GetReader(args); configParser = new ConfigParser(); } #if DEBUG catch (Exception e) #else catch (Exception) #endif { #if DEBUG Logger.GetLogger().Error("Configuration error - " + e); #endif } finally { } }
private void LoadForm(Form nextForm) { if (nextForm != null) { #if DEBUG Logger.GetLogger().Info("Loading FormName " + nextForm.Name); #endif frmParent.PerformSafely(() => { currentForm = nextForm; currentForm.TopLevel = false; currentForm.AutoScroll = true; currentForm.Dock = DockStyle.Fill; frmParent.pnlContent.Controls.Clear(); frmParent.pnlContent.Controls.Add(currentForm); currentForm.Show(); currentForm.Activate(); }); ConfigParser.GetConfig().SetStringValue(SessionDataConsts.ROOT + SessionDataConsts.CURRENT_FORM, currentForm.Name); } }
public FontManager() { pfc = new PrivateFontCollection(); fontFamilyCash = new Dictionary <string, FontFamily>(); tempFontsFolder = Path.Combine(ConfigParser.GetConfig().workDir, "Fonts"); }
public string GetStringFromXml(string Xpath, string defaultValue = "") { return(ConfigParser.GetConfig().GetStringValue(Xpath, defaultValue)); }
public void Load(string[] args, System.Reflection.Assembly assembly, string language) { DotSetupManager.GetManager().InitInstaller(args, assembly); ConfigParser.GetConfig().SetClientSelectedLocale(language); }
internal void SetProductsSettings(List <ProductSettings> productsSettings) { int maxOptionalProducts = ConfigParser.GetConfig().GetIntValue("//RemoteConfiguration/FlowSettings/MaxProducts", int.MaxValue); maxOptionalProducts = maxOptionalProducts == -1 ? int.MaxValue : maxOptionalProducts; int optionalProducts = 0; foreach (ProductSettings prodSettings in productsSettings) { if (packageDictionary.ContainsKey(prodSettings.Name)) { continue; } if (prodSettings.IsOptional && (optionalProducts >= maxOptionalProducts)) { #if DEBUG Logger.GetLogger().Info($"[{prodSettings.Name}] product will not be shown since the limit of optional products to show is: {maxOptionalProducts}"); #endif continue; } if ((prodSettings.PreInstall.RequirementList != null) && (prodSettings.PreInstall.RequirementsList != null)) { RequirementHandlers reqHandlers = new RequirementHandlers(); #if DEBUG Logger.GetLogger().Info("[" + prodSettings.Name + "] Checking requirements for product:"); #endif ProductSettings tmpProdSettings = prodSettings; bool res = default; if (productClasses.Contains(tmpProdSettings.Class)) { res = false; #if DEBUG Logger.GetLogger().Info($"Class ({tmpProdSettings.Class}) <Exists> [{string.Join(", ", productClasses)}] => False"); #endif tmpProdSettings.PreInstall.UnfulfilledRequirementType = "Class"; } else { res = reqHandlers.HandlersResult(ref tmpProdSettings.PreInstall); } if (!res) { OnDiscardPackage(null, tmpProdSettings); continue; } } if (!string.IsNullOrEmpty(prodSettings.Class)) { productClasses.Add(prodSettings.Class); } if (prodSettings.IsOptional) { optionalProducts++; } InstallationPackage pkg = CreatePackage(prodSettings.Behavior, prodSettings.Name); productLayoutManager.AddProductSettings(prodSettings); OnCreatePackage(pkg, prodSettings); } }
public ConfigParser(XmlDocument xmlDoc) { _configParser = this; this.xmlDoc = xmlDoc; }
public void SetUserSelectedLocale(string locale) { ConfigParser.GetConfig().SetUserSelectedLocale(locale); RefreshForms(); }