public void RemoveLayout(BlockLayout bl) { BlockLayouts.Remove(bl); if (LayoutRemoved != null) { LayoutRemoved(this, new TEventArgs <BlockLayout>(bl)); } }
public void RemoveLayout(BlockLayout bl) { BlockLayouts.Remove(bl); if (LayoutRemoved != null) { LayoutRemoved(this, new TEventArgs<BlockLayout>(bl)); } }
public void LoadDefault() { BlockLayouts.Clear(); BlockLayout bl = new BlockLayout(); for (int i = 0; i < 256; i++) { bl.Layout[i] = i; } bl.IsDefault = true; bl.Name = "default"; BlockLayouts.Add(bl); }
public bool LoadFromElement(XElement e) { BlockLayouts.Clear(); LoadDefault(); foreach (var b in e.Elements("layout")) { BlockLayout bl = new BlockLayout(); bl.LoadFromElement(b); BlockLayouts.Add(bl); } return(true); }
public bool LoadFromElement(XElement e) { BlockLayouts.Clear(); LoadDefault(); foreach (var b in e.Elements("layout")) { BlockLayout bl = new BlockLayout(); bl.LoadFromElement(b); BlockLayouts.Add(bl); } return true; }
public void CreateNewLayout(string newName) { BlockLayout bl = new BlockLayout(); for (int i = 0; i < 256; i++) { bl.Layout[i] = -1; } bl.Name = newName; BlockLayouts.Add(bl); if (LayoutAdded != null) { LayoutAdded(this, new TEventArgs<BlockLayout>(bl)); } }
public void CreateNewLayout(string newName) { BlockLayout bl = new BlockLayout(); for (int i = 0; i < 256; i++) { bl.Layout[i] = -1; } bl.Name = newName; BlockLayouts.Add(bl); if (LayoutAdded != null) { LayoutAdded(this, new TEventArgs <BlockLayout>(bl)); } }
private void CmbLayouts_SelectedIndexChanged(object sender, EventArgs e) { CurrentLayout = CmbLayouts.SelectedItem as BlockLayout; BlsSelector.BlockLayout = CurrentLayout; }
public void ShowDialog(int definitionIndex, int graphics1, int graphics2, int paletteIndex, BlockLayout layout) { CmbGraphics1.SelectedIndex = graphics1; CmbGraphics2.SelectedIndex = graphics2; CmbPalettes.SelectedIndex = paletteIndex; CmbLayouts.SelectedItem = layout; CmbDefinitions.SelectedIndex = definitionIndex; CmbDefinitions_SelectedIndexChanged(null, null); this.ShowDialog(); }
private void CmbLayouts_SelectedIndexChanged(object sender, EventArgs e) { if (CurrentLayout != null) { CurrentLayout.Renamed -= CurrentLayout_Renamed; } if (CmbLayouts.SelectedItem != null) { BlsFrom.CurrentDefiniton = BlsTo.CurrentDefiniton = ProjectController.BlockManager.GetDefiniton(CmbDefinitions.SelectedIndex); CurrentLayout = BlsTo.BlockLayout = (BlockLayout) CmbLayouts.SelectedItem; BtnDelete.Enabled = BtnRename.Enabled = true; } else { CurrentLayout = null; BlsTo.BlockLayout = null; BtnDelete.Enabled = BtnRename.Enabled = false; } if (CurrentLayout != null) { CurrentLayout.Renamed += new EventHandler<TEventArgs<string>>(CurrentLayout_Renamed); } }