Ejemplo n.º 1
0
        private void Dispose(Schiffsposition except)
        {
            if (disposed)
            {
                throw new ObjectDisposedException("Move");
            }
            disposed = true;

            foreach (var ziel in _Ziele)
            {
                ziel.Occupied -= ZielOccupied;
                if (ziel != except)
                {
                    _FieldsContainer.Children.Remove(ziel);
                    _Spielfeld.Unregister(ziel);
                }
            }
            _Ziele.Clear();

            MovedOrCanceled(_Von);

            _Spielfeld       = null;
            _FieldsContainer = null;
            _Von             = null;
            _Mover           = null;
            _Ziele           = null;
            _Moved           = null;
        }
Ejemplo n.º 2
0
        public void Init(FieldsView spielfeld, Canvas fieldsContainer, Schiffsposition von, IFieldOccupant mover, object argument, Action <Schiffsposition, Schiffsposition> moved)
        {
            _Spielfeld       = spielfeld;
            _FieldsContainer = fieldsContainer;
            _Von             = von;
            _Mover           = mover;
            _Argument        = argument;

            _Ziele = new List <Schiffsposition>();
            _Moved = moved;
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Clear and load the filtered data into the main control.
        /// Also takes care of column resizing
        /// </summary>
        private void RefreshFieldsView()
        {
            FieldsView.BeginUpdate();

            FieldsView.Items.Clear();
            foreach (var field in filter.applyFilter())
            {
                string[] data = { field.DatabaseName, field.Schema, field.TableName, field.ColumnName, field.DataType };
                FieldsView.Items.Add(new ListViewItem(data));
            }

            FieldsView.AutoResizeColumns(ColumnHeaderAutoResizeStyle.ColumnContent);
            FieldsView.AutoResizeColumns(ColumnHeaderAutoResizeStyle.HeaderSize);

            FieldsView.EndUpdate();
        }
Ejemplo n.º 4
0
 public void Setup(FieldsView fieldsView, Canvas spielfeld)
 {
     _FieldsView = fieldsView;
     _Spielfeld  = spielfeld;
 }
Ejemplo n.º 5
0
 public Game(FieldsView spielfeld, Canvas fieldsContainer)
 {
     _Spielfeld       = spielfeld;
     _FieldsContainer = fieldsContainer;
 }