예제 #1
0
 internal void NotificarEliminacion()
 {
     ID         = int.MaxValue;
     _Anterior  = null;
     _Siguiente = null;
     _Formato   = null;
 }
예제 #2
0
        internal void AumentarEspacioAntesParrafo()
        {
            Medicion valor = Formato.ObtenerEspacioAnterior();

            valor   = valor + new Medicion(5, Unidad.Puntos);
            Formato = Formato.Fusionar(FormatoParrafo.CrearEspacioAnterior(valor));
            _contenedor.NotificarCambio(this);
        }
예제 #3
0
 internal void AgregarTextoDe(Parrafo parrafo_Siguiente)
 {
     bufferTexto.Agregar(parrafo_Siguiente.bufferTexto);
     if (_Formato != null || parrafo_Siguiente._Formato != null)
     {
         _Formato = Formato.Fusionar(parrafo_Siguiente.Formato);
     }
     _contenedor.NotificarCambio(this);
 }
예제 #4
0
 internal Parrafo(Documento _documento, int id, Parrafo anterior, Parrafo siguiente, Parrafo formatoBase)
 {
     _contenedor = _documento;
     ID          = id;
     _Formato    = formatoBase._Formato == null?null:formatoBase.Formato.Clonar();
     Posicion    = 1;
     _Anterior   = anterior;
     _Siguiente  = siguiente;
     bufferTexto.Iniciar();
 }
예제 #5
0
        public void DisminuirInterlineado()
        {
            decimal valor = Formato.ObtenerEspaciadoInterlineal() - 0.5m;

            if (valor < 1)
            {
                valor = 1;
            }
            Formato = Formato.Fusionar(FormatoParrafo.CrearEspacioInterlineal(valor));
            _contenedor.NotificarCambio(this);
        }
예제 #6
0
        public void IniciarParrafo(FormatoParrafo formato)
        {
            Medicion medicionAnterior  = formato.ObtenerEspacioAnterior();
            Medicion medicionPosterior = formato.ObtenerEspacioPosterior();
            string   estilos           = "";

            estilos += "margin-top:" + medicionAnterior.ConvertirA(Unidad.Puntos).Valor.ToString(System.Globalization.CultureInfo.InvariantCulture) + "pt;";
            estilos += "margin-bottom:" + medicionPosterior.ConvertirA(Unidad.Puntos).Valor.ToString(System.Globalization.CultureInfo.InvariantCulture) + "pt;";
            estilos += "line-spacing:" + formato.ObtenerEspaciadoInterlineal() + "em;";
            _html.Append("<p style='" + estilos + "'>");
        }
예제 #7
0
        internal void DisminuirEspacioAntesParrafo()
        {
            Medicion valor = Formato.ObtenerEspacioAnterior();

            valor = valor - new Medicion(5, Unidad.Puntos);
            if (valor.Valor < 0)
            {
                valor = Medicion.Cero;
            }
            Formato = Formato.Fusionar(FormatoParrafo.CrearEspacioAnterior(valor));
            _contenedor.NotificarCambio(this);
        }
예제 #8
0
 internal static double Get(FormatoParrafo formato)
 {
     if (formato != null)
     {
         MemberInfo[] mi = formato.GetType().GetMember(formato.ToString());
         if (mi != null && mi.Length > 0)
         {
             LineSpacingAttribute attr = Attribute.GetCustomAttribute(mi[0],
                                                                      typeof(LineSpacingAttribute)) as LineSpacingAttribute;
             if (attr != null)
             {
                 return(attr.LineSpacing);
             }
         }
     }
     return(12); // Default: 1.0 equals to 12 points
 }
예제 #9
0
 internal static int Get(FormatoParrafo formato)
 {
     if (formato != null)
     {
         MemberInfo[] mi = formato.GetType().GetMember(formato.ToString());
         if (mi != null && mi.Length > 0)
         {
             AlignmentAttribute attr = Attribute.GetCustomAttribute(mi[0],
                                                                    typeof(AlignmentAttribute)) as AlignmentAttribute;
             if (attr != null)
             {
                 return(attr.Alignment);
             }
         }
     }
     return(0); // Default: Left
 }
예제 #10
0
 internal static System.Drawing.Color Get(FormatoParrafo formato)
 {
     if (formato != null)
     {
         MemberInfo[] mi = formato.GetType().GetMember(formato.ToString());
         if (mi != null && mi.Length > 0)
         {
             ColorAttribute attr = Attribute.GetCustomAttribute(mi[0],
                                                                typeof(ColorAttribute)) as ColorAttribute;
             if (attr != null)
             {
                 return(System.Drawing.Color.FromArgb(attr.Alpha, attr.Red, attr.Green, attr.Blue));
             }
         }
     }
     return(System.Drawing.Color.Black);
 }
예제 #11
0
 internal static bool Get(FormatoParrafo formato)
 {
     if (formato != null)
     {
         MemberInfo[] mi = formato.GetType().GetMember(formato.ToString());
         if (mi != null && mi.Length > 0)
         {
             BoldAttribute attr = Attribute.GetCustomAttribute(mi[0],
                                                               typeof(BoldAttribute)) as BoldAttribute;
             if (attr != null)
             {
                 return(attr.Bold);
             }
         }
     }
     return(false);
 }
예제 #12
0
 internal static double Get(FormatoParrafo formato)
 {
     if (formato != null)
     {
         MemberInfo[] mi = formato.GetType().GetMember(formato.ToString());
         if (mi != null && mi.Length > 0)
         {
             FontSizeAttribute attr = Attribute.GetCustomAttribute(mi[0],
                                                                   typeof(FontSizeAttribute)) as FontSizeAttribute;
             if (attr != null)
             {
                 return(attr.FontSize);
             }
         }
     }
     return(12);
 }
예제 #13
0
 public void IniciarParrafo(FormatoParrafo formato)
 {
 }
예제 #14
0
 public void AumentarInterlineado()
 {
     Formato = Formato.Fusionar(FormatoParrafo.CrearEspacioInterlineal(Formato.ObtenerEspaciadoInterlineal() + 0.5m));
     _contenedor.NotificarCambio(this);
 }
예제 #15
0
 public void AlinearCentro()
 {
     Formato = Formato.Fusionar(FormatoParrafo.CrearAlineacionCentro());
     _contenedor.NotificarCambio(this);
 }
예제 #16
0
 void IEscritor.IniciarParrafo(FormatoParrafo formato)
 {
     parrafoActual         = InsertarParrafo(parrafoIns, posicionInsercion);
     parrafoActual.Formato = formato.Clonar();
     posicionInsercion     = 0;
 }