Changeset 4068 for trunk/sources/HeuristicLab.Persistence/3.3/Auxiliary
- Timestamp:
- 07/22/10 00:44:01 (14 years ago)
- Location:
- trunk/sources/HeuristicLab.Persistence/3.3/Auxiliary
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Persistence/3.3/Auxiliary/ReflectionTools.cs
r3743 r4068 21 21 22 22 using System; 23 using System.Collections.Generic;24 using System.Linq;25 using System.Text;26 23 using System.Reflection; 27 24 -
trunk/sources/HeuristicLab.Persistence/3.3/Auxiliary/StringExtensions.cs
r3937 r4068 1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Text; 5 using System.Text.RegularExpressions; 1 using System.Collections.Generic; 6 2 7 3 namespace HeuristicLab.Persistence.Auxiliary { … … 24 20 yield return s.Substring(startIdx, i - startIdx); 25 21 } 26 startIdx = i +1;22 startIdx = i + 1; 27 23 } 28 24 } -
trunk/sources/HeuristicLab.Persistence/3.3/Auxiliary/TypeExtensions.cs
r3743 r4068 21 21 22 22 using System; 23 using System.Text;24 23 25 24 namespace HeuristicLab.Persistence.Auxiliary { -
trunk/sources/HeuristicLab.Persistence/3.3/Auxiliary/TypeLoader.cs
r3743 r4068 20 20 #endregion 21 21 22 using System.Collections.Generic;23 22 using System; 24 using HeuristicLab.Persistence.Interfaces;25 using HeuristicLab.Persistence.Core.Tokens;26 using HeuristicLab.Persistence.Auxiliary;27 using HeuristicLab.Tracing;28 23 using System.Reflection; 29 24 using HeuristicLab.Persistence.Core; 25 using HeuristicLab.Tracing; 30 26 31 27 namespace HeuristicLab.Persistence.Auxiliary { … … 37 33 try { 38 34 type = Type.GetType(typeNameString, true); 39 } catch (Exception) { 35 } 36 catch (Exception) { 40 37 Logger.Warn(String.Format( 41 38 "Cannot load type \"{0}\", falling back to partial name", typeNameString)); 42 39 try { 43 TypeName typeName = TypeNameParser.Parse(typeNameString); 40 TypeName typeName = TypeNameParser.Parse(typeNameString); 44 41 #pragma warning disable 0618 45 Assembly a = Assembly.LoadWithPartialName(typeName.AssemblyName); 42 Assembly a = Assembly.LoadWithPartialName(typeName.AssemblyName); 46 43 // the suggested Assembly.Load() method fails to load assemblies outside the GAC 47 44 #pragma warning restore 0618 48 45 type = a.GetType(typeName.ToString(false, false), true); 49 } catch (Exception) { 46 } 47 catch (Exception) { 50 48 throw new PersistenceException(String.Format( 51 49 "Could not load type \"{0}\"", … … 65 63 typeNameString, 66 64 type.AssemblyQualifiedName)); 67 } catch (PersistenceException) { 65 } 66 catch (PersistenceException) { 68 67 throw; 69 } catch (Exception e) { 68 } 69 catch (Exception e) { 70 70 Logger.Warn(String.Format( 71 71 "Could not perform version check requested type was {0} while loaded type is {1}:", -
trunk/sources/HeuristicLab.Persistence/3.3/Auxiliary/TypeName.cs
r3935 r4068 21 21 22 22 using System; 23 using System.Collections.Generic; 23 24 using System.Linq; 24 25 using System.Text; 25 using System.Text.RegularExpressions;26 using System.Reflection.Emit;27 using System.Collections.Generic;28 26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 29 27 … … 135 133 /// A <see cref="System.String"/> that represents this instance. 136 134 /// </returns> 137 public string ToString(bool full, bool includeAssembly) { 135 public string ToString(bool full, bool includeAssembly) { 138 136 StringBuilder sb = new StringBuilder(); 139 137 if (!string.IsNullOrEmpty(Namespace)) … … 236 234 } 237 235 return false; 238 } catch (KeyNotFoundException) { 236 } 237 catch (KeyNotFoundException) { 239 238 throw new Exception("Could not extract version information from type string"); 240 239 } … … 269 268 } 270 269 return true; 271 } catch (KeyNotFoundException) { 270 } 271 catch (KeyNotFoundException) { 272 272 throw new Exception("Could not extract version infomration from type string"); 273 273 } -
trunk/sources/HeuristicLab.Persistence/3.3/Auxiliary/TypeNameParser.cs
r3743 r4068 21 21 22 22 using System; 23 using System.Collections.Generic; 23 24 using System.Text; 24 25 using System.Text.RegularExpressions; 25 using System.Reflection.Emit;26 using System.Collections.Generic;27 26 28 27 namespace HeuristicLab.Persistence.Auxiliary { … … 121 120 } 122 121 } 123 public static IEnumerable<Token> Tokenize(string s) { 122 public static IEnumerable<Token> Tokenize(string s) { 124 123 int pos = 0; 125 124 foreach (Match m in TokenRegex.Matches(s)) { … … 163 162 try { 164 163 return p.TransformTypeSpec(); 165 } catch (ParseError x) { 164 } 165 catch (ParseError x) { 166 166 if (p.Position > 0) 167 167 throw new ParseError(String.Format(
Note: See TracChangeset
for help on using the changeset viewer.