Esempio n. 1
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
 }
Esempio n. 2
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
 }
Esempio n. 3
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);
 }
Esempio n. 4
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);
 }
Esempio n. 5
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);
 }