Changeset 11017 for stable/HeuristicLab.Persistence/3.3/Default
- Timestamp:
- 06/16/14 09:57:19 (10 years ago)
- Location:
- stable
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
stable
- Property svn:mergeinfo changed
/trunk/sources merged: 9988,10889,10961
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Persistence
- Property svn:mergeinfo changed
/trunk/sources/HeuristicLab.Persistence (added) merged: 9988,10889,10961
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Persistence/3.3/Default/Xml/Primitive/System.Drawing/Font2XmlSerializer.cs
r9456 r11017 28 28 public override XmlString Format(Font font) { 29 29 return new XmlString(string.Format("{0};{1};{2};{3};{4};{5}", 30 font.Name,30 GetFontFamilyName(font.FontFamily), 31 31 Float2XmlSerializer.FormatG8(font.Size), 32 32 font.Style, … … 39 39 string[] tokens = fontData.Data.Split(';'); 40 40 return new Font( 41 tokens[0],41 GetFontFamily(tokens[0]), 42 42 Float2XmlSerializer.ParseG8(tokens[1]), 43 43 (FontStyle)Enum.Parse(typeof(FontStyle), tokens[2]), … … 46 46 bool.Parse(tokens[5])); 47 47 } 48 49 public const string GENERIC_MONOSPACE_NAME = "_GenericMonospace"; 50 public const string GENERIC_SANS_SERIF_NAME = "_GenericSansSerif"; 51 public const string GENERIC_SERIF_NAME = "_GenericSerif"; 52 53 public static FontFamily GetFontFamily(string name) { 54 if (name == GENERIC_MONOSPACE_NAME) return FontFamily.GenericMonospace; 55 if (name == GENERIC_SANS_SERIF_NAME) return FontFamily.GenericSansSerif; 56 if (name == GENERIC_SERIF_NAME) return FontFamily.GenericSerif; 57 return new FontFamily(name); 58 } 59 60 public static string GetFontFamilyName(FontFamily ff) { 61 if (ff.Equals(FontFamily.GenericMonospace)) return GENERIC_MONOSPACE_NAME; 62 if (ff.Equals(FontFamily.GenericSansSerif)) return GENERIC_SANS_SERIF_NAME; 63 if (ff.Equals(FontFamily.GenericSerif)) return GENERIC_SERIF_NAME; 64 return ff.Name; 65 } 66 48 67 } 49 68 }
Note: See TracChangeset
for help on using the changeset viewer.