Пример #1
0
 private void MostrarInformacion <T>(IMostrar <T> elemento)
 {
     if (!object.ReferenceEquals(elemento, null))
     {
         try
         {
             if (elemento is Correo)
             {
                 this.rtbMostrar.Text = ((Correo)elemento).MostrarDatos((IMostrar <List <Paquete> >)elemento);
                 GuardarString.Guardar(((Correo)elemento).MostrarDatos((IMostrar <List <Paquete> >)elemento), "Salida.txt");
             }
             else
             if (elemento is Paquete)
             {
                 this.rtbMostrar.Text = ((Paquete)elemento).ToString();
                 GuardarString.Guardar(((Paquete)elemento).ToString(), "Salida.txt");
             }
         }
         catch (FileNotFoundException fnfExc)
         {
             MessageBox.Show(fnfExc.Message, "Atención");
         }
         catch (IOException ioExc)
         {
             MessageBox.Show(ioExc.Message, "Atención");
         }
         catch (Exception e)
         {
             MessageBox.Show(e.Message, "Atención");
         }
     }
 }
Пример #2
0
 private void MostrarInformacion <T>(IMostrar <T> elemento)
 {
     if (elemento != null)
     {
         this.rtbMostrar.Text = elemento.MostrarDatos(elemento);
         GuardarString.Guardar(elemento.MostrarDatos(elemento), "salida.txt");
     }
 }
Пример #3
0
        private void MostrarInformacion <T>(IMostrar <T> elemento)
        {
            string archivo = Environment.GetFolderPath(Environment.SpecialFolder.Desktop)
                             + "\\salida.txt";

            if (elemento != null)
            {
                this.rtbMostrar.Text = elemento.MostrarDatos(elemento);
                GuardarString.Guardar(rtbMostrar.Text, archivo);
            }
        }
Пример #4
0
 private void MostrarInformacion <T>(IMostrar <T> elemento)
 {
     if (((object)elemento) != null)
     {
         try
         {
             this.rtbMostrar.Text = elemento.MostrarDatos(elemento);
             GuardarString.Guardar(this.rtbMostrar.Text, "salida.txt");
         }
         catch (Exception)
         {
             MessageBox.Show("No se ha podido guardar en salida.txt");
         }
     }
 }
Пример #5
0
        /// <summary>
        /// Muestra los datos de los paquetes en el rich text box
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="elemento"></param>Los paquetes a mostrar
        private void MostrarInformacion <T>(IMostrar <T> elemento)
        {
            if (elemento != null)
            {
                rtbMostrar.Text = elemento.MostrarDatos(elemento);

                try
                {
                    GuardarString.Guardar(elemento.MostrarDatos(elemento), "salida.txt");
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
            }
        }
Пример #6
0
        private void MostrarInformacion <T>(IMostrar <T> elemento)
        {
            if (((object)elemento) != null)
            {
                if (elemento is Correo)
                {
                    this.rtbMostrar.Text += ((Correo)elemento).ToString();
                }
                else if (elemento is Paquete)
                {
                    this.rtbMostrar.Text += ((Paquete)elemento).ToString();
                }

                GuardarString.Guardar(this.rtbMostrar.Text, "Salida");
            }
        }
Пример #7
0
        private void FrmPpal_FormClosing(object sender, FormClosingEventArgs e)
        {
            string path = @"Desktop\salida";

            string message = GuardarString.Guardar(this._correo.MostrarDatos(this._correo), path);
        }