Beispiel #1
0
        public static void CentrarVentanaEnPantalla(Window window)
        {
            int alto  = Principal.GetPantallaSistema().Bounds.Height;
            int ancho = Principal.GetPantallaSistema().Bounds.Width;

            window.Top  = alto - window.Height - (Principal.GetPantallaSistema().Bounds.Y * -1) - ((alto - window.Height) / 2);
            window.Left = Principal.GetPantallaSistema().Bounds.X + ancho - window.Width - ((ancho - window.Width) / 2);
        }
Beispiel #2
0
        private static void MostrarNotificacionPrivado(String titulo, String mensaje, Bitmap imagen, int SegundosAMostrar, Delegate delegadoMasInformacion, Delegate delegadoCerrar, Boolean cerrarDespuesDeMasInformacion, Boolean EjecutarDelegadoCerradoDespuesDeSegundosTranscurridos)
        {
            try
            {
                int alto  = Principal.GetPantallaSistema().Bounds.Height;
                int ancho = Principal.GetPantallaSistema().Bounds.Width;

                int posicion = -1;
                for (int i = 0; i < activos.Length; i++)
                {
                    if (!activos[i])
                    {
                        posicion = i;
                        break;
                    }
                }
                if (posicion >= 0)
                {
                    activos[posicion] = true;
                    if (imagen == null)
                    {
                        imagen = new Bitmap(@"Imagenes\Iconos\Sistema\Dialogos\informacion.png");
                    }
                    Notificacion n = new Notificacion(titulo, mensaje, imagen, SegundosAMostrar, posicion, delegadoMasInformacion, delegadoCerrar, cerrarDespuesDeMasInformacion, EjecutarDelegadoCerradoDespuesDeSegundosTranscurridos);
                    notificaciones[posicion] = n;
                    n.WindowStartupLocation  = WindowStartupLocation.Manual;

                    n.Top     = alto - 50 - (Principal.GetPantallaSistema().Bounds.Y * -1) - 133 * (posicion + 1);
                    n.Left    = Principal.GetPantallaSistema().Bounds.X + ancho - 359;
                    n.Topmost = true;
                    n.Show();

                    n.seCerroNotificacion += n_seCerroNotificacion;
                }
            }


            catch (InvalidOperationException ioe)
            {
                Log.EscribirLog(ioe.Message + ": " + ioe.StackTrace);
            }
        }