Beispiel #1
0
        /// <summary>
        /// Verifica se tem de introduzir controlos
        /// </summary>
        /// <param name="coordClicked"></param>
        /// <returns><code>false</code> se já n tiver controlos, <code>true</code> caso contrário</returns>
        public bool verifyCoordinate(string coordClicked)
        {
            IUtil util = (IUtil)incrementor.create("util" + _currentCtrl);

            bool first = util.isFirst(coordClicked, _maximumAvailableControl);
            bool last  = util.isLast(coordClicked, _maximumAvailableControl);

            if (first)
            {
                Controls.Remove(prev);
            }
            if (last)
            {
                Controls.Remove(next);
            }

            if (last && first)
            {
                Controls.Remove(up);
                return(false);
            }

            return(true);
        }
Beispiel #2
0
        private TravelCoordControlBase createControl(string id, string coordClicked)
        {
            if (coordClicked == null)
            {
                throw new Exception("coordClicked == null");
            }

            TravelCoordControlBase ctrl = (TravelCoordControlBase)factory.create("Travel" + id);

            ctrl.Coord = coordClicked;
            if (ctrl.Coord == null)
            {
                throw new Exception("ctrl.Coord == null -> coordClicked == null ? " + (coordClicked == null) + " Control: " + ctrl.GetType().Name);
            }

            travelPanel.PreviousCoordinate      = coordClicked;
            travelPanel.CurrentControl          = id;
            travelPanel.MaximumAvailableControl = _maximumAvailableControl;

            travelPanel.CurrentCoordinate = ctrl.Coord;

            return(ctrl);
        }