/// <summary> /// Pinta los objetos de la oferta remota. /// </summary> private void pintarObjetosOfertaRemoto() { pObjetosRemotos.Controls.Clear(); int objetos = 1; NodoObjeto nodoAux = ofertaRemoto.Cab; Point punto = new Point(0, 0); while (nodoAux != null) { ImagenDatos imagenDatos = new ImagenDatos(); imagenDatos.Inicializar(nodoAux.Info); imagenDatos.Location = punto; imagenDatos.Click += new EventHandler(imagenDatosOfertaRemoto_Click); pObjetosRemotos.Controls.Add(imagenDatos); if (objetos < 4) { punto.X = punto.X + 50; objetos++; } else { punto.X = 0; punto.Y = punto.Y + 50; objetos = 1; } nodoAux = nodoAux.Siguiente; } }
/// <summary> /// Selecciona el objeto que se ha pulsado /// </summary> private void seleccionarRemoto_Click(object sender, EventArgs e) { ImagenDatos seleccionadoRemoto = (ImagenDatos)sender; this.SeleccionarRemoto(seleccionadoRemoto.Datos); pintarSeleccionadoRemoto(); }
/// <summary> /// Selecciona el objeto que se ha pulsado /// </summary> private void seleccionar_Click(object sender, EventArgs e) { ImagenDatos seleccionado = (ImagenDatos)sender; this.controlador.Seleccionar(seleccionado.Datos); pintarSeleccionado(); }
/// <summary> /// Manejador del evento click en una imagen de la oferta remota. /// </summary> /// <param name="sender">Fuente del evento.</param> /// <param name="e">Argumentos del evento.</param> private void imagenDatosOfertaRemoto_Click(object sender, EventArgs e) { ImagenDatos seleccionado = (ImagenDatos)sender; seleccionadoOferta = seleccionado.Datos; ofertaSeleccionadoPropio = false; pintarSeleccionadoOferta(); }
/// <summary> /// Inicializa el inventario. /// </summary> private void InicializarInventarioRemoto() { this.InicializarSeleccionadoRemoto(); this.InicializarPuntosRemoto(); ImagenDatos imagenDatos; NodoObjeto nodoAux; ListaObjetos inventario = this.inventarioRemoto; nodoAux = inventario.Cab; while (nodoAux != null) { imagenDatos = new ImagenDatos(); imagenDatos.Inicializar(nodoAux.Info); imagenDatos.Click += new EventHandler(this.seleccionarRemoto_Click); imagenDatos.Location = this.CalcularPosicionItemRemoto(nodoAux.Info.Tipo); switch (nodoAux.Info.Tipo) { case ("Alimento"): { this.tAlimentosRemoto.Controls.Add(imagenDatos); break; } case ("Curador"): { this.tCuracionesRemoto.Controls.Add(imagenDatos); break; } case ("Limpiador"): { this.tLimpiadoresRemoto.Controls.Add(imagenDatos); break; } case ("Educador"): { this.tEducadoresRemoto.Controls.Add(imagenDatos); break; } default: { this.tOtrosRemoto.Controls.Add(imagenDatos); break; } } nodoAux = nodoAux.Siguiente; } pintarSeleccionadoRemoto(); }
public Resultado ObtenerPertenencia() { Resultado resultado = new Resultado(); try { resultado = new ImagenDatos().ObtenerPertenencia(); return(resultado); } catch (Exception ex) { throw ex; } }
public Resultado Acciones(Imagen img) { Resultado resultado = new Resultado(); try { resultado = new ImagenDatos().Acciones(img); return(resultado); } catch (Exception ex) { throw ex; } }