Esempio n. 1
0
        /// <summary>
        /// Devuelve una instancia de frmRoute.
        /// </summary>
        public frmRoute(otc.panels.OTCRoute route)
        {
            InitializeComponent();

            this.Text = Application.ProductName;
            _route    = route;

            txtName.Text = _route.Name;
        }
Esempio n. 2
0
        /// <summary>
        /// Inicia el modo de edición de rutas.
        /// </summary>
        public void BeginRouteEditor(OTCPanelBlock block)
        {
            if (_mode != PanelModes.Design)
            {
                throw new Exception("No se puede iniciar la edición de una ruta si el panel no se encuentra el modo diseño.");
            }

            // Obtiene la ruta a editar
            _route        = this.SelectedSchema.GetRoute(block.Id);
            _routeEditing = true;
        }
Esempio n. 3
0
        /// <summary>
        /// Responde a la pulsación del botón Aceptar.
        /// </summary>
        private void btnAccept_Click(object sender, System.EventArgs e)
        {
            if (_route == null)
            {
                _route = new OTCRoute();
            }

            if (string.IsNullOrEmpty(txtName.Text))
            {
                MessageBox.Show(this, "Debe p`roporcionar un nombre para la ruta.", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                tabRoute.SelectedTab = tabRouteGeneral;
                txtName.Focus();
                return;
            }

            _route.Name = txtName.Text;

            this.DialogResult = DialogResult.OK;
            this.Close();
        }