Esempio n. 1
0
        private void addCounter_Click(object sender, System.EventArgs e)
        {
            AddCounter dlg = new AddCounter();

            if ( dlg.ShowDialog( this ) == DialogResult.OK )
            {
                Counter.Register( new Counter( dlg.NameStr, dlg.FmtStr, (ushort)dlg.ItemID, (int)dlg.Hue, dlg.DisplayImage ) );
                Counter.Redraw( counters );
            }
        }
Esempio n. 2
0
        private void delCounter_Click(object sender, System.EventArgs e)
        {
            if ( counters.SelectedItems.Count <= 0 )
                return;

            Counter c = counters.SelectedItems[0].Tag as Counter;

            if ( c != null )
            {
                AddCounter ac = new AddCounter( c );
                switch ( ac.ShowDialog( this ) )
                {
                    case DialogResult.Abort:
                        counters.Items.Remove( c.ViewItem );
                        Counter.List.Remove( c );
                        break;

                    case DialogResult.OK:
                        c.Set( (ushort)ac.ItemID, ac.Hue, ac.NameStr, ac.FmtStr, ac.DisplayImage );
                        break;
                }
            }
        }