Changeset 16485
- Timestamp:
- 01/03/19 11:59:10 (6 years ago)
- Location:
- branches/2520_PersistenceReintegration
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2520_PersistenceReintegration/HeuristicLab.Persistence/3.3/HeuristicLab.Persistence-3.3.csproj
r16482 r16485 139 139 <Compile Include="Auxiliary\ReflectionTools.cs" /> 140 140 <Compile Include="Transformers\BitmapTransformer.cs" /> 141 <Compile Include="Transformers\KnownStorableTypesMap.cs" /> 141 142 <Compile Include="Transformers\FontTransformer.cs" /> 142 143 <None Include="packages.config" /> -
branches/2520_PersistenceReintegration/HeuristicLab.Persistence/3.3/Plugin.cs.frame
r16482 r16485 21 21 22 22 using HeuristicLab.PluginInfrastructure; 23 using HEAL.Fossil;24 using System;25 23 26 24 namespace HeuristicLab.Persistence { … … 32 30 [PluginFile("HeuristicLab.Persistence-3.3.dll", PluginFileType.Assembly)] 33 31 [PluginDependency("HeuristicLab.Tracing", "3.3")] 34 public class HeuristicLabPersistencePlugin : PluginBase { 35 36 // register types when the Plugin type is loaded 37 static HeuristicLabPersistencePlugin() { 38 RegisterStorableTypes(); 39 } 40 41 // This method registers known StorableTypes for persistence. 42 // It will be called automatically when the plugin is loaded. 43 // For unit tests it must be called explicitly. 44 public static void RegisterStorableTypes() { 45 TryRegisterType(new Guid("ECC12A57-DA8D-43D9-9EC7-FCAC878A4D69"), typeof(System.Drawing.Font)); 46 TryRegisterType(new Guid("494C1352-A1C3-47A3-8754-A0B19B8F1567"), typeof(System.Drawing.FontStyle)); 47 TryRegisterType(new Guid("41147B67-4C7A-4907-9F6C-509568395EDB"), typeof(System.Drawing.GraphicsUnit)); 48 TryRegisterType(new Guid("E8348C94-9817-4164-9C98-377689F83F30"), typeof(System.Drawing.Bitmap)); 49 50 TryRegisterType(new Guid("4AF3A1F6-49CD-4172-8394-FE464889250E"), Type.GetType("System.CultureAwareRandomizedComparer")); 51 TryRegisterType(new Guid("4C7F657C-B69E-4D1A-8812-3254D6219FD2"), Type.GetType("System.OrdinalRandomizedComparer")); 52 TryRegisterType(new Guid("0549A3DF-1FD4-487A-B06B-8C572DFFFBEB"), Type.GetType("System.Security.PermissionTokenKeyComparer")); 53 TryRegisterType(new Guid("65D2DE74-8BDF-4C74-9005-81A2C3991DC5"), Type.GetType("System.Collections.CompatibleComparer")); 54 TryRegisterType(new Guid("075827F4-07D9-4E50-9D00-C9FF3E7DCF9A"), Type.GetType("System.Collections.IEqualityComparer")); 55 TryRegisterType(new Guid("3DA30D50-2337-4487-AECD-F2DB3ECED834"), Type.GetType("System.Collections.StructuralEqualityComparer")); 56 TryRegisterType(new Guid("8A19DA46-FE80-4776-9DB4-B17E6182D104"), Type.GetType("System.Collections.Generic.SByteEnumEqualityComparer`1")); 57 TryRegisterType(new Guid("F6F6EFB9-B631-4ACC-9326-F492A6A63011"), Type.GetType("System.Collections.Generic.ShortEnumEqualityComparer`1")); 58 TryRegisterType(new Guid("BA0AB604-C052-4E08-8F9E-A5D8098F16A6"), Type.GetType("System.Collections.Generic.RandomizedStringEqualityComparer")); 59 TryRegisterType(new Guid("00C8C940-63D9-43FF-99BA-9C69301BF043"), Type.GetType("System.Collections.Generic.RandomizedObjectEqualityComparer")); 60 } 61 62 private static void TryRegisterType(Guid typeGuid, Type type) { 63 try { 64 Mapper.StaticCache.RegisterType(typeGuid, type); 65 } catch (Exception) { 66 Tracing.Logger.Warn($"type {type} or guid {typeGuid} is already registerd."); 67 } 68 } 69 } 32 public class HeuristicLabPersistencePlugin : PluginBase { } 70 33 } -
branches/2520_PersistenceReintegration/HeuristicLab.Tests/HeuristicLab.Persistence.Fossil/UseCases.cs
r16483 r16485 45 45 public void CreateTempFile() { 46 46 tempFile = Path.GetTempFileName(); 47 // in HL this is not necessary because RegisterStorableTypes is called when the plugin is loaded48 HeuristicLabPersistencePlugin.RegisterStorableTypes();49 47 } 50 48
Note: See TracChangeset
for help on using the changeset viewer.