Esempio n. 1
0
 public void RemoveLayout(BlockLayout bl)
 {
     BlockLayouts.Remove(bl);
     if (LayoutRemoved != null)
     {
         LayoutRemoved(this, new TEventArgs <BlockLayout>(bl));
     }
 }
Esempio n. 2
0
 public void RemoveLayout(BlockLayout bl)
 {
     BlockLayouts.Remove(bl);
     if (LayoutRemoved != null)
     {
         LayoutRemoved(this, new TEventArgs<BlockLayout>(bl));
     }
 }
Esempio n. 3
0
 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);
 }
Esempio n. 4
0
        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);
        }
Esempio n. 5
0
        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);
        }
Esempio n. 6
0
        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;
        }
Esempio n. 7
0
        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));
            }
        }
Esempio n. 8
0
        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));
            }
        }
Esempio n. 9
0
 private void CmbLayouts_SelectedIndexChanged(object sender, EventArgs e)
 {
     CurrentLayout = CmbLayouts.SelectedItem as BlockLayout;
     BlsSelector.BlockLayout = CurrentLayout;
 }
Esempio n. 10
0
 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();
 }
Esempio n. 11
0
        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);
            }
        }