/// <summary> /// Gets the code. /// </summary> /// <param name="stack">The stack.</param> /// <returns></returns> public string GetCode(IBordeoPanelStyler stack) { String code = String.Empty; var size = stack.BordeoPanelSize; if (size is PanelMeasure) { var nSize = ((PanelMeasure)size); code = String.Format("{0}{1}", stack.RivieraBordeoCode, nSize.Frente, nSize.Alto); } else if (size is LPanelMeasure) { var lSize = ((LPanelMeasure)size); double start, end; if (lSize.FrenteStart.Nominal < lSize.FrenteEnd.Nominal) { start = lSize.FrenteStart.Nominal; end = lSize.FrenteEnd.Nominal; } else { start = lSize.FrenteEnd.Nominal; end = lSize.FrenteStart.Nominal; } code = String.Format("{0}{1}{2}", stack.RivieraBordeoCode, lSize.FrenteStart, lSize.FrenteEnd, lSize.Alto); } return(code); }
/// <summary> /// Fills the specified stack. /// </summary> /// <param name="stack">The stack.</param> internal void Fill(IBordeoPanelStyler stack, Boolean sideA = true) { this.Clear(); BordeoPanelHeightItem item = new BordeoPanelHeightItem() { Height = stack.Height }; String pName = item.ImageName; String[] acabados = sideA ? stack.AcabadosLadoA.Select(x => x.Acabado).ToArray() : stack.AcabadosLadoB.Select(x => x.Acabado).ToArray(); String code = this.GetCode(stack); for (int i = 0, j = 0; i < pName.Length; i += 2) { if (pName.Substring(i, 2) == "PB") { this.list.Items.Add(new PanelItem() { Code = String.Format("{0}27T", code), Acabado = acabados[j], Height = 135 }); } else if (pName.Substring(i, 2) == "Ps") { this.list.Items.Add(new PanelItem() { Code = String.Format("{0}15T", code), Acabado = acabados[j], Height = 75 }); } if (pName.Substring(i, 2) == "PB" || pName.Substring(i, 2) == "Ps") { j++; } } }
/// <summary> /// Initializes a new instance of the <see cref="WinPanelEditor"/> class. /// </summary> /// <param name="stack">The stack.</param> public WinPanelEditor(IBordeoPanelStyler stack) { this.Stack = stack; InitializeComponent(); }