<%
#encoding: UTF-8

=begin

CapicuaGen

CapicuaGen es un software que ayuda a la creación automática de
sistemas empresariales a través de la definición y ensamblado de
diversos generadores de características.

El proyecto fue iniciado por José Luis Bautista Martín, el 6 de enero
de 2016.

Puede modificar y distribuir este software, según le plazca, y usarlo
para cualquier fin ya sea comercial, personal, educativo, o de cualquier
índole, siempre y cuando incluya este mensaje, y se permita acceso al
código fuente.

Este software es código libre, y se licencia bajo LGPL.

Para más información consultar http://www.gnu.org/licenses/lgpl.html
=end
%>using System;
using System.Drawing;
using System.Reflection;
using System.Windows.Forms;

namespace <%=generation_attributes[:namespace]%>
{
    partial class <%=template_target.class_name%>
    {
        #region Propiedades

        protected System.Windows.Forms.Timer timer = new System.Windows.Forms.Timer();
        protected bool fadeIn = true;
        protected bool fadeOut = false;

        #endregion Propiedades

        #region Constructor

        public  <%=template_target.class_name%> ()
        {
            InitializeComponent();
            ConfigurarPantalla();
            ComenzasMostrarPantalla();
        }

        #endregion Constructor

        #region Metodos

        protected virtual void ConfigurarPantalla()
        {
            this.lblVersion.Text = this.AssemblyVersion;
            this.lblCopyright.Text = this.AssemblyCopyright;
            this.lblTitulo.Text = this.AssemblyTitle;
            this.lblDescripcion.Text = this.AssemblyDescription;
        }

        protected virtual void ComenzasMostrarPantalla()
        {
            this.Opacity = 0.5;
            timer.Interval = 60;
            timer.Tick += timer_Tick;
            timer.Start();
        }

        #endregion Metodos

        #region Metodos Relativos a la Información del Assembly

        protected virtual string AssemblyVersion
        {
            get
            {
                return Assembly.GetExecutingAssembly().GetName().Version.ToString();
            }
        }

        public virtual string AssemblyTitle
        {
            get
            {
                object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyTitleAttribute), false);
                if (attributes.Length == 0)
                {
                    return "";
                }
                return ((AssemblyTitleAttribute)attributes[0]).Title;
            }
        }

        public virtual string AssemblyDescription
        {
            get
            {
                object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyDescriptionAttribute), false);
                if (attributes.Length == 0)
                {
                    return "";
                }
                return ((AssemblyDescriptionAttribute)attributes[0]).Description;
            }
        }

        public virtual string AssemblyCopyright
        {
            get
            {
                object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCopyrightAttribute), false);
                if (attributes.Length == 0)
                {
                    return "";
                }
                return ((AssemblyCopyrightAttribute)attributes[0]).Copyright;
            }
        }

        #endregion Metodos Relativos a la Información del Assembly

        #region Eventos

        protected virtual void timer_Tick(object sender, EventArgs e)
        {
            if (fadeIn)
            {
                if (this.Opacity < 1.0)
                {
                    this.Opacity += 0.02;
                }
                else
                {
                    fadeIn = false;
                    fadeOut = true;
                }
            }
            else if (fadeOut)
            {
                if (this.Opacity > 0)
                {
                    this.Opacity -= 0.02;
                }
                else
                {
                    fadeOut = false;
                }
            }

            if (!(fadeIn || fadeOut))
            {
                timer.Stop();
                this.Close();
            }
        }

        #endregion Eventos
    }
}