public bool AddProductLayouts() { bool isSuccess = true; try { foreach (ProductSettings prodSettings in productSettings) { ProductLayout productLayout = new ProductLayout(prodSettings.Name, prodSettings.LayoutName, prodSettings.ControlsLayouts); if (string.IsNullOrEmpty(productLayout.errorMsg)) { productLayouts.Add(productLayout); } else { packageManager.DiscardPackge(prodSettings.Name, productLayout.errorMsg); isSuccess = false; } } } #if DEBUG catch (Exception e) #else catch (Exception) #endif { #if DEBUG Logger.GetLogger().Error($"AddProductLayouts failed, error: {e.Message}"); #endif isSuccess = false; } return(isSuccess); }
public bool NextLayout() { if (productLayouts != null && productIndex < productLayouts.Count) { currntLayout = productLayouts[productIndex]; if (pnlLayout.Controls.Count > 0) { pnlLayout.Resize -= ((ProductControl)pnlLayout.Controls[0]).HandleChanges; } pnlLayout.Controls.Clear(); pnlLayout.Controls.Add(currntLayout.productLayout); pnlLayout.Resize += ((ProductControl)pnlLayout.Controls[0]).HandleChanges; optLayout = new OptLayout(pnlLayout, 4); OnLayoutShown(currntLayout.productName); } productIndex++; HasNext = (productLayouts == null || productIndex <= productLayouts.Count); return(HasNext); }