Changeset 14927 for branches/PersistenceReintegration/HeuristicLab.Persistence/3.3/Auxiliary/TypeName.cs
- Timestamp:
- 05/04/17 17:19:35 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/PersistenceReintegration/HeuristicLab.Persistence/3.3/Auxiliary/TypeName.cs
r14185 r14927 24 24 using System.Linq; 25 25 using System.Text; 26 using HeuristicLab.Persistence .Default.CompositeSerializers.Storable;26 using HeuristicLab.Persistence; 27 27 28 28 namespace HeuristicLab.Persistence.Auxiliary { … … 33 33 /// attributes. 34 34 /// </summary> 35 [Storable Class]35 [StorableType("a83d8580-07c2-4805-a31f-23b702689e0c")] 36 36 public class TypeName { 37 37 … … 57 57 public List<int> GenericArgCounts { get; private set; } 58 58 59 59 /// <summary> 60 60 /// Gets or sets the generic args. 61 61 /// </summary> … … 110 110 /// <param name="nameSpace">The namespace.</param> 111 111 /// <param name="className">Name of the class.</param> 112 internal TypeName(string nameSpace, string className, List<int> genericArgCounts =null) {112 internal TypeName(string nameSpace, string className, List<int> genericArgCounts = null) { 113 113 Namespace = nameSpace; 114 114 ClassName = className; … … 187 187 private IEnumerable<string> GetNestedClassesInCode(HashSet<string> omitNamespaces, bool includeAllNamespaces) { 188 188 var i = 0; 189 foreach (var pair in ClassName.Split('+').Zip(GenericArgCounts, (n, c) => new { n, c})) {189 foreach (var pair in ClassName.Split('+').Zip(GenericArgCounts, (n, c) => new { n, c })) { 190 190 if (pair.c == 0) { 191 191 yield return pair.n; 192 } 193 else { 192 } else { 194 193 yield return string.Format("{0}<{1}>", 195 194 pair.n, … … 208 207 (omitNamespaces == null && includeNamespaces) || 209 208 omitNamespaces != null && !omitNamespaces.Contains(Namespace)) 210 209 sb.Append(Namespace).Append('.'); 211 210 if (GenericArgCounts != null) { 212 211 sb.Append(string.Join(".", GetNestedClassesInCode(omitNamespaces, includeNamespaces))); … … 273 272 } 274 273 return false; 275 } 276 catch (KeyNotFoundException) { 274 } catch (KeyNotFoundException) { 277 275 throw new Exception("Could not extract version information from type string"); 278 276 } … … 311 309 } 312 310 return true; 313 } 314 catch (KeyNotFoundException) { 311 } catch (KeyNotFoundException) { 315 312 throw new Exception("Could not extract version infomration from type string"); 316 313 }
Note: See TracChangeset
for help on using the changeset viewer.