Changeset 6022


Ignore:
Timestamp:
04/18/11 18:36:22 (8 years ago)
Author:
abeham
Message:

#1465

  • Updated branch with changes from the trunk
  • Updated Font2XmlSerializer according to Erik's suggestions
Location:
branches/histogram
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • branches/histogram

  • branches/histogram/HeuristicLab.Analysis

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/histogram/HeuristicLab.Core.Views/3.3/TypeSelector.cs

    r5903 r6022  
    119119          pluginNode.Tag = plugin;
    120120
    121           var types = from t in ApplicationManager.Manager.GetTypes(BaseTypes, plugin, ShowNotInstantiableTypes, assignableToAllTypes)
     121          var types = from t in ApplicationManager.Manager.GetTypes(BaseTypes, plugin, !ShowNotInstantiableTypes, assignableToAllTypes)
    122122                      orderby t.Name ascending
    123123                      select t;
  • branches/histogram/HeuristicLab.Encodings.PermutationEncoding

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/histogram/HeuristicLab.Optimization/3.3/Problems/SingleObjectiveHeuristicOptimizationProblem.cs

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/histogram/HeuristicLab.Persistence

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/histogram/HeuristicLab.Persistence/3.3/Default/Xml/Primitive/System.Drawing/Font2XmlSerializer.cs

    r6020 r6022  
    2222using System;
    2323using System.Drawing;
    24 using System.Xml;
     24using System.Globalization;
    2525
    2626namespace HeuristicLab.Persistence.Default.Xml.Primitive {
     
    2828
    2929    public override XmlString Format(Font font) {
    30       XmlDocument doc = new XmlDocument();
    31       XmlNode fontNode = doc.CreateElement("Font");
    32       fontNode.Attributes.Append(doc.CreateAttribute("Name"));
    33       fontNode.Attributes.Append(doc.CreateAttribute("Size"));
    34       fontNode.Attributes.Append(doc.CreateAttribute("Style"));
    3530      if (font != null) {
    36         fontNode.Attributes["Name"].Value = font.Name;
    37         fontNode.Attributes["Size"].Value = font.Size.ToString();
    38         fontNode.Attributes["Style"].Value = font.Style.ToString("d");
     31        return new XmlString(font.Name
     32          + ";" + font.SizeInPoints.ToString(CultureInfo.InvariantCulture.NumberFormat)
     33          + ";" + font.Style.ToString("d")
     34          + ";" + font.GdiCharSet.ToString());
    3935      }
    40       return new XmlString(fontNode.OuterXml);
     36      return new XmlString(string.Empty);
    4137    }
    4238
    4339    public override Font Parse(XmlString fontData) {
    44       XmlTextReader tr = new XmlTextReader(fontData.Data, XmlNodeType.Element, null);
    45       if (!tr.Read() || tr.Name != "Font") return null;
    46       string name = tr.GetAttribute("Name");
    47       if (string.IsNullOrEmpty(name)) return null;
     40      if (string.IsNullOrEmpty(fontData.Data)) return null;
     41      string[] tokens = fontData.Data.Split(';');
     42      if (tokens.Length < 4) return null;
    4843      float size = 12.0f;
    49       if (!float.TryParse(tr.GetAttribute("Size"), out size)) return null;
    5044      FontStyle style = FontStyle.Regular;
    51       if (!Enum.TryParse<FontStyle>(tr.GetAttribute("Style"), out style)) return null;
    52       return new Font(name, size, style);
     45      byte gdiCharSet = 1;
     46      if (!float.TryParse(tokens[1], NumberStyles.Float, CultureInfo.InvariantCulture.NumberFormat, out size))
     47        return null;
     48      if (!Enum.TryParse(tokens[2], out style))
     49        return null;
     50      if (!byte.TryParse(tokens[3], out gdiCharSet))
     51        return null;
     52
     53      return new Font(tokens[0], size, style, GraphicsUnit.Point, gdiCharSet);
    5354    }
    5455  }
  • branches/histogram/HeuristicLab.PluginInfrastructure/3.3/DefaultApplicationManager.cs

    r5903 r6022  
    151151    // register assembly in the assembly cache for the AssemblyResolveEvent
    152152    private void RegisterLoadedAssembly(Assembly asm) {
     153      if (loadedAssemblies.ContainsKey(asm.FullName) || loadedAssemblies.ContainsKey(asm.GetName().Name)) {
     154        throw new ArgumentException("An assembly with the name " + asm.GetName().Name + " has been registered already.", "asm");
     155      }
    153156      loadedAssemblies.Add(asm.FullName, asm);
    154157      loadedAssemblies.Add(asm.GetName().Name, asm); // add short name
  • branches/histogram/HeuristicLab.PluginInfrastructure/3.3/Manager/PluginValidator.cs

    r5652 r6022  
    606606    // register assembly in the assembly cache for the ReflectionOnlyAssemblyResolveEvent
    607607    private void RegisterLoadedAssembly(Assembly asm) {
     608      if (reflectionOnlyAssemblies.ContainsKey(asm.FullName) || reflectionOnlyAssemblies.ContainsKey(asm.GetName().Name)) {
     609        throw new ArgumentException("An assembly with the name " + asm.GetName().Name + " has been registered already.", "asm");
     610      }
    608611      reflectionOnlyAssemblies.Add(asm.FullName, asm);
    609612      reflectionOnlyAssemblies.Add(asm.GetName().Name, asm); // add short name
  • branches/histogram/HeuristicLab.Problems.DataAnalysis

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/histogram/HeuristicLab.Problems.VehicleRouting

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/histogram/HeuristicLab.Problems.VehicleRouting.Views

    • Property svn:mergeinfo changed (with no actual effect on merging)
Note: See TracChangeset for help on using the changeset viewer.