Changeset 3903 for trunk/sources
- Timestamp:
- 06/08/10 16:26:35 (14 years ago)
- 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 95 95 </Compile> 96 96 <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> 97 102 </ItemGroup> 98 103 <ItemGroup> … … 167 172 <SubType>Designer</SubType> 168 173 </EmbeddedResource> 174 <EmbeddedResource Include="Properties\Resources.resx"> 175 <Generator>ResXFileCodeGenerator</Generator> 176 <LastGenOutput>Resources.Designer.cs</LastGenOutput> 177 </EmbeddedResource> 169 178 </ItemGroup> 170 179 <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> -
trunk/sources/HeuristicLab.Operators.Programmable/3.3/ProgrammableOperator.cs
r3454 r3903 38 38 using HeuristicLab.PluginInfrastructure; 39 39 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 40 using HeuristicLab.Persistence.Auxiliary; 40 41 using HeuristicLab.Collections; 41 42 … … 43 44 44 45 [Item("ProgrammableOperator", "An operator that can be programmed for arbitrary needs.")] 45 [StorableClass] 46 [StorableClass] 46 47 public class ProgrammableOperator : Operator, IParameterizedNamedItem { 47 48 … … 79 80 protected Dictionary<Assembly, bool> Assemblies; 80 81 81 [Storable ]82 private List<string> _ persistedAssemblyNames{82 [Storable(Name="SelectedAssemblies")] 83 private List<string> _selectedAssemblyNames_persistence { 83 84 get { 84 return Assemblies. Keys.Select(a => a.FullName).ToList();85 return Assemblies.Where(a => a.Value).Select(a => a.Key.FullName).ToList(); 85 86 } 86 87 set { … … 115 116 116 117 public void SelectAssembly(Assembly a) { 117 if (a != null && Assemblies.ContainsKey(a) )118 if (a != null && Assemblies.ContainsKey(a) && !Assemblies[a]) { 118 119 Assemblies[a] = true; 120 } 119 121 } 120 122 121 123 public void UnselectAssembly(Assembly a) { 122 if (a != null && Assemblies.ContainsKey(a) )124 if (a != null && Assemblies.ContainsKey(a) && Assemblies[a]) { 123 125 Assemblies[a] = false; 126 } 124 127 } 125 128 126 129 public void SelectNamespace(string ns) { 127 130 namespaces.Add(ns); 131 OnSignatureChanged(); 128 132 } 129 133 130 134 public void UnselectNamespace(string ns) { 131 135 namespaces.Remove(ns); 136 OnSignatureChanged(); 132 137 } 133 138 … … 162 167 executeMethod = null; 163 168 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()); 166 171 namespaces = new HashSet<string>(DiscoverNamespaces()); 167 172 RegisterEvents(); … … 170 175 [StorableHook(HookType.AfterDeserialization)] 171 176 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); 181 191 } 182 192 183 193 private static void StaticInitialize() { 184 194 lock (initLock) { 185 if (defaultPluginDict != null || defaultAssemblyDict != null) return; 195 if (defaultPluginDict != null && defaultAssemblyDict != null) 196 return; 186 197 defaultAssemblyDict = DiscoverAssemblies(); 187 198 defaultPluginDict = GroupAssemblies(defaultAssemblyDict.Keys); … … 220 231 typeof(HeuristicLab.Core.Item).Assembly, 221 232 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 222 237 }; 223 238 … … 248 263 protected static List<string> DiscoverNamespaces() { 249 264 return new List<string>() { 265 "HeuristicLab.Common", 266 "HeuristicLab.Core", 267 "HeuristicLab.Data", 268 "HeuristicLab.Parameters", 250 269 "System", 251 270 "System.Collections.Generic", … … 253 272 "System.Linq", 254 273 "System.Data.Linq", 255 "HeuristicLab.Common",256 "HeuristicLab.Core",257 "HeuristicLab.Data",258 274 }; 259 275 } … … 356 372 get { 357 373 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"); 359 379 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)); 361 383 } 362 384 return sb.Append(")").ToString(); … … 376 398 method.Parameters.Add(new CodeParameterDeclarationExpression(typeof(IExecutionContext), "context")); 377 399 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)); 379 401 string[] codeLines = lineSplitter.Split(code); 380 402 for (int i = 0; i < codeLines.Length; i++) { … … 399 421 400 422 var parameters = new List<object>() { this, ExecutionContext }; 401 parameters.AddRange(Parameters.Select(p => (object)p .ActualValue));423 parameters.AddRange(Parameters.Select(p => (object)p)); 402 424 return (IOperation)executeMethod.Invoke(null, parameters.ToArray()); 403 425 } -
trunk/sources/HeuristicLab.Operators.Programmable/3.3/ProgrammableOperatorView.Designer.cs
r3764 r3903 46 46 private void InitializeComponent() { 47 47 System.Windows.Forms.TabPage tabPage2; 48 System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ProgrammableOperatorView)); 48 49 this.splitContainer1 = new System.Windows.Forms.SplitContainer(); 49 50 this.splitContainer2 = new System.Windows.Forms.SplitContainer(); 51 this.assembliesBox = new System.Windows.Forms.GroupBox(); 50 52 this.assembliesTreeView = new System.Windows.Forms.TreeView(); 53 this.namespacesBox = new System.Windows.Forms.GroupBox(); 51 54 this.namespacesTreeView = new System.Windows.Forms.TreeView(); 52 55 this.showCodeButton = new System.Windows.Forms.Button(); … … 65 68 this.splitContainer2.Panel2.SuspendLayout(); 66 69 this.splitContainer2.SuspendLayout(); 70 this.assembliesBox.SuspendLayout(); 71 this.namespacesBox.SuspendLayout(); 67 72 this.tabControl1.SuspendLayout(); 68 73 this.tabPage1.SuspendLayout(); … … 106 111 this.splitContainer1.Panel2.Controls.Add(this.codeEditor); 107 112 this.splitContainer1.Size = new System.Drawing.Size(971, 613); 108 this.splitContainer1.SplitterDistance = 2 54;113 this.splitContainer1.SplitterDistance = 244; 109 114 this.splitContainer1.TabIndex = 0; 110 115 // … … 114 119 | System.Windows.Forms.AnchorStyles.Left) 115 120 | 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); 117 122 this.splitContainer2.Name = "splitContainer2"; 118 123 this.splitContainer2.Orientation = System.Windows.Forms.Orientation.Horizontal; … … 120 125 // splitContainer2.Panel1 121 126 // 122 this.splitContainer2.Panel1.Controls.Add(this.assemblies TreeView);127 this.splitContainer2.Panel1.Controls.Add(this.assembliesBox); 123 128 // 124 129 // splitContainer2.Panel2 125 130 // 126 this.splitContainer2.Panel2.Controls.Add(this.namespaces TreeView);127 this.splitContainer2.Size = new System.Drawing.Size(24 8, 578);128 this.splitContainer2.SplitterDistance = 2 89;131 this.splitContainer2.Panel2.Controls.Add(this.namespacesBox); 132 this.splitContainer2.Size = new System.Drawing.Size(242, 583); 133 this.splitContainer2.SplitterDistance = 290; 129 134 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"; 130 146 // 131 147 // assembliesTreeView … … 133 149 this.assembliesTreeView.CheckBoxes = true; 134 150 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); 136 152 this.assembliesTreeView.Name = "assembliesTreeView"; 137 this.assembliesTreeView.Size = new System.Drawing.Size(2 48, 289);153 this.assembliesTreeView.Size = new System.Drawing.Size(236, 271); 138 154 this.assembliesTreeView.TabIndex = 0; 139 155 this.assembliesTreeView.AfterCheck += new System.Windows.Forms.TreeViewEventHandler(this.assembliesTreeView_AfterCheck); 140 156 // 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 // 141 168 // namespacesTreeView 142 169 // 143 170 this.namespacesTreeView.CheckBoxes = true; 144 171 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); 146 173 this.namespacesTreeView.Name = "namespacesTreeView"; 147 174 this.namespacesTreeView.PathSeparator = "."; 148 this.namespacesTreeView.Size = new System.Drawing.Size(2 48, 285);175 this.namespacesTreeView.Size = new System.Drawing.Size(236, 270); 149 176 this.namespacesTreeView.TabIndex = 0; 150 177 this.namespacesTreeView.AfterCheck += new System.Windows.Forms.TreeViewEventHandler(this.namespacesTreeView_AfterCheck); … … 152 179 // showCodeButton 153 180 // 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); 157 183 this.showCodeButton.Name = "showCodeButton"; 158 this.showCodeButton.Size = new System.Drawing.Size( 186, 23);184 this.showCodeButton.Size = new System.Drawing.Size(24, 24); 159 185 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"); 161 188 this.showCodeButton.UseVisualStyleBackColor = false; 162 189 this.showCodeButton.Click += new System.EventHandler(this.showCodeButton_Click); … … 164 191 // compileButton 165 192 // 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); 168 195 this.compileButton.Name = "compileButton"; 169 this.compileButton.Size = new System.Drawing.Size( 56, 23);196 this.compileButton.Size = new System.Drawing.Size(24, 24); 170 197 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"); 172 200 this.compileButton.UseVisualStyleBackColor = true; 173 201 this.compileButton.Click += new System.EventHandler(this.compileButton_Click); … … 179 207 this.codeEditor.Name = "codeEditor"; 180 208 this.codeEditor.Prefix = ""; 181 this.codeEditor.Size = new System.Drawing.Size(7 13, 613);209 this.codeEditor.Size = new System.Drawing.Size(723, 613); 182 210 this.codeEditor.Suffix = ""; 183 211 this.codeEditor.TabIndex = 0; … … 209 237 this.tabPage1.UseVisualStyleBackColor = true; 210 238 // 211 // parameterCollectionView1 212 // 239 // parameterCollectionView 240 // 241 this.parameterCollectionView.Caption = "ParameterCollection View"; 213 242 this.parameterCollectionView.Content = null; 214 243 this.parameterCollectionView.Dock = System.Windows.Forms.DockStyle.Fill; 215 244 this.parameterCollectionView.Location = new System.Drawing.Point(3, 3); 216 this.parameterCollectionView.Name = "parameterCollectionView1"; 245 this.parameterCollectionView.Name = "parameterCollectionView"; 246 this.parameterCollectionView.ReadOnly = false; 217 247 this.parameterCollectionView.Size = new System.Drawing.Size(971, 613); 218 248 this.parameterCollectionView.TabIndex = 0; … … 238 268 this.splitContainer2.Panel2.ResumeLayout(false); 239 269 this.splitContainer2.ResumeLayout(false); 270 this.assembliesBox.ResumeLayout(false); 271 this.namespacesBox.ResumeLayout(false); 240 272 this.tabControl1.ResumeLayout(false); 241 273 this.tabPage1.ResumeLayout(false); … … 256 288 private System.Windows.Forms.SplitContainer splitContainer2; 257 289 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; 259 293 } 260 294 } -
trunk/sources/HeuristicLab.Operators.Programmable/3.3/ProgrammableOperatorView.cs
r3758 r3903 38 38 using HeuristicLab.MainForm; 39 39 using HeuristicLab.PluginInfrastructure; 40 using HeuristicLab.Common.Resources; 40 41 41 42 namespace HeuristicLab.Operators.Programmable { … … 51 52 public ProgrammableOperatorView() { 52 53 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); 58 59 } 59 60 … … 78 79 } else { 79 80 codeEditor.Prefix = GetGeneratedPrefix(); 80 codeEditor.Suffix = @" 81 return null; 81 codeEditor.Suffix = @" return null; 82 82 } 83 83 }"; 84 84 codeEditor.UserCode = ProgrammableOperator.Code; 85 85 if (codeEditor.UserCode == "") 86 codeEditor.UserCode = " \n\n\n";86 codeEditor.UserCode = " \n \n \n \n"; 87 87 InitializeAssemblyList(); 88 88 InitializeNamespacesList(); … … 92 92 codeEditor.ScrollAfterPrefix(); 93 93 codeEditor.ShowCompileErrors(ProgrammableOperator.CompileErrors, "ProgrammableOperator"); 94 showCodeButton.Enabled = 95 ProgrammableOperator.CompilationUnitCode != null && 94 showCodeButton.Enabled = 95 ProgrammableOperator.CompilationUnitCode != null && 96 96 ProgrammableOperator.CompilationUnitCode.Length > 0; 97 97 parameterCollectionView.Content = ProgrammableOperator.Parameters; … … 186 186 var node = assembliesTreeView.Nodes.Add(p.Key); 187 187 node.Tag = p; 188 node.ImageIndex = 1; 188 189 foreach (var a in p.Value) { 189 190 var aNode = node.Nodes.Add(a.GetName().Name); 190 191 aNode.Tag = a; 192 aNode.ImageIndex = 0; 191 193 if (selectedAssemblies.Contains(a)) 192 194 aNode.Checked = true; … … 194 196 if (node.Nodes.Count == 1 && node.Nodes[0].Name == node.Nodes[0].Name) { 195 197 node.Tag = node.Nodes[0].Tag; 198 node.ImageIndex = node.Nodes[0].ImageIndex; 199 node.Checked = node.Nodes[0].Checked; 196 200 node.Nodes.Clear(); 197 201 } else if (node.Nodes.Count > 0 && node.Nodes.Cast<TreeNode>().All(n => n.Checked)) { … … 199 203 } 200 204 } 205 assembliesTreeView.Sort(); 201 206 assembliesTreeView.EndUpdate(); 202 207 assembliesTreeView.Enabled = true; … … 216 221 AddNamespace(namespacesTreeView.Nodes, ns, selectedNamespaces.Contains(ns), oldTree); 217 222 codeEditor.Prefix = GetGeneratedPrefix(); 223 namespacesTreeView.Sort(); 218 224 namespacesTreeView.EndUpdate(); 219 225 namespacesTreeView.Enabled = true; … … 225 231 TreeNode newNode = root.Nodes.Add(n.Text, n.Text); 226 232 newNode.Checked = n.Checked; 233 newNode.ImageIndex = n.ImageIndex; 227 234 CloneTreeNodeCollection(newNode, n.Nodes); 228 235 if (n.IsExpanded) … … 246 253 if (isNew || oldNode != null && oldNode.IsExpanded) 247 254 node.Expand(); 248 if (isNew) 255 if (isNew) { 249 256 namespacesTreeView.SelectedNode = node; 257 node.ImageIndex = 0; 258 } else { 259 node.ImageIndex = oldNode.ImageIndex; 260 } 250 261 return isNew; 251 262 } -
trunk/sources/HeuristicLab.Operators.Programmable/3.3/ProgrammableOperatorView.resx
r3008 r3903 121 121 <value>107, 17</value> 122 122 </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>126 123 <metadata name="toolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> 127 124 <value>17, 17</value> … … 130 127 <value>False</value> 131 128 </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> 132 164 </root> -
trunk/sources/HeuristicLab.Persistence/3.3/Auxiliary/TypeName.cs
r3743 r3903 21 21 22 22 using System; 23 using System.Linq; 23 24 using System.Text; 24 25 using System.Text.RegularExpressions; … … 157 158 foreach (var property in AssemblyAttribues) 158 159 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(">"); 159 177 } 160 178 return sb.ToString();
Note: See TracChangeset
for help on using the changeset viewer.