Free cookie consent management tool by TermsFeed Policy Generator

Changeset 3903


Ignore:
Timestamp:
06/08/10 16:26:35 (14 years ago)
Author:
epitzer
Message:

Incorporate changes suggested by abeham in 842#comment:28 (#842)

  • Fix persistence of selected assemblies
  • Fix problem with static initialization
  • Make parameter values (ActualValue) with parameter object
  • show (or hide) parameter namespaces as necessary
  • add icons for buttons, assemblies and namespaces
  • sort assemblies and namespaces alphabetically
  • correctly mark and unmark select assemblies
  • put assemblies and namespaces into group boxes
Location:
trunk/sources
Files:
2 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Operators.Programmable/3.3/HeuristicLab.Operators.Programmable-3.3.csproj

    r3832 r3903  
    9595    </Compile>
    9696    <Compile Include="Properties\AssemblyInfo.cs" />
     97    <Compile Include="Properties\Resources.Designer.cs">
     98      <AutoGen>True</AutoGen>
     99      <DesignTime>True</DesignTime>
     100      <DependentUpon>Resources.resx</DependentUpon>
     101    </Compile>
    97102  </ItemGroup>
    98103  <ItemGroup>
     
    167172      <SubType>Designer</SubType>
    168173    </EmbeddedResource>
     174    <EmbeddedResource Include="Properties\Resources.resx">
     175      <Generator>ResXFileCodeGenerator</Generator>
     176      <LastGenOutput>Resources.Designer.cs</LastGenOutput>
     177    </EmbeddedResource>
    169178  </ItemGroup>
    170179  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
  • trunk/sources/HeuristicLab.Operators.Programmable/3.3/ProgrammableOperator.cs

    r3454 r3903  
    3838using HeuristicLab.PluginInfrastructure;
    3939using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     40using HeuristicLab.Persistence.Auxiliary;
    4041using HeuristicLab.Collections;
    4142
     
    4344
    4445  [Item("ProgrammableOperator", "An operator that can be programmed for arbitrary needs.")]
    45   [StorableClass] 
     46  [StorableClass]
    4647  public class ProgrammableOperator : Operator, IParameterizedNamedItem {
    4748
     
    7980    protected Dictionary<Assembly, bool> Assemblies;
    8081
    81     [Storable]
    82     private List<string> _persistedAssemblyNames {
     82    [Storable(Name="SelectedAssemblies")]
     83    private List<string> _selectedAssemblyNames_persistence {
    8384      get {
    84         return Assemblies.Keys.Select(a => a.FullName).ToList();
     85        return Assemblies.Where(a => a.Value).Select(a => a.Key.FullName).ToList();       
    8586      }
    8687      set {
     
    115116
    116117    public void SelectAssembly(Assembly a) {
    117       if (a != null && Assemblies.ContainsKey(a))
     118      if (a != null && Assemblies.ContainsKey(a) && !Assemblies[a]) {
    118119        Assemblies[a] = true;
     120      }
    119121    }
    120122
    121123    public void UnselectAssembly(Assembly a) {
    122       if (a != null && Assemblies.ContainsKey(a))
     124      if (a != null && Assemblies.ContainsKey(a) && Assemblies[a]) {
    123125        Assemblies[a] = false;
     126      }
    124127    }
    125128
    126129    public void SelectNamespace(string ns) {
    127130      namespaces.Add(ns);
     131      OnSignatureChanged();
    128132    }
    129133
    130134    public void UnselectNamespace(string ns) {
    131135      namespaces.Remove(ns);
     136      OnSignatureChanged();
    132137    }
    133138
     
    162167      executeMethod = null;
    163168      ProgrammableOperator.StaticInitialize();
    164       Assemblies = defaultAssemblyDict;
    165       Plugins = defaultPluginDict;
     169      Assemblies = defaultAssemblyDict.ToDictionary(kvp => kvp.Key, kvp => kvp.Value);
     170      Plugins = defaultPluginDict.ToDictionary(kvp => kvp.Key, kvp => kvp.Value.ToList());
    166171      namespaces = new HashSet<string>(DiscoverNamespaces());
    167172      RegisterEvents();
     
    170175    [StorableHook(HookType.AfterDeserialization)]
    171176    private void RegisterEvents() {
    172       Parameters.ItemsAdded += OnSignatureChanged;
    173       Parameters.ItemsRemoved += OnSignatureChanged;
    174       Parameters.ItemsReplaced += OnSignatureChanged;
    175       Parameters.CollectionReset += OnSignatureChanged;
    176     }
    177 
    178     protected void OnSignatureChanged(object sender, CollectionItemsChangedEventArgs<IParameter> args) {
    179       if (SignatureChanged != null)
    180         SignatureChanged(sender, EventArgs.Empty);
     177      Parameters.ItemsAdded += Parameters_Changed;
     178      Parameters.ItemsRemoved += Parameters_Changed;
     179      Parameters.ItemsReplaced += Parameters_Changed;
     180      Parameters.CollectionReset += Parameters_Changed;
     181    }
     182
     183    private void Parameters_Changed(object sender, CollectionItemsChangedEventArgs<IParameter> args) {
     184      OnSignatureChanged();
     185    }
     186
     187    protected void OnSignatureChanged() {
     188      EventHandler handler = SignatureChanged;
     189      if (handler != null)
     190        handler(this, EventArgs.Empty);
    181191    }
    182192
    183193    private static void StaticInitialize() {
    184194      lock (initLock) {
    185         if (defaultPluginDict != null || defaultAssemblyDict != null) return;
     195        if (defaultPluginDict != null && defaultAssemblyDict != null)
     196          return;
    186197        defaultAssemblyDict = DiscoverAssemblies();
    187198        defaultPluginDict = GroupAssemblies(defaultAssemblyDict.Keys);
     
    220231      typeof(HeuristicLab.Core.Item).Assembly,
    221232      typeof(HeuristicLab.Data.IntValue).Assembly,
     233      typeof(HeuristicLab.Parameters.ValueParameter<IItem>).Assembly,
     234      typeof(HeuristicLab.Collections.ObservableList<IItem>).Assembly,
     235      typeof(System.ComponentModel.INotifyPropertyChanged).Assembly,
     236
    222237    };
    223238
     
    248263    protected static List<string> DiscoverNamespaces() {
    249264      return new List<string>() {
     265        "HeuristicLab.Common",
     266        "HeuristicLab.Core",
     267        "HeuristicLab.Data",
     268        "HeuristicLab.Parameters",
    250269        "System",
    251270        "System.Collections.Generic",
     
    253272        "System.Linq",
    254273        "System.Data.Linq",
    255         "HeuristicLab.Common",
    256         "HeuristicLab.Core",
    257         "HeuristicLab.Data",
    258274      };
    259275    }
     
    356372      get {
    357373        var sb = new StringBuilder()
    358         .Append("public static IOperation Execute(IOperator op, IExecutionContext context");
     374        .Append("public static IOperation Execute(")
     375        .Append(TypeNameParser.Parse(typeof(IOperator).FullName).GetTypeNameInCode(namespaces))
     376        .Append(" op, ")
     377        .Append(TypeNameParser.Parse(typeof(IExecutionContext).FullName).GetTypeNameInCode(namespaces))
     378        .Append(" context");
    359379        foreach (IParameter param in Parameters) {
    360           sb.Append(String.Format(", {0} {1}", param.DataType.Name, param.Name));
     380          sb.Append(String.Format(", {0} {1}",
     381            TypeNameParser.Parse(param.GetType().FullName).GetTypeNameInCode(namespaces),
     382            param.Name));
    361383        }
    362384        return sb.Append(")").ToString();
     
    376398      method.Parameters.Add(new CodeParameterDeclarationExpression(typeof(IExecutionContext), "context"));
    377399      foreach (var param in Parameters)
    378         method.Parameters.Add(new CodeParameterDeclarationExpression(param.DataType, param.Name));
     400        method.Parameters.Add(new CodeParameterDeclarationExpression(param.GetType(), param.Name));
    379401      string[] codeLines = lineSplitter.Split(code);
    380402      for (int i = 0; i < codeLines.Length; i++) {
     
    399421
    400422      var parameters = new List<object>() { this, ExecutionContext };
    401       parameters.AddRange(Parameters.Select(p => (object)p.ActualValue));
     423      parameters.AddRange(Parameters.Select(p => (object)p));
    402424      return (IOperation)executeMethod.Invoke(null, parameters.ToArray());
    403425    }
  • trunk/sources/HeuristicLab.Operators.Programmable/3.3/ProgrammableOperatorView.Designer.cs

    r3764 r3903  
    4646    private void InitializeComponent() {
    4747      System.Windows.Forms.TabPage tabPage2;
     48      System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ProgrammableOperatorView));
    4849      this.splitContainer1 = new System.Windows.Forms.SplitContainer();
    4950      this.splitContainer2 = new System.Windows.Forms.SplitContainer();
     51      this.assembliesBox = new System.Windows.Forms.GroupBox();
    5052      this.assembliesTreeView = new System.Windows.Forms.TreeView();
     53      this.namespacesBox = new System.Windows.Forms.GroupBox();
    5154      this.namespacesTreeView = new System.Windows.Forms.TreeView();
    5255      this.showCodeButton = new System.Windows.Forms.Button();
     
    6568      this.splitContainer2.Panel2.SuspendLayout();
    6669      this.splitContainer2.SuspendLayout();
     70      this.assembliesBox.SuspendLayout();
     71      this.namespacesBox.SuspendLayout();
    6772      this.tabControl1.SuspendLayout();
    6873      this.tabPage1.SuspendLayout();
     
    106111      this.splitContainer1.Panel2.Controls.Add(this.codeEditor);
    107112      this.splitContainer1.Size = new System.Drawing.Size(971, 613);
    108       this.splitContainer1.SplitterDistance = 254;
     113      this.splitContainer1.SplitterDistance = 244;
    109114      this.splitContainer1.TabIndex = 0;
    110115      //
     
    114119                  | System.Windows.Forms.AnchorStyles.Left)
    115120                  | System.Windows.Forms.AnchorStyles.Right)));
    116       this.splitContainer2.Location = new System.Drawing.Point(3, 3);
     121      this.splitContainer2.Location = new System.Drawing.Point(0, 33);
    117122      this.splitContainer2.Name = "splitContainer2";
    118123      this.splitContainer2.Orientation = System.Windows.Forms.Orientation.Horizontal;
     
    120125      // splitContainer2.Panel1
    121126      //
    122       this.splitContainer2.Panel1.Controls.Add(this.assembliesTreeView);
     127      this.splitContainer2.Panel1.Controls.Add(this.assembliesBox);
    123128      //
    124129      // splitContainer2.Panel2
    125130      //
    126       this.splitContainer2.Panel2.Controls.Add(this.namespacesTreeView);
    127       this.splitContainer2.Size = new System.Drawing.Size(248, 578);
    128       this.splitContainer2.SplitterDistance = 289;
     131      this.splitContainer2.Panel2.Controls.Add(this.namespacesBox);
     132      this.splitContainer2.Size = new System.Drawing.Size(242, 583);
     133      this.splitContainer2.SplitterDistance = 290;
    129134      this.splitContainer2.TabIndex = 2;
     135      //
     136      // assembliesBox
     137      //
     138      this.assembliesBox.Controls.Add(this.assembliesTreeView);
     139      this.assembliesBox.Dock = System.Windows.Forms.DockStyle.Fill;
     140      this.assembliesBox.Location = new System.Drawing.Point(0, 0);
     141      this.assembliesBox.Name = "assembliesBox";
     142      this.assembliesBox.Size = new System.Drawing.Size(242, 290);
     143      this.assembliesBox.TabIndex = 1;
     144      this.assembliesBox.TabStop = false;
     145      this.assembliesBox.Text = "Assemblies";
    130146      //
    131147      // assembliesTreeView
     
    133149      this.assembliesTreeView.CheckBoxes = true;
    134150      this.assembliesTreeView.Dock = System.Windows.Forms.DockStyle.Fill;
    135       this.assembliesTreeView.Location = new System.Drawing.Point(0, 0);
     151      this.assembliesTreeView.Location = new System.Drawing.Point(3, 16);
    136152      this.assembliesTreeView.Name = "assembliesTreeView";
    137       this.assembliesTreeView.Size = new System.Drawing.Size(248, 289);
     153      this.assembliesTreeView.Size = new System.Drawing.Size(236, 271);
    138154      this.assembliesTreeView.TabIndex = 0;
    139155      this.assembliesTreeView.AfterCheck += new System.Windows.Forms.TreeViewEventHandler(this.assembliesTreeView_AfterCheck);
    140156      //
     157      // namespacesBox
     158      //
     159      this.namespacesBox.Controls.Add(this.namespacesTreeView);
     160      this.namespacesBox.Dock = System.Windows.Forms.DockStyle.Fill;
     161      this.namespacesBox.Location = new System.Drawing.Point(0, 0);
     162      this.namespacesBox.Name = "namespacesBox";
     163      this.namespacesBox.Size = new System.Drawing.Size(242, 289);
     164      this.namespacesBox.TabIndex = 1;
     165      this.namespacesBox.TabStop = false;
     166      this.namespacesBox.Text = "Namespaces";
     167      //
    141168      // namespacesTreeView
    142169      //
    143170      this.namespacesTreeView.CheckBoxes = true;
    144171      this.namespacesTreeView.Dock = System.Windows.Forms.DockStyle.Fill;
    145       this.namespacesTreeView.Location = new System.Drawing.Point(0, 0);
     172      this.namespacesTreeView.Location = new System.Drawing.Point(3, 16);
    146173      this.namespacesTreeView.Name = "namespacesTreeView";
    147174      this.namespacesTreeView.PathSeparator = ".";
    148       this.namespacesTreeView.Size = new System.Drawing.Size(248, 285);
     175      this.namespacesTreeView.Size = new System.Drawing.Size(236, 270);
    149176      this.namespacesTreeView.TabIndex = 0;
    150177      this.namespacesTreeView.AfterCheck += new System.Windows.Forms.TreeViewEventHandler(this.namespacesTreeView_AfterCheck);
     
    152179      // showCodeButton
    153180      //
    154       this.showCodeButton.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
    155                   | System.Windows.Forms.AnchorStyles.Right)));
    156       this.showCodeButton.Location = new System.Drawing.Point(65, 587);
     181      this.showCodeButton.Image = ((System.Drawing.Image)(resources.GetObject("showCodeButton.Image")));
     182      this.showCodeButton.Location = new System.Drawing.Point(33, 3);
    157183      this.showCodeButton.Name = "showCodeButton";
    158       this.showCodeButton.Size = new System.Drawing.Size(186, 23);
     184      this.showCodeButton.Size = new System.Drawing.Size(24, 24);
    159185      this.showCodeButton.TabIndex = 0;
    160       this.showCodeButton.Text = "&Show Generated Code ...";
     186      this.showCodeButton.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText;
     187      this.toolTip.SetToolTip(this.showCodeButton, "Show generated code");
    161188      this.showCodeButton.UseVisualStyleBackColor = false;
    162189      this.showCodeButton.Click += new System.EventHandler(this.showCodeButton_Click);
     
    164191      // compileButton
    165192      //
    166       this.compileButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
    167       this.compileButton.Location = new System.Drawing.Point(3, 587);
     193      this.compileButton.Image = ((System.Drawing.Image)(resources.GetObject("compileButton.Image")));
     194      this.compileButton.Location = new System.Drawing.Point(3, 3);
    168195      this.compileButton.Name = "compileButton";
    169       this.compileButton.Size = new System.Drawing.Size(56, 23);
     196      this.compileButton.Size = new System.Drawing.Size(24, 24);
    170197      this.compileButton.TabIndex = 1;
    171       this.compileButton.Text = "&Compile";
     198      this.compileButton.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText;
     199      this.toolTip.SetToolTip(this.compileButton, "Compile");
    172200      this.compileButton.UseVisualStyleBackColor = true;
    173201      this.compileButton.Click += new System.EventHandler(this.compileButton_Click);
     
    179207      this.codeEditor.Name = "codeEditor";
    180208      this.codeEditor.Prefix = "";
    181       this.codeEditor.Size = new System.Drawing.Size(713, 613);
     209      this.codeEditor.Size = new System.Drawing.Size(723, 613);
    182210      this.codeEditor.Suffix = "";
    183211      this.codeEditor.TabIndex = 0;
     
    209237      this.tabPage1.UseVisualStyleBackColor = true;
    210238      //
    211       // parameterCollectionView1
    212       //
     239      // parameterCollectionView
     240      //
     241      this.parameterCollectionView.Caption = "ParameterCollection View";
    213242      this.parameterCollectionView.Content = null;
    214243      this.parameterCollectionView.Dock = System.Windows.Forms.DockStyle.Fill;
    215244      this.parameterCollectionView.Location = new System.Drawing.Point(3, 3);
    216       this.parameterCollectionView.Name = "parameterCollectionView1";
     245      this.parameterCollectionView.Name = "parameterCollectionView";
     246      this.parameterCollectionView.ReadOnly = false;
    217247      this.parameterCollectionView.Size = new System.Drawing.Size(971, 613);
    218248      this.parameterCollectionView.TabIndex = 0;
     
    238268      this.splitContainer2.Panel2.ResumeLayout(false);
    239269      this.splitContainer2.ResumeLayout(false);
     270      this.assembliesBox.ResumeLayout(false);
     271      this.namespacesBox.ResumeLayout(false);
    240272      this.tabControl1.ResumeLayout(false);
    241273      this.tabPage1.ResumeLayout(false);
     
    256288    private System.Windows.Forms.SplitContainer splitContainer2;
    257289    private System.Windows.Forms.TreeView assembliesTreeView;
    258     private System.Windows.Forms.TreeView namespacesTreeView;   
     290    private System.Windows.Forms.TreeView namespacesTreeView;
     291    private System.Windows.Forms.GroupBox assembliesBox;
     292    private System.Windows.Forms.GroupBox namespacesBox;
    259293  }
    260294}
  • trunk/sources/HeuristicLab.Operators.Programmable/3.3/ProgrammableOperatorView.cs

    r3758 r3903  
    3838using HeuristicLab.MainForm;
    3939using HeuristicLab.PluginInfrastructure;
     40using HeuristicLab.Common.Resources;
    4041
    4142namespace HeuristicLab.Operators.Programmable {
     
    5152    public ProgrammableOperatorView() {
    5253      InitializeComponent();
    53     }
    54 
    55     public ProgrammableOperatorView(ProgrammableOperator programmableOperator)
    56       : this() {
    57       ProgrammableOperator = programmableOperator;
     54      namespacesTreeView.ImageList = new ImageList();
     55      namespacesTreeView.ImageList.Images.Add(VS2008ImageLibrary.Namespace);
     56      assembliesTreeView.ImageList = new ImageList();
     57      assembliesTreeView.ImageList.Images.Add(VS2008ImageLibrary.Assembly);
     58      assembliesTreeView.ImageList.Images.Add(VS2008ImageLibrary.Module);
    5859    }
    5960
     
    7879      } else {
    7980        codeEditor.Prefix = GetGeneratedPrefix();
    80         codeEditor.Suffix = @"
    81     return null;
     81        codeEditor.Suffix = @"    return null;
    8282  }
    8383}";
    8484        codeEditor.UserCode = ProgrammableOperator.Code;
    8585        if (codeEditor.UserCode == "")
    86           codeEditor.UserCode = "\n\n\n";
     86          codeEditor.UserCode = "    \n    \n    \n    \n";
    8787        InitializeAssemblyList();
    8888        InitializeNamespacesList();
     
    9292        codeEditor.ScrollAfterPrefix();
    9393        codeEditor.ShowCompileErrors(ProgrammableOperator.CompileErrors, "ProgrammableOperator");
    94         showCodeButton.Enabled = 
    95           ProgrammableOperator.CompilationUnitCode != null && 
     94        showCodeButton.Enabled =
     95          ProgrammableOperator.CompilationUnitCode != null &&
    9696          ProgrammableOperator.CompilationUnitCode.Length > 0;
    9797        parameterCollectionView.Content = ProgrammableOperator.Parameters;
     
    186186        var node = assembliesTreeView.Nodes.Add(p.Key);
    187187        node.Tag = p;
     188        node.ImageIndex = 1;
    188189        foreach (var a in p.Value) {
    189190          var aNode = node.Nodes.Add(a.GetName().Name);
    190191          aNode.Tag = a;
     192          aNode.ImageIndex = 0;
    191193          if (selectedAssemblies.Contains(a))
    192194            aNode.Checked = true;
     
    194196        if (node.Nodes.Count == 1 && node.Nodes[0].Name == node.Nodes[0].Name) {
    195197          node.Tag = node.Nodes[0].Tag;
     198          node.ImageIndex = node.Nodes[0].ImageIndex;
     199          node.Checked = node.Nodes[0].Checked;
    196200          node.Nodes.Clear();
    197201        } else if (node.Nodes.Count > 0 && node.Nodes.Cast<TreeNode>().All(n => n.Checked)) {
     
    199203        }
    200204      }
     205      assembliesTreeView.Sort();
    201206      assembliesTreeView.EndUpdate();
    202207      assembliesTreeView.Enabled = true;
     
    216221        AddNamespace(namespacesTreeView.Nodes, ns, selectedNamespaces.Contains(ns), oldTree);
    217222      codeEditor.Prefix = GetGeneratedPrefix();
     223      namespacesTreeView.Sort();
    218224      namespacesTreeView.EndUpdate();
    219225      namespacesTreeView.Enabled = true;
     
    225231        TreeNode newNode = root.Nodes.Add(n.Text, n.Text);
    226232        newNode.Checked = n.Checked;
     233        newNode.ImageIndex = n.ImageIndex;
    227234        CloneTreeNodeCollection(newNode, n.Nodes);
    228235        if (n.IsExpanded)
     
    246253      if (isNew || oldNode != null && oldNode.IsExpanded)
    247254        node.Expand();
    248       if (isNew)
     255      if (isNew) {
    249256        namespacesTreeView.SelectedNode = node;
     257        node.ImageIndex = 0;
     258      } else {
     259        node.ImageIndex = oldNode.ImageIndex;
     260      }
    250261      return isNew;
    251262    }
  • trunk/sources/HeuristicLab.Operators.Programmable/3.3/ProgrammableOperatorView.resx

    r3008 r3903  
    121121    <value>107, 17</value>
    122122  </metadata>
    123   <metadata name="errorProvider.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
    124     <value>107, 17</value>
    125   </metadata>
    126123  <metadata name="toolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
    127124    <value>17, 17</value>
     
    130127    <value>False</value>
    131128  </metadata>
     129  <assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
     130  <data name="showCodeButton.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
     131    <value>
     132        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
     133        YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAlwSFlzAAALEQAA
     134        CxEBf2RfkQAAAfZJREFUOE+l099Lk1EYwPH6D/onoqsuoqwIbyIoEy2k5ZzphU1cxCQoVOhmN1qBmq2h
     135        W1Kr1SJNeot3/XBWLjetBUUFi2lQQqibLLUonG5z33beWOz13UsXHXguzsN5Pufh4ZyNwIb/WgKQg5Os
     136        D2k0wqD/HV7faxGd4lyxUJKiWG9dHXrBzvJGXUQB7gc+6gK9Xj8jE5E80rW+CwUYevpBF3DcfKIU56Mo
     137        cOfxGw2QTi0zNjGG87qH9m47F+y9lFaaxTnVLJTNLTmsAlZWlpGHh3kWHCeW+MbXeAKvJGO2tlBvPbup
     138        EFEAtxRSAYHxEP5AUMmlM/AzucbcYgaH+y6mBst5DdA/OKoC+tweZucTf4vj39NMzabwhSapqav7rAH6
     139        bo+ogB5nPzPzC8rN8aVMrniV8FSSK/fCHKmu1gJi0oVLkn3I/gCxpdzNcylefUry6O0vmtts1NTWOu0d
     140        Le35LpQZFALZbJYv09N09ji4NvCQB6EoLilMc6sNo+koA5fqkV2nsnlEA6ymMiz+SBKJRrnsdGI5aeV4
     141        YxPHjFU4zuwjduMAay8b8Fw8LZBDKkB0ohcd57o4UbmD97YSZlx7WfAZabUc/vMoRFHJQfM/Y3+5AUvF
     142        dp637aapbCumil1VRX+Y3s8T+VwXhtJtWyjbs9kg9r8B4LDiPoc3Lh8AAAAASUVORK5CYII=
     143</value>
     144  </data>
     145  <data name="compileButton.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
     146    <value>
     147        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
     148        YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAlwSFlzAAALEQAA
     149        CxEBf2RfkQAAArxJREFUOE+FU1lPE1EYnab/wQdffCGRqA8mtCyJEH1hk0RJAHlAoSyKqEQTKCBEHoSI
     150        GCG0EDAgMrTBKBYEZRPBhT5oonGhBiurhLK12Hagre10erx3Wi2giTc5me/emXPu+c69IwHAbB99E0ZI
     151        IWUYiZcRGAkjJRAkbga8lOF5N+P2eBlZ6B4mNGSfRORRge3of22EAB9ZEiA+6CAlrQV40dY9DnliHqam
     152        F+ibvwV6X34WP/ZzKTNQkwUvqdXaYYzpDX9ExN0XZ7/gha4co10lGGy/DF1zPjR1OSjOPQxlriwoKPig
     153        7hyCPEGB8KRcyI9n++3fKAwHz+kgbPUS9MGzcR/lihDoNSn41J+JMwl74fP5PfFev4iqcxThiTl+gUet
     154        l8Bv9QC2bvw034VrqRlNSjkmtMmoLoxE5YWogAt/S5suDxEYIU4CDtj60+jtKCHEJjhmasEZKrCsL0BL
     155        aTQczh+BLHjRhcPpwbrVsVOAuqhXxoAzVsP2/grM+nNYHU9H49VoDLJFIpE24PYAGzYXFpftOwVoiM8f
     156        XIPZUIO1V5kwE6yOnMBifxLYqhi031KAFzzgnG6smLfwbcESFHjYlIXWqpNQV8Ti3s1TYGvT0F6ThjvX
     157        U9BWnYGvuji0VUbDxXthsToxZ7LCMG0OnAbJ4HbREcxPdWFzZQicqQf25ccEPVif06KxNBaTmmNQlUXB
     158        yvEwrXGYmrfgnWEFKvapP0Rqv67sKIqzI1CQGoqLqQeRn3oA+cn7UZwRhvPph+ByubFqcWBmyY6PxnXo
     159        P5iCDnZfZXrGv4fb4yPBeWGzO8XgDLMWvJk0Yeztd6g0Q5DFK3b+B1RMzY6SxAUxJIqWjgE0aJ+IltVk
     160        ru4cgEr7DA3scPAibXdBSbL4LLG/CHJlZQlnIUvMFud0x0iCsPg8QiaI+4eD3S39b/4Lh5zpNk44eGEA
     161        AAAASUVORK5CYII=
     162</value>
     163  </data>
    132164</root>
  • trunk/sources/HeuristicLab.Persistence/3.3/Auxiliary/TypeName.cs

    r3743 r3903  
    2121
    2222using System;
     23using System.Linq;
    2324using System.Text;
    2425using System.Text.RegularExpressions;
     
    157158          foreach (var property in AssemblyAttribues)
    158159            sb.Append(", ").Append(property.Key).Append('=').Append(property.Value);
     160      }
     161      return sb.ToString();
     162    }
     163
     164    public string GetTypeNameInCode(HashSet<string> omitNamespaces) {
     165      StringBuilder sb = new StringBuilder();
     166      if (!string.IsNullOrEmpty(Namespace) && omitNamespaces == null || !omitNamespaces.Contains(Namespace))
     167        sb.Append(Namespace).Append('.');
     168      sb.Append(ClassName);
     169      if (IsGeneric) {
     170        sb.Append("<");
     171        sb.Append(
     172          string.Join(", ",
     173            GenericArgs
     174              .Select(a => a.GetTypeNameInCode(omitNamespaces))
     175              .ToArray()));
     176        sb.Append(">");
    159177      }
    160178      return sb.ToString();
Note: See TracChangeset for help on using the changeset viewer.