public void LoadLayout(LayoutContainer input) { if (this.initalized) { var cLay = 0; foreach (var kd in input.KeyDatas) { if (kd.Z > cLay) { cLay = kd.Z; } } while (this.Layers.Count < cLay + 1) { var lay = new UCLayer(this.Keyboard, input, this.Layers.Count); this.Layers.Add(lay); this.SLMain.Items.Add(lay); } while (this.Layers.Count > cLay + 1) { this.SLMain.Items.RemoveAt(this.Layers.Count - 1); this.Layers.RemoveAt(this.Layers.Count - 1); } foreach (var lay in this.Layers) { lay.LoadLayout(input); } this.DisplayUnsavedChangeSignal(); } }
public void LoadLayout(ClLayoutContainer input) { if (this.initalized) { var cLay = 0; foreach (var kd in input.KeyDatas) { if (kd.Z > cLay) { cLay = kd.Z; } } while (this.Layers.Count < cLay + 1) { var lay = new UCLayer(this.Keyboard, input, this.Layers.Count); this.Layers.Add(lay); this.SLMain.Items.Add(lay); } while (this.Layers.Count > cLay + 1) { this.SLMain.Items.RemoveAt(this.Layers.Count - 1); this.Layers.RemoveAt(this.Layers.Count - 1); } foreach (var lay in this.Layers) { lay.LoadLayout(input); } this.BtnSave.Text = "Save Layout*"; } }