|
|
@ -6,16 +6,12 @@ |
|
|
|
// </file>
|
|
|
|
// </file>
|
|
|
|
|
|
|
|
|
|
|
|
using System; |
|
|
|
using System; |
|
|
|
using System.Drawing.Printing; |
|
|
|
|
|
|
|
using System.Xml; |
|
|
|
|
|
|
|
using System.Collections; |
|
|
|
|
|
|
|
using System.Drawing; |
|
|
|
using System.Drawing; |
|
|
|
|
|
|
|
using System.Globalization; |
|
|
|
using System.Reflection; |
|
|
|
using System.Reflection; |
|
|
|
using System.Windows.Forms; |
|
|
|
|
|
|
|
using System.ComponentModel; |
|
|
|
|
|
|
|
using System.Text.RegularExpressions; |
|
|
|
using System.Text.RegularExpressions; |
|
|
|
using System.Globalization; |
|
|
|
using System.Windows.Forms; |
|
|
|
|
|
|
|
using System.Xml; |
|
|
|
|
|
|
|
|
|
|
|
namespace SharpReportCore { |
|
|
|
namespace SharpReportCore { |
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
@ -144,18 +140,22 @@ namespace SharpReportCore { |
|
|
|
return Return; |
|
|
|
return Return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static void BuildFontElement (Font font, XmlElement fontElement) { |
|
|
|
public static void BuildFontElement (Font font, XmlElement fontElement) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
System.ComponentModel.TypeConverter converter = |
|
|
|
|
|
|
|
System.ComponentModel.TypeDescriptor.GetConverter( typeof(Font)); |
|
|
|
|
|
|
|
string fontString = converter.ConvertToInvariantString(font); |
|
|
|
|
|
|
|
|
|
|
|
XmlAttribute att = fontElement.OwnerDocument.CreateAttribute ("value"); |
|
|
|
XmlAttribute att = fontElement.OwnerDocument.CreateAttribute ("value"); |
|
|
|
string str = XmlFormReader.TypedValueToString (font,CultureInfo.InvariantCulture).Replace (",","."); |
|
|
|
|
|
|
|
string fontString = str.Replace (';',','); |
|
|
|
|
|
|
|
att.InnerText = fontString; |
|
|
|
att.InnerText = fontString; |
|
|
|
fontElement.Attributes.Append(att); |
|
|
|
fontElement.Attributes.Append(att); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static Font MakeFont(string font) { |
|
|
|
public static Font MakeFont(string font) { |
|
|
|
string s = font.Replace(';',','); |
|
|
|
System.ComponentModel.TypeConverter converter = |
|
|
|
return (Font)XmlFormReader.StringToTypedValue(s,typeof(Font),CultureInfo.InstalledUICulture); |
|
|
|
System.ComponentModel.TypeDescriptor.GetConverter( typeof(Font)); |
|
|
|
|
|
|
|
return (Font)converter.ConvertFromInvariantString(font); |
|
|
|
} |
|
|
|
} |
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// Sets a property called propertyName in object <code>o</code> to <code>val</code>. This method performs
|
|
|
|
/// Sets a property called propertyName in object <code>o</code> to <code>val</code>. This method performs
|
|
|
@ -202,8 +202,8 @@ namespace SharpReportCore { |
|
|
|
propertyInfo.SetValue(o, Color.FromName(color), null); |
|
|
|
propertyInfo.SetValue(o, Color.FromName(color), null); |
|
|
|
} |
|
|
|
} |
|
|
|
} else if (propertyInfo.PropertyType == typeof(Font)) { |
|
|
|
} else if (propertyInfo.PropertyType == typeof(Font)) { |
|
|
|
Font fnt = (Font)XmlFormReader.StringToTypedValue (value,typeof(Font), |
|
|
|
Font fnt = XmlFormReader.MakeFont(value); |
|
|
|
CultureInfo.InvariantCulture); |
|
|
|
|
|
|
|
if (fnt != null) { |
|
|
|
if (fnt != null) { |
|
|
|
propertyInfo.SetValue(o,fnt,null); |
|
|
|
propertyInfo.SetValue(o,fnt,null); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|