Changeset 7669 for branches/HeuristicLab.Hive.Azure/HeuristicLab.Core/3.3
- Timestamp:
- 03/28/12 15:47:26 (13 years ago)
- Location:
- branches/HeuristicLab.Hive.Azure
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Hive.Azure
- Property svn:ignore
-
old new 3 3 *.resharper 4 4 *.suo 5 *.user 5 6 *.vsp 6 7 Doxygen 8 FxCopResults.txt 7 9 Google.ProtocolBuffers-0.9.1.dll 8 10 HeuristicLab 3.3.5.1.ReSharper.user
-
- Property svn:mergeinfo changed
- Property svn:ignore
-
branches/HeuristicLab.Hive.Azure/HeuristicLab.Core/3.3/ParameterizedNamedItem.cs
r7270 r7669 20 20 #endregion 21 21 22 using System; 22 23 using System.Collections.Generic; 23 24 using System.Linq; … … 84 85 public virtual void CollectParameterValues(IDictionary<string, IItem> values) { 85 86 foreach (IValueParameter param in parameters.OfType<IValueParameter>()) { 86 if (param.GetsCollected && param.Value != null) values.Add(param.Name, param.Value); 87 if (param.Value is IParameterizedItem) { 88 Dictionary<string, IItem> children = new Dictionary<string, IItem>(); 89 ((IParameterizedItem)param.Value).CollectParameterValues(children); 90 foreach (string key in children.Keys) 91 values.Add(param.Name + "." + key, children[key]); 87 if (param.GetsCollected) { 88 var children = GetCollectedValues(param.Value); 89 foreach (var c in children) { 90 if (String.IsNullOrEmpty(c.Key)) 91 values.Add(param.Name, c.Value); 92 else values.Add(param.Name + "." + c.Key, c.Value); 93 } 92 94 } 95 } 96 } 97 98 protected virtual IEnumerable<KeyValuePair<string, IItem>> GetCollectedValues(IItem value) { 99 if (value == null) yield break; 100 yield return new KeyValuePair<string, IItem>(String.Empty, value); 101 var parameterizedItem = value as IParameterizedItem; 102 if (parameterizedItem != null) { 103 var children = new Dictionary<string, IItem>(); 104 parameterizedItem.CollectParameterValues(children); 105 foreach (var child in children) yield return child; 93 106 } 94 107 }
Note: See TracChangeset
for help on using the changeset viewer.