Changeset 1823
- Timestamp:
- 05/15/09 12:29:13 (16 years ago)
- Location:
- trunk/sources
- Files:
-
- 27 deleted
- 55 edited
- 28 copied
- 32 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Constraints/3.3/AllSubOperatorsTypeConstraint.cs
r1672 r1823 27 27 using System.Xml; 28 28 using System.Diagnostics; 29 using HeuristicLab.Persistence.Default. Decomposers.Storable;29 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 30 30 31 31 namespace HeuristicLab.Constraints { -
trunk/sources/HeuristicLab.Constraints/3.3/AndConstraint.cs
r1672 r1823 26 26 using HeuristicLab.Core; 27 27 using HeuristicLab.Data; 28 using HeuristicLab.Persistence.Default. Decomposers.Storable;28 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 29 29 30 30 namespace HeuristicLab.Constraints { -
trunk/sources/HeuristicLab.Constraints/3.3/ConstraintBase.cs
r1672 r1823 25 25 using System.Xml; 26 26 using HeuristicLab.Core; 27 using HeuristicLab.Persistence.Default. Decomposers.Storable;27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 28 28 29 29 namespace HeuristicLab.Constraints { -
trunk/sources/HeuristicLab.Constraints/3.3/DoubleBoundedConstraint.cs
r1672 r1823 27 27 using HeuristicLab.Data; 28 28 using System.Globalization; 29 using HeuristicLab.Persistence.Default. Decomposers.Storable;29 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 30 30 31 31 namespace HeuristicLab.Constraints { -
trunk/sources/HeuristicLab.Constraints/3.3/IntBoundedConstraint.cs
r1672 r1823 26 26 using HeuristicLab.Core; 27 27 using HeuristicLab.Data; 28 using HeuristicLab.Persistence.Default. Decomposers.Storable;28 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 29 29 30 30 namespace HeuristicLab.Constraints { -
trunk/sources/HeuristicLab.Constraints/3.3/IsIntegerConstraint.cs
r1672 r1823 25 25 using HeuristicLab.Core; 26 26 using HeuristicLab.Data; 27 using HeuristicLab.Persistence.Default. Decomposers.Storable;27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 28 28 29 29 namespace HeuristicLab.Constraints { -
trunk/sources/HeuristicLab.Constraints/3.3/ItemTypeConstraint.cs
r1672 r1823 26 26 using HeuristicLab.Core; 27 27 using HeuristicLab.Data; 28 using HeuristicLab.Persistence.Default. Decomposers.Storable;28 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 29 29 30 30 namespace HeuristicLab.Constraints { -
trunk/sources/HeuristicLab.Constraints/3.3/NotConstraint.cs
r1672 r1823 26 26 using HeuristicLab.Core; 27 27 using HeuristicLab.Data; 28 using HeuristicLab.Persistence.Default. Decomposers.Storable;28 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 29 29 30 30 namespace HeuristicLab.Constraints { -
trunk/sources/HeuristicLab.Constraints/3.3/NumberOfSubOperatorsConstraint.cs
r1672 r1823 27 27 using HeuristicLab.Data; 28 28 using System.Xml; 29 using HeuristicLab.Persistence.Default. Decomposers.Storable;29 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 30 30 31 31 namespace HeuristicLab.Constraints { -
trunk/sources/HeuristicLab.Constraints/3.3/OrConstraint.cs
r1672 r1823 26 26 using HeuristicLab.Core; 27 27 using HeuristicLab.Data; 28 using HeuristicLab.Persistence.Default. Decomposers.Storable;28 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 29 29 30 30 namespace HeuristicLab.Constraints { -
trunk/sources/HeuristicLab.Constraints/3.3/SubOperatorsTypeConstraint.cs
r1672 r1823 27 27 using System.Diagnostics; 28 28 using System.Xml; 29 using HeuristicLab.Persistence.Default. Decomposers.Storable;29 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 30 30 31 31 namespace HeuristicLab.Constraints { -
trunk/sources/HeuristicLab.Constraints/3.3/VariableComparisonConstraint.cs
r1672 r1823 26 26 using HeuristicLab.Core; 27 27 using HeuristicLab.Data; 28 using HeuristicLab.Persistence.Default. Decomposers.Storable;28 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 29 29 30 30 namespace HeuristicLab.Constraints { -
trunk/sources/HeuristicLab.Core/3.3/AtomicOperation.cs
r1667 r1823 24 24 using System.Text; 25 25 using System.Xml; 26 using HeuristicLab.Persistence.Default. Decomposers.Storable;26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 27 27 28 28 namespace HeuristicLab.Core { -
trunk/sources/HeuristicLab.Core/3.3/CompositeOperation.cs
r1667 r1823 24 24 using System.Text; 25 25 using System.Xml; 26 using HeuristicLab.Persistence.Default. Decomposers.Storable;26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 27 27 28 28 namespace HeuristicLab.Core { -
trunk/sources/HeuristicLab.Core/3.3/ConstrainedItemBase.cs
r1667 r1823 24 24 using System.Text; 25 25 using System.Xml; 26 using HeuristicLab.Persistence.Default. Decomposers.Storable;26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 27 27 28 28 namespace HeuristicLab.Core { -
trunk/sources/HeuristicLab.Core/3.3/EngineBase.cs
r1667 r1823 25 25 using System.Xml; 26 26 using System.Threading; 27 using HeuristicLab.Persistence.Default. Decomposers.Storable;27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 28 28 29 29 namespace HeuristicLab.Core { -
trunk/sources/HeuristicLab.Core/3.3/OperatorBase.cs
r1732 r1823 24 24 using System.Text; 25 25 using System.Xml; 26 using HeuristicLab.Persistence.Default. Decomposers.Storable;26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 27 27 28 28 namespace HeuristicLab.Core { -
trunk/sources/HeuristicLab.Core/3.3/OperatorGraph.cs
r1667 r1823 24 24 using System.Text; 25 25 using System.Xml; 26 using HeuristicLab.Persistence.Default. Decomposers.Storable;26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 27 27 28 28 namespace HeuristicLab.Core { -
trunk/sources/HeuristicLab.Core/3.3/OperatorGroup.cs
r1667 r1823 24 24 using System.Text; 25 25 using System.Xml; 26 using HeuristicLab.Persistence.Default. Decomposers.Storable;26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 27 27 28 28 namespace HeuristicLab.Core { -
trunk/sources/HeuristicLab.Core/3.3/OperatorLibrary.cs
r1667 r1823 24 24 using System.Text; 25 25 using System.Xml; 26 using HeuristicLab.Persistence.Default. Decomposers.Storable;26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 27 27 28 28 namespace HeuristicLab.Core { -
trunk/sources/HeuristicLab.Core/3.3/Scope.cs
r1732 r1823 24 24 using System.Text; 25 25 using System.Xml; 26 using HeuristicLab.Persistence.Default. Decomposers.Storable;26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 27 27 28 28 namespace HeuristicLab.Core { -
trunk/sources/HeuristicLab.Core/3.3/StorableBase.cs
r1667 r1823 24 24 using System.Text; 25 25 using System.Xml; 26 using HeuristicLab.Persistence.Default. Decomposers.Storable;26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 27 27 28 28 namespace HeuristicLab.Core { -
trunk/sources/HeuristicLab.Core/3.3/Variable.cs
r1667 r1823 24 24 using System.Text; 25 25 using System.Xml; 26 using HeuristicLab.Persistence.Default. Decomposers.Storable;26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 27 27 28 28 namespace HeuristicLab.Core { -
trunk/sources/HeuristicLab.Core/3.3/VariableInfo.cs
r1667 r1823 24 24 using System.Text; 25 25 using System.Xml; 26 using HeuristicLab.Persistence.Default. Decomposers.Storable;26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 27 27 28 28 namespace HeuristicLab.Core { -
trunk/sources/HeuristicLab.Data/3.3/ArrayDataBase.cs
r1669 r1823 25 25 using System.Xml; 26 26 using HeuristicLab.Core; 27 using HeuristicLab.Persistence.Default. Decomposers.Storable;27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 28 28 29 29 namespace HeuristicLab.Data { -
trunk/sources/HeuristicLab.Data/3.3/ConstrainedItemList.cs
r1669 r1823 26 26 using System.Xml; 27 27 using HeuristicLab.Core; 28 using HeuristicLab.Persistence.Default. Decomposers.Storable;28 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 29 29 30 30 namespace HeuristicLab.Data { -
trunk/sources/HeuristicLab.Data/3.3/ConstrainedObjectData.cs
r1669 r1823 25 25 using System.Xml; 26 26 using HeuristicLab.Core; 27 using HeuristicLab.Persistence.Default. Decomposers.Storable;27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 28 28 29 29 namespace HeuristicLab.Data { -
trunk/sources/HeuristicLab.Data/3.3/ItemDictionary_T.cs
r1669 r1823 5 5 using System.Xml; 6 6 using HeuristicLab.Core; 7 using HeuristicLab.Persistence.Default. Decomposers.Storable;7 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 8 8 9 9 namespace HeuristicLab.Data { -
trunk/sources/HeuristicLab.Data/3.3/ItemList_T.cs
r1669 r1823 26 26 using System.Xml; 27 27 using HeuristicLab.Core; 28 using HeuristicLab.Persistence.Default. Decomposers.Storable;28 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 29 29 30 30 namespace HeuristicLab.Data { -
trunk/sources/HeuristicLab.Data/3.3/ObjectData.cs
r1669 r1823 25 25 using System.Xml; 26 26 using HeuristicLab.Core; 27 using HeuristicLab.Persistence.Default. Decomposers.Storable;27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 28 28 29 29 namespace HeuristicLab.Data { -
trunk/sources/HeuristicLab.Operators/3.3/CombinedOperator.cs
r1673 r1823 26 26 using HeuristicLab.Core; 27 27 using HeuristicLab.Data; 28 using HeuristicLab.Persistence.Default. Decomposers.Storable;28 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 29 29 30 30 namespace HeuristicLab.Operators { -
trunk/sources/HeuristicLab.Operators/3.3/VariableInjector.cs
r1727 r1823 25 25 using System.Xml; 26 26 using HeuristicLab.Core; 27 using HeuristicLab.Persistence.Default. Decomposers.Storable;27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 28 28 29 29 namespace HeuristicLab.Operators { -
trunk/sources/HeuristicLab.Persistence.GUI/3.3/PersistenceConfigurationForm.cs
r1703 r1823 9 9 using HeuristicLab.Persistence.Interfaces; 10 10 using System.Text; 11 using HeuristicLab.Persistence.Default. Decomposers;11 using HeuristicLab.Persistence.Default.CompositeSerializers; 12 12 using HeuristicLab.PluginInfrastructure; 13 using HeuristicLab.Persistence.Default. Decomposers.Storable;13 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 14 14 15 15 namespace HeuristicLab.Persistence.GUI { … … 17 17 public partial class PersistenceConfigurationForm : Form { 18 18 19 private readonly Dictionary<string, I Formatter> formatterTable;20 private readonly Dictionary<string, bool> simple FormatterTable;21 private readonly Dictionary<I Formatter, string> reverseFormatterTable;19 private readonly Dictionary<string, IPrimitiveSerializer> primitiveSerializersTable; 20 private readonly Dictionary<string, bool> simplePrimitiveSerializersTable; 21 private readonly Dictionary<IPrimitiveSerializer, string> reversePrimitiveSerializersTable; 22 22 private readonly Dictionary<string, Type> typeNameTable; 23 23 private readonly Dictionary<Type, string> reverseTypeNameTable; … … 26 26 public PersistenceConfigurationForm() { 27 27 InitializeComponent(); 28 formatterTable = new Dictionary<string, IFormatter>();29 simple FormatterTable = new Dictionary<string, bool>();30 reverse FormatterTable = new Dictionary<IFormatter, string>();28 primitiveSerializersTable = new Dictionary<string, IPrimitiveSerializer>(); 29 simplePrimitiveSerializersTable = new Dictionary<string, bool>(); 30 reversePrimitiveSerializersTable = new Dictionary<IPrimitiveSerializer, string>(); 31 31 typeNameTable = new Dictionary<string, Type>(); 32 32 reverseTypeNameTable = new Dictionary<Type, string>(); … … 38 38 ConfigurationService.Instance.LoadSettings(true); 39 39 UpdateFromConfigurationService(); 40 } catch (PersistenceException e) {40 } catch (PersistenceException) { 41 41 MessageBox.Show( 42 42 "Persistence settings could not be loaded.\r\n" + … … 66 66 } 67 67 68 private void Update FormatterGrid(DataGridView formatterGrid, Configuration config) {69 foreach (DataGridViewRow row in formatterGrid.Rows) {68 private void UpdatePrimitiveSerializersGrid(DataGridView primitiveSerializersGrid, Configuration config) { 69 foreach (DataGridViewRow row in primitiveSerializersGrid.Rows) { 70 70 if (row.Cells["Type"] != null) { 71 I Formatter formatter = config.GetFormatter(typeNameTable[(string)row.Cells["Type"].Value]);72 if ( formatter == null) {71 IPrimitiveSerializer primitiveSerializer = config.GetPrimitiveSerializer(typeNameTable[(string)row.Cells["Type"].Value]); 72 if (primitiveSerializer == null) { 73 73 row.Cells["Active"].Value = false; 74 74 } else { 75 foreach (var pair in formatterTable) {76 if (pair.Value.GetType().VersionInvariantName() == formatter.GetType().VersionInvariantName()) {77 row.Cells[" Formatter"].Value = pair.Key;75 foreach (var pair in primitiveSerializersTable) { 76 if (pair.Value.GetType().VersionInvariantName() == primitiveSerializer.GetType().VersionInvariantName()) { 77 row.Cells["Primitive Serializer"].Value = pair.Key; 78 78 row.Cells["Active"].Value = true; 79 79 break; … … 85 85 } 86 86 87 private void Update DecomposerList(ListView decomposerList, Configuration config) {88 decomposerList.SuspendLayout();89 decomposerList.Items.Clear();90 var available Decomposers = new Dictionary<string, IDecomposer>();91 foreach (I Decomposer d in ConfigurationService.Instance.Decomposers) {92 available Decomposers.Add(d.GetType().VersionInvariantName(), d);93 } 94 foreach (I Decomposer decomposer in config.Decomposers) {95 var item = decomposerList.Items.Add(decomposer.GetType().Name);87 private void UpdateCompositeSerializersList(ListView compositeSerializersList, Configuration config) { 88 compositeSerializersList.SuspendLayout(); 89 compositeSerializersList.Items.Clear(); 90 var availableCompositeSerializers = new Dictionary<string, ICompositeSerializer>(); 91 foreach (ICompositeSerializer d in ConfigurationService.Instance.CompositeSerializers) { 92 availableCompositeSerializers.Add(d.GetType().VersionInvariantName(), d); 93 } 94 foreach (ICompositeSerializer compositeSerializer in config.CompositeSerializers) { 95 var item = compositeSerializersList.Items.Add(compositeSerializer.GetType().Name); 96 96 item.Checked = true; 97 item.Tag = decomposer;98 available Decomposers.Remove(decomposer.GetType().VersionInvariantName());99 } 100 foreach (KeyValuePair<string, I Decomposer> pair in availableDecomposers) {101 var item = decomposerList.Items.Add(pair.Value.GetType().Name);97 item.Tag = compositeSerializer; 98 availableCompositeSerializers.Remove(compositeSerializer.GetType().VersionInvariantName()); 99 } 100 foreach (KeyValuePair<string, ICompositeSerializer> pair in availableCompositeSerializers) { 101 var item = compositeSerializersList.Items.Add(pair.Value.GetType().Name); 102 102 item.Checked = false; 103 103 item.Tag = pair.Value; 104 104 } 105 decomposerList.ResumeLayout();105 compositeSerializersList.ResumeLayout(); 106 106 } 107 107 … … 110 110 foreach (IFormat format in ConfigurationService.Instance.Formats) { 111 111 Configuration config = ConfigurationService.Instance.GetConfiguration(format); 112 Update FormatterGrid(112 UpdatePrimitiveSerializersGrid( 113 113 (DataGridView)GetControlsOnPage(format.Name, "GridView"), 114 114 config); 115 Update DecomposerList(116 (ListView)GetControlsOnPage(format.Name, " DecomposerList"),115 UpdateCompositeSerializersList( 116 (ListView)GetControlsOnPage(format.Name, "CompositeSerializersList"), 117 117 config); 118 118 } … … 124 124 configurationTabs.TabPages.Clear(); 125 125 foreach (IFormat format in ConfigurationService.Instance.Formats) { 126 List<I Formatter> formatters = ConfigurationService.Instance.Formatters[format.SerialDataType];126 List<IPrimitiveSerializer> primitiveSerializers = ConfigurationService.Instance.PrimitiveSerializers[format.SerialDataType]; 127 127 TabPage page = new TabPage(format.Name) { 128 128 Name = format.Name, … … 145 145 horizontalSplit.SuspendLayout(); 146 146 verticalSplit.Panel1.Controls.Add(horizontalSplit); 147 ListView decomposerList = createDecomposerList();148 horizontalSplit.Panel1.Controls.Add( decomposerList);147 ListView compositeSerializersList = createCompsiteSerializersList(); 148 horizontalSplit.Panel1.Controls.Add(compositeSerializersList); 149 149 DataGridView gridView = createGridView(); 150 150 verticalSplit.Panel2.Controls.Add(gridView); 151 fillDataGrid(gridView, formatters);151 fillDataGrid(gridView, primitiveSerializers); 152 152 ListBox checkBox = new ListBox { 153 153 Name = "CheckBox", … … 185 185 }); 186 186 gridView.Columns.Add(new DataGridViewComboBoxColumn { 187 Name = " Formatter",187 Name = "Primitive Serializer", 188 188 AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill 189 189 }); … … 192 192 } 193 193 194 private ListView create DecomposerList() {195 ListView decomposerList = new ListView {194 private ListView createCompsiteSerializersList() { 195 ListView compositeSerializersList = new ListView { 196 196 Activation = ItemActivation.OneClick, 197 197 AllowDrop = true, … … 201 201 GridLines = true, 202 202 HeaderStyle = ColumnHeaderStyle.Nonclickable, 203 Name = " DecomposerList",203 Name = "CompositeSerializersList", 204 204 ShowGroups = false, 205 205 View = View.Details 206 206 }; 207 decomposerList.SuspendLayout();208 decomposerList.Resize += decomposerList_Resize;209 decomposerList.ItemChecked += decomposerList_ItemChecked;210 decomposerList.DragDrop += decomposerList_DragDrop;211 decomposerList.DragEnter += decomposerList_DragEnter;212 decomposerList.ItemDrag += decomposerList_ItemDrag;213 decomposerList.Columns.Add(207 compositeSerializersList.SuspendLayout(); 208 compositeSerializersList.Resize += compositeSerializersList_Resize; 209 compositeSerializersList.ItemChecked += compositeSerializersList_ItemChecked; 210 compositeSerializersList.DragDrop += compositeSerializersList_DragDrop; 211 compositeSerializersList.DragEnter += compositeSerializersList_DragEnter; 212 compositeSerializersList.ItemDrag += compositeSerializersList_ItemDrag; 213 compositeSerializersList.Columns.Add( 214 214 new ColumnHeader { 215 Name = " DecomposerColumn", Text = "Decomposers",215 Name = "CompositeSerializersColumn", Text = "Composite Serializer", 216 216 }); 217 foreach (I Decomposer decomposer in ConfigurationService.Instance.Decomposers) {218 var item = decomposerList.Items.Add(decomposer.GetType().Name);217 foreach (ICompositeSerializer compositeSerializer in ConfigurationService.Instance.CompositeSerializers) { 218 var item = compositeSerializersList.Items.Add(compositeSerializer.GetType().Name); 219 219 item.Checked = true; 220 item.Tag = decomposer;221 } 222 decomposerList.ResumeLayout();223 return decomposerList;224 } 225 226 private void fillDataGrid(DataGridView gridView, IEnumerable<I Formatter> formatters) {220 item.Tag = compositeSerializer; 221 } 222 compositeSerializersList.ResumeLayout(); 223 return compositeSerializersList; 224 } 225 226 private void fillDataGrid(DataGridView gridView, IEnumerable<IPrimitiveSerializer> primitiveSerializers) { 227 227 gridView.SuspendLayout(); 228 Dictionary<string, List<string>> formatterMap = createFormatterMap(formatters);229 foreach (var formatterMapping in formatterMap) {228 Dictionary<string, List<string>> primitiveSerializersMap = createPrimitiveSerializersMap(primitiveSerializers); 229 foreach (var primitiveSerializersMapping in primitiveSerializersMap) { 230 230 var row = gridView.Rows[gridView.Rows.Add()]; 231 row.Cells["Type"].Value = formatterMapping.Key;232 row.Cells["Type"].ToolTipText = formatterMapping.Key;231 row.Cells["Type"].Value = primitiveSerializersMapping.Key; 232 row.Cells["Type"].ToolTipText = primitiveSerializersMapping.Key; 233 233 row.Cells["Active"].Value = true; 234 var comboBoxCell = (DataGridViewComboBoxCell)row.Cells[" Formatter"];235 foreach (var formatter in formatterMapping.Value) {236 comboBoxCell.Items.Add( formatter);234 var comboBoxCell = (DataGridViewComboBoxCell)row.Cells["Primitive Serializer"]; 235 foreach (var primitiveSerializer in primitiveSerializersMapping.Value) { 236 comboBoxCell.Items.Add(primitiveSerializer); 237 237 } 238 238 comboBoxCell.Value = comboBoxCell.Items[0]; … … 246 246 } 247 247 248 private Dictionary<string, List<string>> create FormatterMap(IEnumerable<IFormatter> formatters) {249 var formatterMap = new Dictionary<string, List<string>>();250 foreach (var formatter in formatters) {251 string formatterName = reverseFormatterTable[formatter];252 string typeName = reverseTypeNameTable[ formatter.SourceType];253 if (! formatterMap.ContainsKey(typeName))254 formatterMap.Add(typeName, new List<string>());255 formatterMap[typeName].Add(formatterName);256 } 257 return formatterMap;248 private Dictionary<string, List<string>> createPrimitiveSerializersMap(IEnumerable<IPrimitiveSerializer> primitiveSerializers) { 249 var primitiveSerializersMap = new Dictionary<string, List<string>>(); 250 foreach (var primitiveSerializer in primitiveSerializers) { 251 string primitiveSerializerName = reversePrimitiveSerializersTable[primitiveSerializer]; 252 string typeName = reverseTypeNameTable[primitiveSerializer.SourceType]; 253 if (!primitiveSerializersMap.ContainsKey(typeName)) 254 primitiveSerializersMap.Add(typeName, new List<string>()); 255 primitiveSerializersMap[typeName].Add(primitiveSerializerName); 256 } 257 return primitiveSerializersMap; 258 258 } 259 259 260 260 private void InitializeNameTables() { 261 foreach (var serialDataType in ConfigurationService.Instance. Formatters.Keys) {262 foreach (var formatter in ConfigurationService.Instance.Formatters[serialDataType]) {263 string formatterName = formatter.GetType().Name;264 if (simple FormatterTable.ContainsKey(formatterName)) {265 I Formatter otherFormatter = formatterTable[formatterName];266 formatterTable.Remove(formatterName);267 reverse FormatterTable.Remove(otherFormatter);268 formatterTable.Add(otherFormatter.GetType().VersionInvariantName(), otherFormatter);269 reverse FormatterTable.Add(otherFormatter, otherFormatter.GetType().VersionInvariantName());270 formatterName = formatter.GetType().VersionInvariantName();261 foreach (var serialDataType in ConfigurationService.Instance.PrimitiveSerializers.Keys) { 262 foreach (var primtiveSerializer in ConfigurationService.Instance.PrimitiveSerializers[serialDataType]) { 263 string primitiveSerializerName = primtiveSerializer.GetType().Name; 264 if (simplePrimitiveSerializersTable.ContainsKey(primitiveSerializerName)) { 265 IPrimitiveSerializer otherPrimitiveSerializer = primitiveSerializersTable[primitiveSerializerName]; 266 primitiveSerializersTable.Remove(primitiveSerializerName); 267 reversePrimitiveSerializersTable.Remove(otherPrimitiveSerializer); 268 primitiveSerializersTable.Add(otherPrimitiveSerializer.GetType().VersionInvariantName(), otherPrimitiveSerializer); 269 reversePrimitiveSerializersTable.Add(otherPrimitiveSerializer, otherPrimitiveSerializer.GetType().VersionInvariantName()); 270 primitiveSerializerName = primtiveSerializer.GetType().VersionInvariantName(); 271 271 } 272 simple FormatterTable[formatter.GetType().Name] = true;273 formatterTable.Add(formatterName, formatter);274 reverse FormatterTable.Add(formatter, formatterName);275 276 string typeName = formatter.SourceType.IsGenericType ?277 formatter.SourceType.SimpleFullName() :278 formatter.SourceType.Name;272 simplePrimitiveSerializersTable[primtiveSerializer.GetType().Name] = true; 273 primitiveSerializersTable.Add(primitiveSerializerName, primtiveSerializer); 274 reversePrimitiveSerializersTable.Add(primtiveSerializer, primitiveSerializerName); 275 276 string typeName = primtiveSerializer.SourceType.IsGenericType ? 277 primtiveSerializer.SourceType.SimpleFullName() : 278 primtiveSerializer.SourceType.Name; 279 279 if (typeNameTable.ContainsKey(typeName)) { 280 280 Type otherType = typeNameTable[typeName]; 281 if (otherType != formatter.SourceType) {281 if (otherType != primtiveSerializer.SourceType) { 282 282 typeNameTable.Remove(typeName); 283 283 reverseTypeNameTable.Remove(otherType); 284 284 typeNameTable.Add(otherType.VersionInvariantName(), otherType); 285 285 reverseTypeNameTable.Add(otherType, otherType.VersionInvariantName()); 286 typeName = formatter.SourceType.VersionInvariantName();287 typeNameTable.Add(typeName, formatter.SourceType);288 reverseTypeNameTable.Add( formatter.SourceType, typeName);286 typeName = primtiveSerializer.SourceType.VersionInvariantName(); 287 typeNameTable.Add(typeName, primtiveSerializer.SourceType); 288 reverseTypeNameTable.Add(primtiveSerializer.SourceType, typeName); 289 289 } 290 290 } else { 291 typeNameTable.Add(typeName, formatter.SourceType);292 reverseTypeNameTable.Add( formatter.SourceType, typeName);291 typeNameTable.Add(typeName, primtiveSerializer.SourceType); 292 reverseTypeNameTable.Add(primtiveSerializer.SourceType, typeName); 293 293 } 294 294 } … … 305 305 checkBox.Items.Clear(); 306 306 Configuration activeConfig = GetActiveConfiguration(); 307 foreach (var formatter in activeConfig.Formatters) {308 checkBox.Items.Add( formatter.GetType().Name + " (F)");309 } 310 foreach (var decomposer in activeConfig.Decomposers)311 checkBox.Items.Add( decomposer.GetType().Name + " (D)");307 foreach (var primitveSerializer in activeConfig.PrimitiveSerializers) { 308 checkBox.Items.Add(primitveSerializer.GetType().Name + " (F)"); 309 } 310 foreach (var compositeSerializer in activeConfig.CompositeSerializers) 311 checkBox.Items.Add(compositeSerializer.GetType().Name + " (D)"); 312 312 } 313 313 checkBox.ResumeLayout(); … … 319 319 } 320 320 321 private void decomposerList_ItemDrag(object sender, ItemDragEventArgs e) {322 ListView decomposerList = (ListView)sender;323 decomposerList.DoDragDrop(decomposerList.SelectedItems, DragDropEffects.Move);324 } 325 326 private void decomposerList_DragEnter(object sender, DragEventArgs e) {321 private void compositeSerializersList_ItemDrag(object sender, ItemDragEventArgs e) { 322 ListView compositeSerializersList = (ListView)sender; 323 compositeSerializersList.DoDragDrop(compositeSerializersList.SelectedItems, DragDropEffects.Move); 324 } 325 326 private void compositeSerializersList_DragEnter(object sender, DragEventArgs e) { 327 327 if (e.Data.GetDataPresent(typeof(ListView.SelectedListViewItemCollection).FullName)) { 328 328 e.Effect = DragDropEffects.Move; … … 330 330 } 331 331 332 private void decomposerList_DragDrop(object sender, DragEventArgs e) {333 ListView decomposerList = (ListView)sender;334 if ( decomposerList.SelectedItems.Count == 0) {332 private void compositeSerializersList_DragDrop(object sender, DragEventArgs e) { 333 ListView compositeSerializersList = (ListView)sender; 334 if (compositeSerializersList.SelectedItems.Count == 0) { 335 335 return; 336 336 } 337 Point cp = decomposerList.PointToClient(new Point(e.X, e.Y));338 ListViewItem targetItem = decomposerList.GetItemAt(cp.X, cp.Y);337 Point cp = compositeSerializersList.PointToClient(new Point(e.X, e.Y)); 338 ListViewItem targetItem = compositeSerializersList.GetItemAt(cp.X, cp.Y); 339 339 if (targetItem == null) 340 340 return; 341 341 int targetIndex = targetItem.Index; 342 var selectedItems = new List<ListViewItem>( decomposerList.SelectedItems.Cast<ListViewItem>());342 var selectedItems = new List<ListViewItem>(compositeSerializersList.SelectedItems.Cast<ListViewItem>()); 343 343 int i = 0; 344 344 foreach (ListViewItem dragItem in selectedItems) { … … 346 346 return; 347 347 if (dragItem.Index < targetIndex) { 348 decomposerList.Items.Insert(targetIndex + 1, (ListViewItem)dragItem.Clone());348 compositeSerializersList.Items.Insert(targetIndex + 1, (ListViewItem)dragItem.Clone()); 349 349 } else { 350 decomposerList.Items.Insert(targetIndex + i, (ListViewItem)dragItem.Clone());351 } 352 decomposerList.Items.Remove(dragItem);350 compositeSerializersList.Items.Insert(targetIndex + i, (ListViewItem)dragItem.Clone()); 351 } 352 compositeSerializersList.Items.Remove(dragItem); 353 353 i++; 354 354 } … … 356 356 } 357 357 358 private void decomposerList_Resize(object sender, EventArgs e) {359 ListView decomposerList = (ListView)sender;360 decomposerList.Columns["DecomposerColumn"].Width = decomposerList.Width - 4;361 } 362 363 364 private void decomposerList_ItemChecked(object sender, ItemCheckedEventArgs e) {358 private void compositeSerializersList_Resize(object sender, EventArgs e) { 359 ListView compositeSerializersList = (ListView)sender; 360 compositeSerializersList.Columns["CompositeSerializersColumn"].Width = compositeSerializersList.Width - 4; 361 } 362 363 364 private void compositeSerializersList_ItemChecked(object sender, ItemCheckedEventArgs e) { 365 365 UpdatePreview(); 366 366 } … … 384 384 } 385 385 386 private Configuration GenerateConfiguration(IFormat format, DataGridView formatterGrid, ListView decomposerList) {387 if ( formatterGrid == null || decomposerList == null)386 private Configuration GenerateConfiguration(IFormat format, DataGridView primitiveSerializersGrid, ListView compositeSerializersList) { 387 if (primitiveSerializersGrid == null || compositeSerializersList == null) 388 388 return null; 389 var formatters = new List<IFormatter>();390 foreach (DataGridViewRow row in formatterGrid.Rows) {389 var primitiveSerializers = new List<IPrimitiveSerializer>(); 390 foreach (DataGridViewRow row in primitiveSerializersGrid.Rows) { 391 391 if (row.Cells["Type"].Value != null && 392 392 row.Cells["Active"].Value != null && 393 row.Cells[" Formatter"].Value != null &&393 row.Cells["Primitive Serializer"].Value != null && 394 394 (bool)row.Cells["Active"].Value == true) { 395 formatters.Add(formatterTable[(string)row.Cells["Formatter"].Value]);396 } 397 } 398 var decomposers = new List<IDecomposer>();399 foreach (ListViewItem item in decomposerList.Items) {395 primitiveSerializers.Add(primitiveSerializersTable[(string)row.Cells["Primitive Serializer"].Value]); 396 } 397 } 398 var compositeSerializers = new List<ICompositeSerializer>(); 399 foreach (ListViewItem item in compositeSerializersList.Items) { 400 400 if (item != null && item.Checked) 401 decomposers.Add((IDecomposer)item.Tag);402 } 403 return new Configuration(format, formatters, decomposers);401 compositeSerializers.Add((ICompositeSerializer)item.Tag); 402 } 403 return new Configuration(format, primitiveSerializers, compositeSerializers); 404 404 } 405 405 … … 408 408 return GenerateConfiguration(format, 409 409 (DataGridView)GetActiveControl("GridView"), 410 (ListView)GetActiveControl(" DecomposerList"));410 (ListView)GetActiveControl("CompositeSerializersList")); 411 411 } 412 412 … … 414 414 return GenerateConfiguration(format, 415 415 (DataGridView)GetControlsOnPage(format.Name, "GridView"), 416 (ListView)GetControlsOnPage(format.Name, " DecomposerList"));416 (ListView)GetControlsOnPage(format.Name, "CompositeSerializersList")); 417 417 } 418 418 -
trunk/sources/HeuristicLab.Persistence/3.3/Auxiliary/TypeLoader.cs
r1805 r1823 6 6 using HeuristicLab.Tracing; 7 7 using System.Reflection; 8 using HeuristicLab.Persistence.Core; 8 9 9 namespace HeuristicLab.Persistence. Core{10 namespace HeuristicLab.Persistence.Auxiliary { 10 11 11 12 public class TypeLoader { … … 52 53 return type; 53 54 } 54 55 }56 57 public class Deserializer {58 59 class Midwife {60 61 public int? Id { get; private set; }62 public bool MetaMode { get; set; }63 public object Obj { get; private set; }64 65 private List<Tag> metaInfo;66 private List<Tag> customValues;67 private Type type;68 private IDecomposer decomposer;69 70 public Midwife(object value) {71 this.Obj = value;72 }73 74 public Midwife(Type type, IDecomposer decomposer, int? id) {75 this.type = type;76 this.decomposer = decomposer;77 this.Id = id;78 MetaMode = false;79 metaInfo = new List<Tag>();80 customValues = new List<Tag>();81 }82 83 public void CreateInstance() {84 if (Obj != null)85 throw new PersistenceException("object already instantiated");86 Obj = decomposer.CreateInstance(type, metaInfo);87 }88 89 public void AddValue(string name, object value) {90 if (MetaMode) {91 metaInfo.Add(new Tag(name, value));92 } else {93 customValues.Add(new Tag(name, value));94 }95 }96 97 public void Populate() {98 decomposer.Populate(Obj, customValues, type);99 }100 }101 102 private readonly Dictionary<int, object> id2obj;103 private readonly Dictionary<Type, object> serializerMapping;104 private readonly Stack<Midwife> parentStack;105 private readonly Dictionary<int, Type> typeIds;106 107 public Deserializer(108 IEnumerable<TypeMapping> typeCache) {109 id2obj = new Dictionary<int, object>();110 parentStack = new Stack<Midwife>();111 typeIds = new Dictionary<int, Type>();112 serializerMapping = CreateSerializers(typeCache);113 }114 115 private Dictionary<Type, object> CreateSerializers(IEnumerable<TypeMapping> typeCache) {116 try {117 var map = new Dictionary<Type, object>();118 foreach (var typeMapping in typeCache) {119 Type type = TypeLoader.Load(typeMapping.TypeName);120 typeIds.Add(typeMapping.Id, type);121 Type serializerType = TypeLoader.Load(typeMapping.Serializer);122 map.Add(type, Activator.CreateInstance(serializerType, true));123 }124 return map;125 } catch (PersistenceException) {126 throw;127 } catch (Exception e) {128 throw new PersistenceException(129 "The serialization type cache could not be loaded.\r\n" +130 "This usualy happens when you are missing an Assembly/Plugin.", e);131 }132 }133 134 135 public object Deserialize(IEnumerable<ISerializationToken> tokens) {136 foreach (ISerializationToken token in tokens) {137 Type t = token.GetType();138 if (t == typeof(BeginToken)) {139 CompositeStartHandler((BeginToken)token);140 } else if (t == typeof(EndToken)) {141 CompositeEndHandler((EndToken)token);142 } else if (t == typeof(PrimitiveToken)) {143 PrimitiveHandler((PrimitiveToken)token);144 } else if (t == typeof(ReferenceToken)) {145 ReferenceHandler((ReferenceToken)token);146 } else if (t == typeof(NullReferenceToken)) {147 NullHandler((NullReferenceToken)token);148 } else if (t == typeof(MetaInfoBeginToken)) {149 MetaInfoBegin((MetaInfoBeginToken)token);150 } else if (t == typeof(MetaInfoEndToken)) {151 MetaInfoEnd((MetaInfoEndToken)token);152 } else {153 throw new PersistenceException("invalid token type");154 }155 }156 return parentStack.Pop().Obj;157 }158 159 private void CompositeStartHandler(BeginToken token) {160 Type type = typeIds[(int)token.TypeId];161 IDecomposer decomposer = null;162 if (serializerMapping.ContainsKey(type))163 decomposer = serializerMapping[type] as IDecomposer;164 if (decomposer == null)165 throw new PersistenceException(String.Format(166 "No suitable method for deserialization of type \"{0}\" found.",167 type.VersionInvariantName()));168 parentStack.Push(new Midwife(type, decomposer, token.Id));169 }170 171 private void CompositeEndHandler(EndToken token) {172 Type type = typeIds[(int)token.TypeId];173 Midwife midwife = parentStack.Pop();174 if (midwife.Obj == null)175 CreateInstance(midwife);176 midwife.Populate();177 SetValue(token.Name, midwife.Obj);178 }179 180 private void PrimitiveHandler(PrimitiveToken token) {181 Type type = typeIds[(int)token.TypeId];182 object value = ((IFormatter)serializerMapping[type]).Parse(token.SerialData);183 if (token.Id != null)184 id2obj[(int)token.Id] = value;185 SetValue(token.Name, value);186 }187 188 private void ReferenceHandler(ReferenceToken token) {189 object referredObject = id2obj[token.Id];190 SetValue(token.Name, referredObject);191 }192 193 private void NullHandler(NullReferenceToken token) {194 SetValue(token.Name, null);195 }196 197 private void MetaInfoBegin(MetaInfoBeginToken token) {198 parentStack.Peek().MetaMode = true;199 }200 201 private void MetaInfoEnd(MetaInfoEndToken token) {202 Midwife m = parentStack.Peek();203 m.MetaMode = false;204 CreateInstance(m);205 }206 207 private void CreateInstance(Midwife m) {208 m.CreateInstance();209 if (m.Id != null)210 id2obj.Add((int)m.Id, m.Obj);211 }212 213 private void SetValue(string name, object value) {214 if (parentStack.Count == 0) {215 parentStack.Push(new Midwife(value));216 } else {217 Midwife m = parentStack.Peek();218 if (m.MetaMode == false && m.Obj == null)219 CreateInstance(m);220 m.AddValue(name, value);221 }222 }223 55 } 224 56 } -
trunk/sources/HeuristicLab.Persistence/3.3/Core/Configuration.cs
r1654 r1823 2 2 using System.Collections.Generic; 3 3 using HeuristicLab.Persistence.Interfaces; 4 using HeuristicLab.Persistence.Default. Decomposers.Storable;4 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 5 5 6 6 namespace HeuristicLab.Persistence.Core { … … 9 9 10 10 [Storable] 11 private readonly Dictionary<Type, I Formatter> formatters;11 private readonly Dictionary<Type, IPrimitiveSerializer> primitiveSerializers; 12 12 13 13 [Storable] 14 private readonly List<I Decomposer> decomposers;15 private readonly Dictionary<Type, I Decomposer> decomposerCache;14 private readonly List<ICompositeSerializer> compositeSerializers; 15 private readonly Dictionary<Type, ICompositeSerializer> compositeSerializerCache; 16 16 17 17 [Storable] … … 19 19 20 20 private Configuration() { 21 decomposerCache = new Dictionary<Type, IDecomposer>();21 compositeSerializerCache = new Dictionary<Type, ICompositeSerializer>(); 22 22 } 23 23 24 public Configuration(IFormat format, IEnumerable<IFormatter> formatters, IEnumerable<IDecomposer> decomposers) { 24 public Configuration(IFormat format, 25 IEnumerable<IPrimitiveSerializer> primitiveSerializers, 26 IEnumerable<ICompositeSerializer> compositeSerializers) { 25 27 this.Format = format; 26 this. formatters = new Dictionary<Type, IFormatter>();27 foreach (I Formatter formatter in formatters) {28 if ( formatter.SerialDataType != format.SerialDataType) {29 throw new ArgumentException("All formatters must have the same IFormat.");28 this.primitiveSerializers = new Dictionary<Type, IPrimitiveSerializer>(); 29 foreach (IPrimitiveSerializer primitiveSerializer in primitiveSerializers) { 30 if (primitiveSerializer.SerialDataType != format.SerialDataType) { 31 throw new ArgumentException("All primitive serializers must have the same IFormat."); 30 32 } 31 this. formatters.Add(formatter.SourceType, formatter);33 this.primitiveSerializers.Add(primitiveSerializer.SourceType, primitiveSerializer); 32 34 } 33 this. decomposers = new List<IDecomposer>(decomposers);34 decomposerCache = new Dictionary<Type, IDecomposer>();35 this.compositeSerializers = new List<ICompositeSerializer>(compositeSerializers); 36 compositeSerializerCache = new Dictionary<Type, ICompositeSerializer>(); 35 37 } 36 38 37 public IEnumerable<I Formatter> Formatters {38 get { return formatters.Values; }39 public IEnumerable<IPrimitiveSerializer> PrimitiveSerializers { 40 get { return primitiveSerializers.Values; } 39 41 } 40 42 41 public IEnumerable<I Decomposer> Decomposers {42 get { return decomposers; }43 public IEnumerable<ICompositeSerializer> CompositeSerializers { 44 get { return compositeSerializers; } 43 45 } 44 46 45 public I Formatter GetFormatter(Type type) {46 I Formatter formatter;47 formatters.TryGetValue(type, out formatter);48 return formatter;47 public IPrimitiveSerializer GetPrimitiveSerializer(Type type) { 48 IPrimitiveSerializer primitiveSerializer; 49 primitiveSerializers.TryGetValue(type, out primitiveSerializer); 50 return primitiveSerializer; 49 51 } 50 52 51 public I Decomposer GetDecomposer(Type type) {52 if ( decomposerCache.ContainsKey(type))53 return decomposerCache[type];54 foreach (I Decomposer d in decomposers) {55 if (d.Can Decompose(type)) {56 decomposerCache.Add(type, d);53 public ICompositeSerializer GetCompositeSerializer(Type type) { 54 if (compositeSerializerCache.ContainsKey(type)) 55 return compositeSerializerCache[type]; 56 foreach (ICompositeSerializer d in compositeSerializers) { 57 if (d.CanSerialize(type)) { 58 compositeSerializerCache.Add(type, d); 57 59 return d; 58 60 } 59 61 } 60 decomposerCache.Add(type, null);62 compositeSerializerCache.Add(type, null); 61 63 return null; 62 64 } -
trunk/sources/HeuristicLab.Persistence/3.3/Core/ConfigurationService.cs
r1703 r1823 17 17 private static ConfigurationService instance; 18 18 private readonly Dictionary<IFormat, Configuration> customConfigurations; 19 public Dictionary<Type, List<I Formatter>> Formatters { get; private set; }20 public List<I Decomposer> Decomposers { get; private set; }19 public Dictionary<Type, List<IPrimitiveSerializer>> PrimitiveSerializers { get; private set; } 20 public List<ICompositeSerializer> CompositeSerializers { get; private set; } 21 21 public List<IFormat> Formats { get; private set; } 22 22 … … 30 30 31 31 private ConfigurationService() { 32 Formatters = new Dictionary<Type, List<IFormatter>>();33 Decomposers = new List<IDecomposer>();32 PrimitiveSerializers = new Dictionary<Type, List<IPrimitiveSerializer>>(); 33 CompositeSerializers = new List<ICompositeSerializer>(); 34 34 customConfigurations = new Dictionary<IFormat, Configuration>(); 35 35 Formats = new List<IFormat>(); … … 94 94 public void Reset() { 95 95 customConfigurations.Clear(); 96 Formatters.Clear();97 Decomposers.Clear();96 PrimitiveSerializers.Clear(); 97 CompositeSerializers.Clear(); 98 98 Assembly defaultAssembly = Assembly.GetExecutingAssembly(); 99 99 DiscoverFrom(defaultAssembly); … … 101 101 if (a != defaultAssembly) 102 102 DiscoverFrom(a); 103 Sort Decomposers();103 SortCompositeSerializers(); 104 104 } 105 105 106 class PriortiySorter : IComparer<I Decomposer> {107 public int Compare(I Decomposer x, IDecomposer y) {106 class PriortiySorter : IComparer<ICompositeSerializer> { 107 public int Compare(ICompositeSerializer x, ICompositeSerializer y) { 108 108 return y.Priority - x.Priority; 109 109 } 110 110 } 111 111 112 protected void Sort Decomposers() {113 Decomposers.Sort(new PriortiySorter());112 protected void SortCompositeSerializers() { 113 CompositeSerializers.Sort(new PriortiySorter()); 114 114 } 115 115 116 116 protected void DiscoverFrom(Assembly a) { 117 117 foreach (Type t in a.GetTypes()) { 118 if (t.GetInterface(typeof(I Formatter).FullName) != null) {118 if (t.GetInterface(typeof(IPrimitiveSerializer).FullName) != null) { 119 119 try { 120 IFormatter formatter = (IFormatter)Activator.CreateInstance(t, true); 121 if (!Formatters.ContainsKey(formatter.SerialDataType)) { 122 Formatters.Add(formatter.SerialDataType, new List<IFormatter>()); 120 IPrimitiveSerializer primitiveSerializer = 121 (IPrimitiveSerializer)Activator.CreateInstance(t, true); 122 if (!PrimitiveSerializers.ContainsKey(primitiveSerializer.SerialDataType)) { 123 PrimitiveSerializers.Add(primitiveSerializer.SerialDataType, new List<IPrimitiveSerializer>()); 123 124 } 124 Formatters[formatter.SerialDataType].Add(formatter);125 Logger.Debug(String.Format("discovered formatter {0} ({1} -> {2})",125 PrimitiveSerializers[primitiveSerializer.SerialDataType].Add(primitiveSerializer); 126 Logger.Debug(String.Format("discovered primitive serializer {0} ({1} -> {2})", 126 127 t.VersionInvariantName(), 127 formatter.SourceType.VersionInvariantName(),128 formatter.SerialDataType.VersionInvariantName()));128 primitiveSerializer.SourceType.AssemblyQualifiedName, 129 primitiveSerializer.SerialDataType.AssemblyQualifiedName)); 129 130 } catch (MissingMethodException e) { 130 Logger.Warn("Could not instantiate " + t. VersionInvariantName(), e);131 Logger.Warn("Could not instantiate " + t.AssemblyQualifiedName, e); 131 132 } catch (ArgumentException e) { 132 Logger.Warn("Could not instantiate " + t. VersionInvariantName(), e);133 Logger.Warn("Could not instantiate " + t.AssemblyQualifiedName, e); 133 134 } 134 135 } 135 if (t.GetInterface(typeof(I Decomposer).FullName) != null) {136 if (t.GetInterface(typeof(ICompositeSerializer).FullName) != null) { 136 137 try { 137 Decomposers.Add((IDecomposer)Activator.CreateInstance(t, true));138 Logger.Debug("discovered decomposer " + t.VersionInvariantName());138 CompositeSerializers.Add((ICompositeSerializer)Activator.CreateInstance(t, true)); 139 Logger.Debug("discovered composite serializer " + t.AssemblyQualifiedName); 139 140 } catch (MissingMethodException e) { 140 Logger.Warn("Could not instantiate " + t. VersionInvariantName(), e);141 Logger.Warn("Could not instantiate " + t.AssemblyQualifiedName, e); 141 142 } catch (ArgumentException e) { 142 Logger.Warn("Could not instantiate " + t. VersionInvariantName(), e);143 Logger.Warn("Could not instantiate " + t.AssemblyQualifiedName, e); 143 144 } 144 145 } … … 150 151 format.Name, 151 152 format.SerialDataType, 152 t. VersionInvariantName()));153 t.AssemblyQualifiedName)); 153 154 } catch (MissingMethodException e) { 154 Logger.Warn("Could not instantiate " + t. VersionInvariantName(), e);155 Logger.Warn("Could not instantiate " + t.AssemblyQualifiedName, e); 155 156 } catch (ArgumentException e) { 156 Logger.Warn("Could not instantiate " + t. VersionInvariantName(), e);157 Logger.Warn("Could not instantiate " + t.AssemblyQualifiedName, e); 157 158 } 158 159 } … … 161 162 162 163 public Configuration GetDefaultConfig(IFormat format) { 163 Dictionary<Type, I Formatter> formatterConfig = new Dictionary<Type, IFormatter>();164 if ( Formatters.ContainsKey(format.SerialDataType)) {165 foreach (I Formatter f in Formatters[format.SerialDataType]) {166 if (! formatterConfig.ContainsKey(f.SourceType))167 formatterConfig.Add(f.SourceType, f);164 Dictionary<Type, IPrimitiveSerializer> primitiveConfig = new Dictionary<Type, IPrimitiveSerializer>(); 165 if (PrimitiveSerializers.ContainsKey(format.SerialDataType)) { 166 foreach (IPrimitiveSerializer f in PrimitiveSerializers[format.SerialDataType]) { 167 if (!primitiveConfig.ContainsKey(f.SourceType)) 168 primitiveConfig.Add(f.SourceType, f); 168 169 } 169 170 } else { 170 171 Logger.Warn(String.Format( 171 "No formatters found for format {0} with serial data type {1}",172 format.GetType(). VersionInvariantName(),173 format.SerialDataType. VersionInvariantName()));172 "No primitive serializers found for format {0} with serial data type {1}", 173 format.GetType().AssemblyQualifiedName, 174 format.SerialDataType.AssemblyQualifiedName)); 174 175 } 175 return new Configuration(format, formatterConfig.Values, Decomposers.Where((d) => d.Priority > 0)); 176 return new Configuration( 177 format, 178 primitiveConfig.Values, 179 CompositeSerializers.Where((d) => d.Priority > 0)); 176 180 } 177 181 -
trunk/sources/HeuristicLab.Persistence/3.3/Core/DeSerializer.cs
r1795 r1823 8 8 9 9 namespace HeuristicLab.Persistence.Core { 10 11 public class TypeLoader {12 13 public static Type Load(string typeNameString) {14 Type type;15 try {16 type = Type.GetType(typeNameString, true);17 } catch (Exception) {18 Logger.Warn(String.Format(19 "Cannot load type \"{0}\", falling back to partial name", typeNameString));20 try {21 TypeName typeName = TypeNameParser.Parse(typeNameString);22 Assembly a = Assembly.LoadWithPartialName(typeName.AssemblyName);23 type = a.GetType(typeName.ToString(false, false), true);24 } catch (Exception) {25 throw new PersistenceException(String.Format(26 "Could not load type \"{0}\"",27 typeNameString));28 }29 try {30 TypeName requestedTypeName = TypeNameParser.Parse(typeNameString);31 TypeName loadedTypeName = TypeNameParser.Parse(type.AssemblyQualifiedName);32 if (!requestedTypeName.IsCompatible(loadedTypeName))33 throw new PersistenceException(String.Format(34 "Serialized type is incompatible with available type: serialized: {0}, loaded: {1}",35 typeNameString,36 type.AssemblyQualifiedName));37 if (requestedTypeName.IsNewerThan(loadedTypeName))38 throw new PersistenceException(String.Format(39 "Serialized type is newer than available type: serialized: {0}, loaded: {1}",40 typeNameString,41 type.AssemblyQualifiedName));42 } catch (PersistenceException) {43 throw;44 } catch (Exception e) {45 Logger.Warn(String.Format(46 "Could not perform version check requested type was {0} while loaded type is {1}:",47 typeNameString,48 type.AssemblyQualifiedName),49 e);50 }51 }52 return type;53 }54 55 }56 10 57 11 public class Deserializer { … … 66 20 private List<Tag> customValues; 67 21 private Type type; 68 private I Decomposer decomposer;22 private ICompositeSerializer compositeSerializer; 69 23 70 24 public Midwife(object value) { … … 72 26 } 73 27 74 public Midwife(Type type, I Decomposer decomposer, int? id) {28 public Midwife(Type type, ICompositeSerializer compositeSerializer, int? id) { 75 29 this.type = type; 76 this. decomposer = decomposer;30 this.compositeSerializer = compositeSerializer; 77 31 this.Id = id; 78 32 MetaMode = false; … … 84 38 if (Obj != null) 85 39 throw new PersistenceException("object already instantiated"); 86 Obj = decomposer.CreateInstance(type, metaInfo);40 Obj = compositeSerializer.CreateInstance(type, metaInfo); 87 41 } 88 42 … … 96 50 97 51 public void Populate() { 98 decomposer.Populate(Obj, customValues, type);52 compositeSerializer.Populate(Obj, customValues, type); 99 53 } 100 54 } … … 159 113 private void CompositeStartHandler(BeginToken token) { 160 114 Type type = typeIds[(int)token.TypeId]; 161 I Decomposer decomposer = null;115 ICompositeSerializer compositeSerializer = null; 162 116 if (serializerMapping.ContainsKey(type)) 163 decomposer = serializerMapping[type] as IDecomposer;164 if ( decomposer == null)117 compositeSerializer = serializerMapping[type] as ICompositeSerializer; 118 if (compositeSerializer == null) 165 119 throw new PersistenceException(String.Format( 166 120 "No suitable method for deserialization of type \"{0}\" found.", 167 121 type.VersionInvariantName())); 168 parentStack.Push(new Midwife(type, decomposer, token.Id));122 parentStack.Push(new Midwife(type, compositeSerializer, token.Id)); 169 123 } 170 124 … … 180 134 private void PrimitiveHandler(PrimitiveToken token) { 181 135 Type type = typeIds[(int)token.TypeId]; 182 object value = ((I Formatter)serializerMapping[type]).Parse(token.SerialData);136 object value = ((IPrimitiveSerializer)serializerMapping[type]).Parse(token.SerialData); 183 137 if (token.Id != null) 184 138 id2obj[(int)token.Id] = value; -
trunk/sources/HeuristicLab.Persistence/3.3/Core/PersistenceException.cs
r1659 r1823 3 3 using HeuristicLab.Persistence.Interfaces; 4 4 using HeuristicLab.Persistence.Core.Tokens; 5 using HeuristicLab.Persistence.Default. Decomposers.Storable;5 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 6 6 7 7 namespace HeuristicLab.Persistence.Core { -
trunk/sources/HeuristicLab.Persistence/3.3/Core/PrimitiveSerializerBase.cs
r1805 r1823 4 4 namespace HeuristicLab.Persistence.Interfaces { 5 5 6 public abstract class FormatterBase<Source, SerialData> : IFormatter<Source, SerialData> where SerialData : ISerialData { 6 public abstract class PrimitiveSerializerBase<Source, SerialData> : 7 IPrimitiveSerializer<Source, SerialData> 8 where SerialData : ISerialData { 7 9 8 10 public abstract SerialData Format(Source o); … … 14 16 public Type SourceType { get { return typeof(Source); } } 15 17 16 ISerialData I Formatter.Format(object o) {18 ISerialData IPrimitiveSerializer.Format(object o) { 17 19 return Format((Source)o); 18 20 } 19 21 20 object I Formatter.Parse(ISerialData o) {22 object IPrimitiveSerializer.Parse(ISerialData o) { 21 23 return Parse((SerialData)o); 22 24 } -
trunk/sources/HeuristicLab.Persistence/3.3/Core/Serializer.cs
r1797 r1823 6 6 using HeuristicLab.Persistence.Interfaces; 7 7 using HeuristicLab.Persistence.Core.Tokens; 8 using HeuristicLab.Persistence.Default. Decomposers.Storable;8 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 9 9 using System.Text; 10 10 using System.Reflection; … … 17 17 class ReferenceEqualityComparer : IEqualityComparer<object> { 18 18 19 public bool Equals(object a, object b) {19 public new bool Equals(object a, object b) { 20 20 return Object.ReferenceEquals(a, b); 21 21 } … … 56 56 foreach (var pair in typeCache) { 57 57 string serializer = null; 58 I Formatter f = configuration.GetFormatter(pair.Key);58 IPrimitiveSerializer f = configuration.GetPrimitiveSerializer(pair.Key); 59 59 if (f != null) { 60 60 serializer = f.GetType().AssemblyQualifiedName; 61 61 assemblies[f.GetType().Assembly] = true; 62 62 } else { 63 I Decomposer d = configuration.GetDecomposer(pair.Key);63 ICompositeSerializer d = configuration.GetCompositeSerializer(pair.Key); 64 64 serializer = d.GetType().AssemblyQualifiedName; 65 65 assemblies[d.GetType().Assembly] = true; … … 109 109 obj2id.Add(value, (int)id); 110 110 } 111 I Formatter formatter = configuration.GetFormatter(type);112 if ( formatter != null)113 return PrimitiveEnumerator(accessor.Name, typeId, formatter.Format(value), id);114 I Decomposer decomposer = configuration.GetDecomposer(type);115 if ( decomposer != null)116 return CompositeEnumerator(accessor.Name, decomposer.Decompose(value), id, typeId, decomposer.CreateMetaInfo(value));111 IPrimitiveSerializer primitiveSerializer = configuration.GetPrimitiveSerializer(type); 112 if (primitiveSerializer != null) 113 return PrimitiveEnumerator(accessor.Name, typeId, primitiveSerializer.Format(value), id); 114 ICompositeSerializer compositeSerializer = configuration.GetCompositeSerializer(type); 115 if (compositeSerializer != null) 116 return CompositeEnumerator(accessor.Name, compositeSerializer.Decompose(value), id, typeId, compositeSerializer.CreateMetaInfo(value)); 117 117 throw new PersistenceException( 118 118 String.Format( 119 119 "No suitable method for serializing values of type \"{0}\" found\r\n" + 120 " Formatters:\r\n{1}\r\n" +121 " Decomposers:\r\n{2}",120 "primitive serializers:\r\n{1}\r\n" + 121 "composite serializers:\r\n{2}", 122 122 value.GetType().VersionInvariantName(), 123 string.Join("\r\n", configuration. Formatters.Select(f => f.GetType().VersionInvariantName()).ToArray()),124 string.Join("\r\n", configuration. Decomposers.Select(d => d.GetType().VersionInvariantName()).ToArray())123 string.Join("\r\n", configuration.PrimitiveSerializers.Select(f => f.GetType().VersionInvariantName()).ToArray()), 124 string.Join("\r\n", configuration.CompositeSerializers.Select(d => d.GetType().VersionInvariantName()).ToArray()) 125 125 )); 126 126 -
trunk/sources/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/ArraySerializer.cs
r1805 r1823 3 3 using HeuristicLab.Persistence.Interfaces; 4 4 using System.Collections.Generic; 5 using HeuristicLab.Persistence.Default. Decomposers.Storable;5 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 6 6 7 namespace HeuristicLab.Persistence.Default. Decomposers {7 namespace HeuristicLab.Persistence.Default.CompositeSerializers { 8 8 9 9 [EmptyStorableClass] 10 public class Array Decomposer : IDecomposer {10 public class ArraySerializer : ICompositeSerializer { 11 11 12 12 public int Priority { … … 14 14 } 15 15 16 public bool Can Decompose(Type type) {16 public bool CanSerialize(Type type) { 17 17 return type.IsArray || type == typeof(Array); 18 18 } -
trunk/sources/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/CompactNumberArray2StringSerializer.cs
r1805 r1823 6 6 using System.Globalization; 7 7 using System.Text; 8 using HeuristicLab.Persistence.Default. Decomposers.Storable;8 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 9 9 10 namespace HeuristicLab.Persistence.Default. Decomposers {10 namespace HeuristicLab.Persistence.Default.CompositeSerializers { 11 11 12 12 [EmptyStorableClass] 13 public class CompactNumberArray2String Decomposer : IDecomposer {13 public class CompactNumberArray2StringSerializer : ICompositeSerializer { 14 14 15 15 public int Priority { … … 17 17 } 18 18 19 private static readonly Number2String Decomposer numberConverter =20 new Number2String Decomposer();19 private static readonly Number2StringSerializer numberConverter = 20 new Number2StringSerializer(); 21 21 22 public bool Can Decompose(Type type) {22 public bool CanSerialize(Type type) { 23 23 return 24 24 (type.IsArray || type == typeof(Array)) && 25 numberConverter.Can Decompose(type.GetElementType());25 numberConverter.CanSerialize(type.GetElementType()); 26 26 } 27 27 -
trunk/sources/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/DictionarySerializer.cs
r1805 r1823 4 4 using HeuristicLab.Persistence.Interfaces; 5 5 using System.Collections.Generic; 6 using HeuristicLab.Persistence.Default. Decomposers.Storable;6 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 7 7 using HeuristicLab.Persistence.Auxiliary; 8 8 9 namespace HeuristicLab.Persistence.Default. Decomposers {9 namespace HeuristicLab.Persistence.Default.CompositeSerializers { 10 10 11 11 [EmptyStorableClass] 12 public class Dictionary Decomposer : IDecomposer {12 public class DictionarySerializer : ICompositeSerializer { 13 13 14 14 public int Priority { … … 17 17 18 18 19 public bool Can Decompose(Type type) {19 public bool CanSerialize(Type type) { 20 20 return ReflectionTools.HasDefaultConstructor(type) && 21 21 type.GetInterface(typeof(IDictionary).FullName) != null; -
trunk/sources/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/EnumSerializer.cs
r1805 r1823 3 3 using HeuristicLab.Persistence.Interfaces; 4 4 using System.Collections.Generic; 5 using HeuristicLab.Persistence.Default. Decomposers.Storable;5 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 6 6 7 namespace HeuristicLab.Persistence.Default. Decomposers {7 namespace HeuristicLab.Persistence.Default.CompositeSerializers { 8 8 9 9 [EmptyStorableClass] 10 public class Enum Decomposer : IDecomposer {10 public class EnumSerializer : ICompositeSerializer { 11 11 12 12 public int Priority { … … 14 14 } 15 15 16 public bool Can Decompose(Type type) {16 public bool CanSerialize(Type type) { 17 17 return type.IsEnum || type == typeof(Enum); 18 18 } -
trunk/sources/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/EnumerableSerializer.cs
r1805 r1823 5 5 using HeuristicLab.Persistence.Interfaces; 6 6 using System.Collections.Generic; 7 using HeuristicLab.Persistence.Default. Decomposers.Storable;7 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 8 8 using HeuristicLab.Persistence.Auxiliary; 9 9 10 namespace HeuristicLab.Persistence.Default. Decomposers {10 namespace HeuristicLab.Persistence.Default.CompositeSerializers { 11 11 12 12 [EmptyStorableClass] 13 public class Enumerable Decomposer : IDecomposer {13 public class EnumerableSerializer : ICompositeSerializer { 14 14 15 15 public int Priority { … … 18 18 19 19 20 public bool Can Decompose(Type type) {20 public bool CanSerialize(Type type) { 21 21 return 22 22 ReflectionTools.HasDefaultConstructor(type) && -
trunk/sources/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/KeyValuePairSerializer.cs
r1805 r1823 5 5 using HeuristicLab.Persistence.Interfaces; 6 6 using System.Reflection; 7 using HeuristicLab.Persistence.Default. Decomposers.Storable;7 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 8 8 9 namespace HeuristicLab.Persistence.Default. Decomposers {9 namespace HeuristicLab.Persistence.Default.CompositeSerializers { 10 10 11 11 [EmptyStorableClass] 12 public class KeyValuePair Decomposer : IDecomposer {12 public class KeyValuePairSerializer : ICompositeSerializer { 13 13 14 14 public int Priority { … … 17 17 18 18 19 public bool Can Decompose(Type type) {19 public bool CanSerialize(Type type) { 20 20 return type.IsGenericType && 21 21 type.GetGenericTypeDefinition() == -
trunk/sources/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/Number2StringSerializer.cs
r1805 r1823 8 8 using System.Text; 9 9 10 namespace HeuristicLab.Persistence.Default. Decomposers {10 namespace HeuristicLab.Persistence.Default.CompositeSerializers { 11 11 12 public class Number2String Decomposer : IDecomposer {12 public class Number2StringSerializer : ICompositeSerializer { 13 13 14 14 private static readonly List<Type> numberTypes = … … 30 30 private static readonly Dictionary<Type, MethodInfo> numberParsers; 31 31 32 static Number2String Decomposer() {32 static Number2StringSerializer() { 33 33 numberParsers = new Dictionary<Type, MethodInfo>(); 34 34 foreach (var type in numberTypes) { … … 39 39 } 40 40 41 public bool Can Decompose(Type type) {41 public bool CanSerialize(Type type) { 42 42 return numberParsers.ContainsKey(type); 43 43 } … … 66 66 } 67 67 68 69 #region IDecomposer Members70 68 71 69 public int Priority { … … 99 97 // numbers are composed just of meta info, no need to populate 100 98 } 101 102 #endregion103 99 } 104 105 100 } -
trunk/sources/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/NumberEnumerable2StringSerializer.cs
r1805 r1823 6 6 using System.Globalization; 7 7 using System.Text; 8 using HeuristicLab.Persistence.Default. Decomposers.Storable;8 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 9 9 using HeuristicLab.Persistence.Auxiliary; 10 10 11 namespace HeuristicLab.Persistence.Default. Decomposers {11 namespace HeuristicLab.Persistence.Default.CompositeSerializers { 12 12 13 13 [EmptyStorableClass] 14 public class NumberEnumerable2String Decomposer : IDecomposer {14 public class NumberEnumerable2StringSerializer : ICompositeSerializer { 15 15 16 16 public int Priority { … … 18 18 } 19 19 20 private static readonly Number2String Decomposer numberConverter =21 new Number2String Decomposer();20 private static readonly Number2StringSerializer numberConverter = 21 new Number2StringSerializer(); 22 22 23 23 private static readonly Dictionary<Type, Type> interfaceCache = new Dictionary<Type, Type>(); … … 29 29 if (iface.IsGenericType && 30 30 iface.GetGenericTypeDefinition() == typeof(IEnumerable<>) && 31 numberConverter.Can Decompose(iface.GetGenericArguments()[0])) {31 numberConverter.CanSerialize(iface.GetGenericArguments()[0])) { 32 32 interfaceCache.Add(type, iface); 33 33 return iface; … … 53 53 } 54 54 55 public bool Can Decompose(Type type) {55 public bool CanSerialize(Type type) { 56 56 return 57 57 ReflectionTools.HasDefaultConstructor(type) && -
trunk/sources/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/StackSerializer.cs
r1805 r1823 5 5 using HeuristicLab.Persistence.Interfaces; 6 6 using System.Collections.Generic; 7 using HeuristicLab.Persistence.Default. Decomposers.Storable;7 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 8 8 using System.IO; 9 9 10 namespace HeuristicLab.Persistence.Default. Decomposers {10 namespace HeuristicLab.Persistence.Default.CompositeSerializers { 11 11 12 12 [EmptyStorableClass] 13 public class Stack Decomposer : IDecomposer {13 public class StackSerializer : ICompositeSerializer { 14 14 15 15 public int Priority { … … 18 18 19 19 20 public bool Can Decompose(Type type) {20 public bool CanSerialize(Type type) { 21 21 return type == typeof(Stack) || 22 22 type.IsGenericType && -
trunk/sources/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/Storable/DataMemberAccessor.cs
r1625 r1823 3 3 using HeuristicLab.Persistence.Core; 4 4 5 namespace HeuristicLab.Persistence.Default. Decomposers.Storable {5 namespace HeuristicLab.Persistence.Default.CompositeSerializers.Storable { 6 6 7 7 public class DataMemberAccessor { -
trunk/sources/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/Storable/EmptyStorableClassAttribute.cs
r1652 r1823 3 3 using System.Reflection; 4 4 5 namespace HeuristicLab.Persistence.Default. Decomposers.Storable {5 namespace HeuristicLab.Persistence.Default.CompositeSerializers.Storable { 6 6 7 7 -
trunk/sources/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/Storable/StorableAttribute.cs
r1623 r1823 3 3 using System.Reflection; 4 4 5 namespace HeuristicLab.Persistence.Default. Decomposers.Storable {5 namespace HeuristicLab.Persistence.Default.CompositeSerializers.Storable { 6 6 7 7 [AttributeUsage( -
trunk/sources/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/Storable/StorableSerializer.cs
r1805 r1823 7 7 using HeuristicLab.Persistence.Auxiliary; 8 8 9 namespace HeuristicLab.Persistence.Default. Decomposers.Storable {9 namespace HeuristicLab.Persistence.Default.CompositeSerializers.Storable { 10 10 11 11 [EmptyStorableClass] 12 public class Storable Decomposer : IDecomposer {12 public class StorableSerializer : ICompositeSerializer { 13 13 14 14 public int Priority { … … 16 16 } 17 17 18 public bool Can Decompose(Type type) {18 public bool CanSerialize(Type type) { 19 19 return ReflectionTools.HasDefaultConstructor(type) && 20 20 (StorableAttribute.GetStorableMembers(type, false).Count() > 0 || -
trunk/sources/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/TypeSerializer.cs
r1805 r1823 4 4 using HeuristicLab.Persistence.Interfaces; 5 5 using System.Collections.Generic; 6 using HeuristicLab.Persistence.Default. Decomposers.Storable;6 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 7 7 8 namespace HeuristicLab.Persistence.Default. Decomposers {8 namespace HeuristicLab.Persistence.Default.CompositeSerializers { 9 9 10 10 [EmptyStorableClass] 11 public class Type Decomposer : IDecomposer {11 public class TypeSerializer : ICompositeSerializer { 12 12 13 13 public int Priority { … … 15 15 } 16 16 17 public bool Can Decompose(Type type) {17 public bool CanSerialize(Type type) { 18 18 return type == typeof(Type) || 19 19 type.VersionInvariantName() == "System.RuntimeType, mscorlib"; -
trunk/sources/HeuristicLab.Persistence/3.3/Default/DebugString/DebugString.cs
r1659 r1823 6 6 using HeuristicLab.Persistence.Core; 7 7 using HeuristicLab.Persistence.Core.Tokens; 8 using HeuristicLab.Persistence.Default. Decomposers.Storable;8 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 9 9 10 10 namespace HeuristicLab.Persistence.Default.DebugString { -
trunk/sources/HeuristicLab.Persistence/3.3/Default/DebugString/DebugStringFormat.cs
r1659 r1823 6 6 using HeuristicLab.Persistence.Core; 7 7 using HeuristicLab.Persistence.Core.Tokens; 8 using HeuristicLab.Persistence.Default. Decomposers.Storable;8 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 9 9 10 10 namespace HeuristicLab.Persistence.Default.DebugString { -
trunk/sources/HeuristicLab.Persistence/3.3/Default/DebugString/PrimitiveSerializers/Bool2DebugStringSerializer.cs
r1805 r1823 6 6 using HeuristicLab.Persistence.Core; 7 7 using HeuristicLab.Persistence.Core.Tokens; 8 using HeuristicLab.Persistence.Default. Decomposers.Storable;8 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 9 9 10 namespace HeuristicLab.Persistence.Default.DebugString. Formatters {10 namespace HeuristicLab.Persistence.Default.DebugString.PrimitiveSerializers { 11 11 12 12 [EmptyStorableClass] 13 public class Bool2DebugString Formatter : DebugStringFormatterBase<bool> { }13 public class Bool2DebugStringSerializer : DebugStringSerializerBase<bool> { } 14 14 15 15 } -
trunk/sources/HeuristicLab.Persistence/3.3/Default/DebugString/PrimitiveSerializers/Byte2DebugStringSerializer.cs
r1805 r1823 6 6 using HeuristicLab.Persistence.Core; 7 7 using HeuristicLab.Persistence.Core.Tokens; 8 using HeuristicLab.Persistence.Default. Decomposers.Storable;8 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 9 9 10 namespace HeuristicLab.Persistence.Default.DebugString. Formatters {10 namespace HeuristicLab.Persistence.Default.DebugString.PrimitiveSerializers { 11 11 12 12 [EmptyStorableClass] 13 public class Byte2DebugString Formatter : DebugStringFormatterBase<byte> { }13 public class Byte2DebugStringSerializer : DebugStringSerializerBase<byte> { } 14 14 15 15 } -
trunk/sources/HeuristicLab.Persistence/3.3/Default/DebugString/PrimitiveSerializers/Char2DebugStringSerializer.cs
r1805 r1823 6 6 using HeuristicLab.Persistence.Core; 7 7 using HeuristicLab.Persistence.Core.Tokens; 8 using HeuristicLab.Persistence.Default. Decomposers.Storable;8 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 9 9 10 namespace HeuristicLab.Persistence.Default.DebugString. Formatters {10 namespace HeuristicLab.Persistence.Default.DebugString.PrimitiveSerializers { 11 11 12 12 [EmptyStorableClass] 13 public class Char2DebugString Formatter : DebugStringFormatterBase<char> { }13 public class Char2DebugStringSerializer : DebugStringSerializerBase<char> { } 14 14 15 15 } -
trunk/sources/HeuristicLab.Persistence/3.3/Default/DebugString/PrimitiveSerializers/DateTime2DebugStringSerializer.cs
r1805 r1823 6 6 using HeuristicLab.Persistence.Core; 7 7 using HeuristicLab.Persistence.Core.Tokens; 8 using HeuristicLab.Persistence.Default. Decomposers.Storable;8 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 9 9 10 namespace HeuristicLab.Persistence.Default.DebugString. Formatters {10 namespace HeuristicLab.Persistence.Default.DebugString.PrimitiveSerializers { 11 11 12 12 [EmptyStorableClass] 13 public class DateTime2DebugString Formatter : DebugStringFormatterBase<DateTime> { }13 public class DateTime2DebugStringSerializer : DebugStringSerializerBase<DateTime> { } 14 14 15 15 } -
trunk/sources/HeuristicLab.Persistence/3.3/Default/DebugString/PrimitiveSerializers/Doubld2DebugStringSerializer.cs
r1805 r1823 6 6 using HeuristicLab.Persistence.Core; 7 7 using HeuristicLab.Persistence.Core.Tokens; 8 using HeuristicLab.Persistence.Default. Decomposers.Storable;8 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 9 9 10 namespace HeuristicLab.Persistence.Default.DebugString. Formatters {10 namespace HeuristicLab.Persistence.Default.DebugString.PrimitiveSerializers { 11 11 12 12 [EmptyStorableClass] 13 public class Double2DebugString Formatter : DebugStringFormatterBase<double> { }13 public class Double2DebugStringSerializer : DebugStringSerializerBase<double> { } 14 14 15 15 } -
trunk/sources/HeuristicLab.Persistence/3.3/Default/DebugString/PrimitiveSerializers/Float2DebugStringSerializer.cs
r1805 r1823 6 6 using HeuristicLab.Persistence.Core; 7 7 using HeuristicLab.Persistence.Core.Tokens; 8 using HeuristicLab.Persistence.Default. Decomposers.Storable;8 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 9 9 10 namespace HeuristicLab.Persistence.Default.DebugString. Formatters {10 namespace HeuristicLab.Persistence.Default.DebugString.PrimitiveSerializers { 11 11 12 12 [EmptyStorableClass] 13 public class Float2DebugString Formatter : DebugStringFormatterBase<float> { }13 public class Float2DebugStringSerializer : DebugStringSerializerBase<float> { } 14 14 15 15 } -
trunk/sources/HeuristicLab.Persistence/3.3/Default/DebugString/PrimitiveSerializers/Int2DebugStringSerializer.cs
r1805 r1823 6 6 using HeuristicLab.Persistence.Core; 7 7 using HeuristicLab.Persistence.Core.Tokens; 8 using HeuristicLab.Persistence.Default. Decomposers.Storable;8 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 9 9 10 namespace HeuristicLab.Persistence.Default.DebugString. Formatters {10 namespace HeuristicLab.Persistence.Default.DebugString.PrimitiveSerializers { 11 11 12 12 [EmptyStorableClass] 13 public class Int2DebugString Formatter : DebugStringFormatterBase<int> { }13 public class Int2DebugStringSerializer : DebugStringSerializerBase<int> { } 14 14 15 15 } -
trunk/sources/HeuristicLab.Persistence/3.3/Default/DebugString/PrimitiveSerializers/Long2DebugStringSerializer.cs
r1805 r1823 6 6 using HeuristicLab.Persistence.Core; 7 7 using HeuristicLab.Persistence.Core.Tokens; 8 using HeuristicLab.Persistence.Default. Decomposers.Storable;8 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 9 9 10 namespace HeuristicLab.Persistence.Default.DebugString. Formatters {10 namespace HeuristicLab.Persistence.Default.DebugString.PrimitiveSerializers { 11 11 12 12 [EmptyStorableClass] 13 public class Long2DebugString Formatter : DebugStringFormatterBase<long> { }13 public class Long2DebugStringSerializer : DebugStringSerializerBase<long> { } 14 14 15 15 } -
trunk/sources/HeuristicLab.Persistence/3.3/Default/DebugString/PrimitiveSerializers/SByte2DebugStringSerializer.cs
r1805 r1823 6 6 using HeuristicLab.Persistence.Core; 7 7 using HeuristicLab.Persistence.Core.Tokens; 8 using HeuristicLab.Persistence.Default. Decomposers.Storable;8 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 9 9 10 namespace HeuristicLab.Persistence.Default.DebugString. Formatters {10 namespace HeuristicLab.Persistence.Default.DebugString.PrimitiveSerializers { 11 11 12 12 [EmptyStorableClass] 13 public class SByte2DebugString Formatter : DebugStringFormatterBase<sbyte> { }13 public class SByte2DebugStringSerializer : DebugStringSerializerBase<sbyte> { } 14 14 15 15 } -
trunk/sources/HeuristicLab.Persistence/3.3/Default/DebugString/PrimitiveSerializers/Short2DebugStringSerializer.cs
r1805 r1823 6 6 using HeuristicLab.Persistence.Core; 7 7 using HeuristicLab.Persistence.Core.Tokens; 8 using HeuristicLab.Persistence.Default. Decomposers.Storable;8 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 9 9 10 namespace HeuristicLab.Persistence.Default.DebugString. Formatters {10 namespace HeuristicLab.Persistence.Default.DebugString.PrimitiveSerializers { 11 11 12 12 [EmptyStorableClass] 13 public class Short2DebugString Formatter : DebugStringFormatterBase<short> { }13 public class Short2DebugStringSerializer : DebugStringSerializerBase<short> { } 14 14 15 15 } -
trunk/sources/HeuristicLab.Persistence/3.3/Default/DebugString/PrimitiveSerializers/String2DebugStringSerializer.cs
r1805 r1823 6 6 using HeuristicLab.Persistence.Core; 7 7 using HeuristicLab.Persistence.Core.Tokens; 8 using HeuristicLab.Persistence.Default. Decomposers.Storable;8 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 9 9 10 namespace HeuristicLab.Persistence.Default.DebugString. Formatters {10 namespace HeuristicLab.Persistence.Default.DebugString.PrimitiveSerializers { 11 11 12 12 [EmptyStorableClass] 13 public class String2DebugString Formatter : DebugStringFormatterBase<string> { }13 public class String2DebugStringSerializer : DebugStringSerializerBase<string> { } 14 14 15 15 } -
trunk/sources/HeuristicLab.Persistence/3.3/Default/DebugString/PrimitiveSerializers/Type2DebugStringSerializer.cs
r1805 r1823 6 6 using HeuristicLab.Persistence.Core; 7 7 using HeuristicLab.Persistence.Core.Tokens; 8 using HeuristicLab.Persistence.Default. Decomposers.Storable;8 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 9 9 10 namespace HeuristicLab.Persistence.Default.DebugString. Formatters {10 namespace HeuristicLab.Persistence.Default.DebugString.PrimitiveSerializers { 11 11 12 12 [EmptyStorableClass] 13 public class Type2DebugString Formatter : DebugStringFormatterBase<Type> { }13 public class Type2DebugStringSerializer : DebugStringSerializerBase<Type> { } 14 14 15 15 } -
trunk/sources/HeuristicLab.Persistence/3.3/Default/DebugString/PrimitiveSerializers/UInt2DebugStringSerializer.cs
r1805 r1823 6 6 using HeuristicLab.Persistence.Core; 7 7 using HeuristicLab.Persistence.Core.Tokens; 8 using HeuristicLab.Persistence.Default. Decomposers.Storable;8 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 9 9 10 namespace HeuristicLab.Persistence.Default.DebugString. Formatters {10 namespace HeuristicLab.Persistence.Default.DebugString.PrimitiveSerializers { 11 11 12 12 [EmptyStorableClass] 13 public class UInt2DebugString Formatter : DebugStringFormatterBase<uint> { }13 public class UInt2DebugStringSerializer : DebugStringSerializerBase<uint> { } 14 14 15 15 } -
trunk/sources/HeuristicLab.Persistence/3.3/Default/DebugString/PrimitiveSerializers/ULong2DebugStringSerializer.cs
r1805 r1823 6 6 using HeuristicLab.Persistence.Core; 7 7 using HeuristicLab.Persistence.Core.Tokens; 8 using HeuristicLab.Persistence.Default. Decomposers.Storable;8 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 9 9 10 namespace HeuristicLab.Persistence.Default.DebugString. Formatters {10 namespace HeuristicLab.Persistence.Default.DebugString.PrimitiveSerializers { 11 11 12 12 [EmptyStorableClass] 13 public class ULong2DebugString Formatter : DebugStringFormatterBase<ulong> { }13 public class ULong2DebugStringSerializer : DebugStringSerializerBase<ulong> { } 14 14 15 15 } -
trunk/sources/HeuristicLab.Persistence/3.3/Default/DebugString/PrimitiveSerializers/UShort2DebugStringSerializer.cs
r1805 r1823 6 6 using HeuristicLab.Persistence.Core; 7 7 using HeuristicLab.Persistence.Core.Tokens; 8 using HeuristicLab.Persistence.Default. Decomposers.Storable;8 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 9 9 10 namespace HeuristicLab.Persistence.Default.DebugString. Formatters {10 namespace HeuristicLab.Persistence.Default.DebugString.PrimitiveSerializers { 11 11 12 12 [EmptyStorableClass] 13 public class UShort2DebugString Formatter : DebugStringFormatterBase<ushort> { }13 public class UShort2DebugStringSerializer : DebugStringSerializerBase<ushort> { } 14 14 15 15 } -
trunk/sources/HeuristicLab.Persistence/3.3/Default/DebugString/PrimitiveSerializers/ValueType2DebugStringSerializerBase.cs
r1805 r1823 7 7 using HeuristicLab.Persistence.Core.Tokens; 8 8 9 namespace HeuristicLab.Persistence.Default.DebugString. Formatters {9 namespace HeuristicLab.Persistence.Default.DebugString.PrimitiveSerializers { 10 10 11 public abstract class DebugString FormatterBase<T> : FormatterBase<T, DebugString> {11 public abstract class DebugStringSerializerBase<T> : PrimitiveSerializerBase<T, DebugString> { 12 12 public override DebugString Format(T o) { return new DebugString(o.ToString()); } 13 13 public override T Parse(DebugString s) { -
trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/Compact/CompactXmlSerializerBase.cs
r1805 r1823 1 1 using HeuristicLab.Persistence.Interfaces; 2 2 using HeuristicLab.Persistence.Core; 3 using HeuristicLab.Persistence.Default. Decomposers.Storable;3 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 4 4 5 5 namespace HeuristicLab.Persistence.Default.Xml.Compact { 6 6 7 public abstract class CompactXml FormatterBase<T> : XmlFormatterBase<T> { }7 public abstract class CompactXmlSerializerBase<T> : XmlSerializerBase<T> { } 8 8 9 9 } -
trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/Compact/DoubleArray2XmlSerializer.cs
r1805 r1823 2 2 using HeuristicLab.Persistence.Core; 3 3 using System.Globalization; 4 using HeuristicLab.Persistence.Default. Decomposers.Storable;4 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 5 5 6 6 namespace HeuristicLab.Persistence.Default.Xml.Compact { 7 7 8 public abstract class DoubleArray2Xml FormatterBase<T> : NumberArray2XmlFormatterBase<T> where T : class{8 public abstract class DoubleArray2XmlSerializerBase<T> : NumberArray2XmlSerializerBase<T> where T : class{ 9 9 10 10 protected override string FormatValue(object o) { … … 18 18 19 19 [EmptyStorableClass] 20 public class Double1DArray2Xml Formatter : DoubleArray2XmlFormatterBase<double[]> { }20 public class Double1DArray2XmlSerializer : DoubleArray2XmlSerializerBase<double[]> { } 21 21 22 22 23 23 [EmptyStorableClass] 24 public class Double2DArray2Xml Formatter : DoubleArray2XmlFormatterBase<double[,]> { }24 public class Double2DArray2XmlSerializer : DoubleArray2XmlSerializerBase<double[,]> { } 25 25 26 26 [EmptyStorableClass] 27 public class Double3DArray2Xml Formatter : DoubleArray2XmlFormatterBase<double[, ,]> { }27 public class Double3DArray2XmlSerializer : DoubleArray2XmlSerializerBase<double[, ,]> { } 28 28 29 29 } -
trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/Compact/DoubleList2XmlSerializer.cs
r1805 r1823 4 4 using HeuristicLab.Persistence.Core; 5 5 using System.Globalization; 6 using HeuristicLab.Persistence.Default. Decomposers.Storable;6 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 7 7 8 8 namespace HeuristicLab.Persistence.Default.Xml.Compact { 9 9 10 10 [EmptyStorableClass] 11 public class DoubleList2Xml Formatter : NumberEnumeration2XmlFormatterBase<List<double>> {11 public class DoubleList2XmlSerializer : NumberEnumeration2XmlSerializerBase<List<double>> { 12 12 13 13 protected override void Add(IEnumerable enumeration, object o) { -
trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/Compact/IntArray2XmlSerializer.cs
r1805 r1823 1 1 using System; 2 2 using HeuristicLab.Persistence.Core; 3 using HeuristicLab.Persistence.Default. Decomposers.Storable;3 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 4 4 5 5 namespace HeuristicLab.Persistence.Default.Xml.Compact { 6 6 7 public abstract class IntArray2Xml FormatterBase<T> : NumberArray2XmlFormatterBase<T> where T : class{7 public abstract class IntArray2XmlSerializerBase<T> : NumberArray2XmlSerializerBase<T> where T : class{ 8 8 9 9 protected override string FormatValue(object o) { … … 17 17 18 18 [EmptyStorableClass] 19 public class Int1DArray2Xml Formatter : IntArray2XmlFormatterBase<int[]> { }19 public class Int1DArray2XmlSerializer : IntArray2XmlSerializerBase<int[]> { } 20 20 21 21 [EmptyStorableClass] 22 public class Int2DArray2Xml Formatter : IntArray2XmlFormatterBase<int[,]> { }22 public class Int2DArray2XmlSerializer : IntArray2XmlSerializerBase<int[,]> { } 23 23 24 24 [EmptyStorableClass] 25 public class Int3DArray2Xml Formatter : IntArray2XmlFormatterBase<int[, ,]> { }25 public class Int3DArray2XmlSerializer : IntArray2XmlSerializerBase<int[, ,]> { } 26 26 27 27 } -
trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/Compact/IntList2XmlSerializer.cs
r1805 r1823 3 3 using System; 4 4 using HeuristicLab.Persistence.Core; 5 using HeuristicLab.Persistence.Default. Decomposers.Storable;5 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 6 6 7 7 namespace HeuristicLab.Persistence.Default.Xml.Compact { 8 8 9 9 [EmptyStorableClass] 10 public class IntList2Xml Formatter : NumberEnumeration2XmlFormatterBase<List<int>> {10 public class IntList2XmlSerializer : NumberEnumeration2XmlSerializerBase<List<int>> { 11 11 12 12 protected override void Add(IEnumerable enumeration, object o) { -
trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/Compact/NumberArray2XmlSerializerBase.cs
r1805 r1823 7 7 namespace HeuristicLab.Persistence.Default.Xml.Compact { 8 8 9 public abstract class NumberArray2Xml FormatterBase<T> : CompactXmlFormatterBase<T> where T : class {9 public abstract class NumberArray2XmlSerializerBase<T> : CompactXmlSerializerBase<T> where T : class { 10 10 11 11 protected virtual string Separator { get { return ";"; } } -
trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/Compact/NumberEnumeration2XmlSerializerBase.cs
r1805 r1823 7 7 namespace HeuristicLab.Persistence.Default.Xml.Compact { 8 8 9 public abstract class NumberEnumeration2Xml FormatterBase<T> : CompactXmlFormatterBase<T> where T : IEnumerable {9 public abstract class NumberEnumeration2XmlSerializerBase<T> : CompactXmlSerializerBase<T> where T : IEnumerable { 10 10 11 11 protected virtual string Separator { get { return ";"; } } -
trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/Primitive/Bool2XmlSerializer.cs
r1805 r1823 4 4 using System.Reflection; 5 5 using System.Globalization; 6 using HeuristicLab.Persistence.Default. Decomposers.Storable;6 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 7 7 8 8 namespace HeuristicLab.Persistence.Default.Xml.Primitive { 9 9 10 10 [EmptyStorableClass] 11 public class Bool2Xml Formatter : SimpleNumber2XmlFormatterBase<bool> { }11 public class Bool2XmlSerializer : SimpleNumber2XmlSerializerBase<bool> { } 12 12 13 13 } -
trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/Primitive/Byte2XmlSerializer.cs
r1805 r1823 4 4 using System.Reflection; 5 5 using System.Globalization; 6 using HeuristicLab.Persistence.Default. Decomposers.Storable;6 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 7 7 8 8 namespace HeuristicLab.Persistence.Default.Xml.Primitive { 9 9 10 10 [EmptyStorableClass] 11 public class Byte2Xml Formatter : SimpleNumber2XmlFormatterBase<byte> { }11 public class Byte2XmlSerializer : SimpleNumber2XmlSerializerBase<byte> { } 12 12 13 13 } -
trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/Primitive/Char2XmlFormatter.cs
r1652 r1823 4 4 using System.Reflection; 5 5 using System.Globalization; 6 using HeuristicLab.Persistence.Default. Decomposers.Storable;6 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 7 7 8 8 namespace HeuristicLab.Persistence.Default.Xml.Primitive { 9 9 10 10 [EmptyStorableClass] 11 public class Char2Xml Formatter : FormatterBase<char, XmlString> {11 public class Char2XmlSerializer : PrimitiveSerializerBase<char, XmlString> { 12 12 13 13 public override XmlString Format(char c) { -
trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/Primitive/DateTime2XmlSerializer.cs
r1805 r1823 2 2 using HeuristicLab.Persistence.Core; 3 3 using HeuristicLab.Persistence.Interfaces; 4 using HeuristicLab.Persistence.Default. Decomposers.Storable;4 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 5 5 6 6 namespace HeuristicLab.Persistence.Default.Xml.Primitive { 7 7 8 8 [EmptyStorableClass] 9 public class DateTime2Xml Formatter : PrimitiveXmlFormatterBase<DateTime> {9 public class DateTime2XmlSerializer : PrimitiveXmlSerializerBase<DateTime> { 10 10 11 11 public override XmlString Format(DateTime dt) { -
trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/Primitive/Decimal2XmlSerializer.cs
r1805 r1823 4 4 using System.Reflection; 5 5 using System.Globalization; 6 using HeuristicLab.Persistence.Default. Decomposers.Storable;6 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 7 7 8 8 namespace HeuristicLab.Persistence.Default.Xml.Primitive { 9 9 10 10 [EmptyStorableClass] 11 public class Decimal2Xml Formatter : DecimalNumber2XmlFormatterBase<decimal> { }11 public class Decimal2XmlSerializer : DecimalNumber2XmlSerializerBase<decimal> { } 12 12 13 13 } -
trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/Primitive/DecimalNumber2XmlSerializerBase.cs
r1805 r1823 7 7 namespace HeuristicLab.Persistence.Default.Xml.Primitive { 8 8 9 public abstract class DecimalNumber2Xml FormatterBase<T> : PrimitiveXmlFormatterBase<T> {9 public abstract class DecimalNumber2XmlSerializerBase<T> : PrimitiveXmlSerializerBase<T> { 10 10 11 11 private static MethodInfo ToStringMethod = typeof(T) -
trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/Primitive/Double2XmlSerializer.cs
r1805 r1823 4 4 using System.Reflection; 5 5 using System.Globalization; 6 using HeuristicLab.Persistence.Default. Decomposers.Storable;6 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 7 7 8 8 namespace HeuristicLab.Persistence.Default.Xml.Primitive { 9 9 10 10 [EmptyStorableClass] 11 public class Double2Xml Formatter : DecimalNumber2XmlFormatterBase<double> { }11 public class Double2XmlSerializer : DecimalNumber2XmlSerializerBase<double> { } 12 12 13 13 } -
trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/Primitive/Float2XmlSerializer.cs
r1805 r1823 4 4 using System.Reflection; 5 5 using System.Globalization; 6 using HeuristicLab.Persistence.Default. Decomposers.Storable;6 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 7 7 8 8 namespace HeuristicLab.Persistence.Default.Xml.Primitive { 9 9 10 10 [EmptyStorableClass] 11 public class Float2Xml Formatter : DecimalNumber2XmlFormatterBase<float> { }11 public class Float2XmlSerializer : DecimalNumber2XmlSerializerBase<float> { } 12 12 13 13 } -
trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/Primitive/Guid2XmlSerializer.cs
r1805 r1823 4 4 using System.Text; 5 5 using System.Text.RegularExpressions; 6 using HeuristicLab.Persistence.Default. Decomposers.Storable;6 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 7 7 using System.Globalization; 8 8 … … 11 11 12 12 [EmptyStorableClass] 13 public class Guid2Xml Formatter : PrimitiveXmlFormatterBase<Guid> {13 public class Guid2XmlSerializer : PrimitiveXmlSerializerBase<Guid> { 14 14 15 15 public override XmlString Format(Guid o) { -
trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/Primitive/Int2XmlSerializer.cs
r1805 r1823 4 4 using System.Reflection; 5 5 using System.Globalization; 6 using HeuristicLab.Persistence.Default. Decomposers.Storable;6 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 7 7 8 8 namespace HeuristicLab.Persistence.Default.Xml.Primitive { 9 9 10 10 [EmptyStorableClass] 11 public class Int2Xml Formatter : SimpleNumber2XmlFormatterBase<int> { }11 public class Int2XmlSerializer : SimpleNumber2XmlSerializerBase<int> { } 12 12 13 13 } -
trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/Primitive/Long2XmlSerializer.cs
r1805 r1823 4 4 using System.Reflection; 5 5 using System.Globalization; 6 using HeuristicLab.Persistence.Default. Decomposers.Storable;6 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 7 7 8 8 namespace HeuristicLab.Persistence.Default.Xml.Primitive { 9 9 10 10 [EmptyStorableClass] 11 public class Long2Xml Formatter : SimpleNumber2XmlFormatterBase<long> { }11 public class Long2XmlSerializer : SimpleNumber2XmlSerializerBase<long> { } 12 12 13 13 } -
trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/Primitive/PrimitiveXmlSerializerBase.cs
r1805 r1823 1 1 using HeuristicLab.Persistence.Interfaces; 2 2 using HeuristicLab.Persistence.Core; 3 using HeuristicLab.Persistence.Default. Decomposers.Storable;3 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 4 4 5 5 namespace HeuristicLab.Persistence.Default.Xml.Primitive { 6 6 7 public abstract class PrimitiveXml FormatterBase<T> : XmlFormatterBase<T> { }7 public abstract class PrimitiveXmlSerializerBase<T> : XmlSerializerBase<T> { } 8 8 9 9 } -
trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/Primitive/SByte2XmlSerializer.cs
r1805 r1823 4 4 using System.Reflection; 5 5 using System.Globalization; 6 using HeuristicLab.Persistence.Default. Decomposers.Storable;6 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 7 7 8 8 namespace HeuristicLab.Persistence.Default.Xml.Primitive { 9 9 10 10 [EmptyStorableClass] 11 public class SByte2Xml Formatter : SimpleNumber2XmlFormatterBase<sbyte> { }11 public class SByte2XmlSerializer : SimpleNumber2XmlSerializerBase<sbyte> { } 12 12 13 13 } -
trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/Primitive/Short2XmlSerializer.cs
r1805 r1823 4 4 using System.Reflection; 5 5 using System.Globalization; 6 using HeuristicLab.Persistence.Default. Decomposers.Storable;6 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 7 7 8 8 namespace HeuristicLab.Persistence.Default.Xml.Primitive { 9 9 10 10 [EmptyStorableClass] 11 public class Short2Xml Formatter : SimpleNumber2XmlFormatterBase<short> { }11 public class Short2XmlSerializer : SimpleNumber2XmlSerializerBase<short> { } 12 12 13 13 } -
trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/Primitive/SimpleNumber2XmlSerializerBase.cs
r1805 r1823 7 7 namespace HeuristicLab.Persistence.Default.Xml.Primitive { 8 8 9 public abstract class SimpleNumber2Xml FormatterBase<T> : PrimitiveXmlFormatterBase<T> {9 public abstract class SimpleNumber2XmlSerializerBase<T> : PrimitiveXmlSerializerBase<T> { 10 10 11 11 private static MethodInfo ParseMethod = typeof(T) -
trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/Primitive/String2XmlSerializer.cs
r1805 r1823 4 4 using System.Text; 5 5 using System.Text.RegularExpressions; 6 using HeuristicLab.Persistence.Default. Decomposers.Storable;6 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 7 7 using System.Globalization; 8 8 … … 11 11 12 12 [EmptyStorableClass] 13 public class String2Xml Formatter : PrimitiveXmlFormatterBase<string> {13 public class String2XmlSerializer : PrimitiveXmlSerializerBase<string> { 14 14 15 15 public override XmlString Format(string s) { -
trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/Primitive/TimeSpan2XmlSerializer.cs
r1805 r1823 4 4 using System.Text; 5 5 using System.Text.RegularExpressions; 6 using HeuristicLab.Persistence.Default. Decomposers.Storable;6 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 7 7 using System.Globalization; 8 8 … … 11 11 12 12 [EmptyStorableClass] 13 public class TimeSpan2Xml Formatter : PrimitiveXmlFormatterBase<TimeSpan> {13 public class TimeSpan2XmlSerializer : PrimitiveXmlSerializerBase<TimeSpan> { 14 14 15 15 public override XmlString Format(TimeSpan o) { -
trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/Primitive/UInt2XmlSerializer.cs
r1805 r1823 4 4 using System.Reflection; 5 5 using System.Globalization; 6 using HeuristicLab.Persistence.Default. Decomposers.Storable;6 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 7 7 8 8 namespace HeuristicLab.Persistence.Default.Xml.Primitive { 9 9 10 10 [EmptyStorableClass] 11 public class UInt2Xml Formatter : SimpleNumber2XmlFormatterBase<uint> { }11 public class UInt2XmlSerializer : SimpleNumber2XmlSerializerBase<uint> { } 12 12 13 13 } -
trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/Primitive/ULong2XmlSerializer.cs
r1805 r1823 4 4 using System.Reflection; 5 5 using System.Globalization; 6 using HeuristicLab.Persistence.Default. Decomposers.Storable;6 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 7 7 8 8 namespace HeuristicLab.Persistence.Default.Xml.Primitive { 9 9 10 10 [EmptyStorableClass] 11 public class ULong2Xml Formatter : SimpleNumber2XmlFormatterBase<ulong> { }11 public class ULong2XmlSerializer : SimpleNumber2XmlSerializerBase<ulong> { } 12 12 13 13 } -
trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/Primitive/UShort2XmlSerializer.cs
r1805 r1823 4 4 using System.Reflection; 5 5 using System.Globalization; 6 using HeuristicLab.Persistence.Default. Decomposers.Storable;6 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 7 7 8 8 namespace HeuristicLab.Persistence.Default.Xml.Primitive { 9 9 10 10 [EmptyStorableClass] 11 public class UShort2Xml Formatter : SimpleNumber2XmlFormatterBase<ushort> { }11 public class UShort2XmlSerializer : SimpleNumber2XmlSerializerBase<ushort> { } 12 12 13 13 } -
trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/XmlFormat.cs
r1623 r1823 1 1 using HeuristicLab.Persistence.Interfaces; 2 2 using HeuristicLab.Persistence.Core; 3 using HeuristicLab.Persistence.Default. Decomposers.Storable;3 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 4 4 5 5 namespace HeuristicLab.Persistence.Default.Xml { -
trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/XmlGenerator.cs
r1797 r1823 170 170 File.Copy(tempfile, filename, true); 171 171 File.Delete(tempfile); 172 } catch (Exception x) {172 } catch (Exception) { 173 173 Logger.Warn("Exception caught, no data has been written."); 174 174 throw; … … 222 222 } 223 223 } 224 } catch (PersistenceException e) {224 } catch (PersistenceException) { 225 225 throw; 226 226 } catch (Exception e) { -
trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/XmlParser.cs
r1779 r1823 115 115 } 116 116 return typeCache; 117 } catch (PersistenceException e) {117 } catch (PersistenceException) { 118 118 throw; 119 119 } catch (Exception e) { -
trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/XmlSerializerBase.cs
r1805 r1823 1 1 using HeuristicLab.Persistence.Interfaces; 2 2 using HeuristicLab.Persistence.Core; 3 using HeuristicLab.Persistence.Default. Decomposers.Storable;3 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 4 4 5 5 namespace HeuristicLab.Persistence.Default.Xml { 6 6 7 public abstract class Xml FormatterBase<T> : FormatterBase<T, XmlString> { }7 public abstract class XmlSerializerBase<T> : PrimitiveSerializerBase<T, XmlString> { } 8 8 9 9 } -
trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/XmlString.cs
r1623 r1823 2 2 using HeuristicLab.Persistence.Core; 3 3 using System.Text; 4 using HeuristicLab.Persistence.Default. Decomposers.Storable;4 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 5 5 6 6 namespace HeuristicLab.Persistence.Default.Xml { -
trunk/sources/HeuristicLab.Persistence/3.3/HeuristicLab.Persistence-3.3.csproj
r1795 r1823 93 93 </ItemGroup> 94 94 <ItemGroup> 95 <Compile Include="Auxiliary\TypeLoader.cs" /> 95 96 <Compile Include="Auxiliary\TypeNameParser.cs" /> 96 97 <Compile Include="Auxiliary\ReflectionTools.cs" /> 97 98 <Compile Include="Core\Configuration.cs" /> 98 99 <Compile Include="Core\PersistenceException.cs" /> 99 <Compile Include="Default\DebugString\Formatters\Char2DebugStringFormatter.cs" /> 100 <Compile Include="Default\Decomposers\StackDecomposer.cs" /> 101 <Compile Include="Default\Decomposers\Number2StringConverter.cs" /> 102 <Compile Include="Default\Decomposers\Storable\EmptyStorableClassAttribute.cs" /> 100 <Compile Include="Core\PrimitiveSerializerBase.cs" /> 103 101 <Compile Include="Core\FormatBase.cs" /> 104 <Compile Include="Core\FormatterBase.cs" />105 102 <Compile Include="Auxiliary\TypeExtensions.cs" /> 106 103 <Compile Include="Core\TypeMapping.cs" /> 107 104 <Compile Include="Auxiliary\TypeName.cs" /> 108 105 <Compile Include="Core\GeneratorBase.cs" /> 106 <Compile Include="Default\CompositeSerializers\ArraySerializer.cs" /> 107 <Compile Include="Default\CompositeSerializers\CompactNumberArray2StringSerializer.cs" /> 108 <Compile Include="Default\CompositeSerializers\DictionarySerializer.cs" /> 109 <Compile Include="Default\CompositeSerializers\EnumerableSerializer.cs" /> 110 <Compile Include="Default\CompositeSerializers\EnumSerializer.cs" /> 111 <Compile Include="Default\CompositeSerializers\KeyValuePairSerializer.cs" /> 112 <Compile Include="Default\CompositeSerializers\Number2StringSerializer.cs" /> 113 <Compile Include="Default\CompositeSerializers\NumberEnumerable2StringSerializer.cs" /> 114 <Compile Include="Default\CompositeSerializers\StackSerializer.cs" /> 115 <Compile Include="Default\CompositeSerializers\Storable\DataMemberAccessor.cs" /> 116 <Compile Include="Default\CompositeSerializers\Storable\EmptyStorableClassAttribute.cs" /> 117 <Compile Include="Default\CompositeSerializers\Storable\StorableAttribute.cs" /> 118 <Compile Include="Default\CompositeSerializers\Storable\StorableSerializer.cs" /> 119 <Compile Include="Default\CompositeSerializers\TypeSerializer.cs" /> 109 120 <Compile Include="Default\DebugString\DebugString.cs" /> 110 121 <Compile Include="Default\DebugString\DebugStringFormat.cs" /> 111 <Compile Include="Default\DebugString\Formatters\SByte2DebugStringFormatter.cs" />112 <Compile Include="Default\DebugString\Formatters\UInt2DebugStringFormatter.cs" />113 <Compile Include="Default\DebugString\Formatters\Long2DebugStringFormatter.cs" />114 <Compile Include="Default\DebugString\Formatters\ULong2DebugStringFormatter.cs" />115 <Compile Include="Default\DebugString\Formatters\Short2DebugStringFormatter.cs" />116 <Compile Include="Default\DebugString\Formatters\UShort2DebugStringFormatter.cs" />117 <Compile Include="Default\DebugString\Formatters\Byte2DebugStringFormatter.cs" />118 <Compile Include="Default\DebugString\Formatters\ValueType2DebugStringFormatterBase.cs" />119 <Compile Include="Default\DebugString\Formatters\String2DebugStringFormatter.cs" />120 <Compile Include="Default\DebugString\Formatters\Bool2DebugStringFormatter.cs" />121 <Compile Include="Default\DebugString\Formatters\Int2DebugStringFormatter.cs" />122 <Compile Include="Default\DebugString\Formatters\Doubld2DebugStringFormatter.cs" />123 <Compile Include="Default\DebugString\Formatters\DateTime2DebugStringFormatter.cs" />124 <Compile Include="Default\DebugString\Formatters\Type2DebugStringFormatter.cs" />125 <Compile Include="Default\DebugString\Formatters\Float2DebugStringFormatter.cs" />126 122 <Compile Include="Default\DebugString\DebugStringGenerator.cs" /> 127 <Compile Include="Default\Decomposers\ArrayDecomposer.cs" /> 128 <Compile Include="Default\Decomposers\CompactNumberArray2StringDecomposer.cs" /> 129 <Compile Include="Default\Decomposers\EnumerableDecomposer.cs" /> 130 <Compile Include="Default\Decomposers\EnumDecomposer.cs" /> 131 <Compile Include="Default\Decomposers\KeyValuePairDecomposer.cs" /> 132 <Compile Include="Default\Decomposers\DictionaryDecomposer.cs" /> 133 <Compile Include="Default\Decomposers\Storable\StorableDecomposer.cs" /> 134 <Compile Include="Default\Decomposers\TypeDecomposer.cs" /> 135 <Compile Include="Default\Decomposers\NumberEnumerable2StringDecomposer.cs" /> 136 <Compile Include="Default\Xml\Compact\IntArray2XmlFormatters.cs" /> 137 <Compile Include="Default\Xml\Compact\DoubleArray2XmlFormatters.cs" /> 138 <Compile Include="Default\Xml\Compact\DoubleList2XmlFormatter.cs" /> 139 <Compile Include="Default\Xml\Compact\NumberEnumeration2XmlFormatterBase.cs" /> 140 <Compile Include="Default\Xml\Compact\NumberArray2XmlFormatterBase.cs" /> 141 <Compile Include="Default\Decomposers\Storable\DataMemberAccessor.cs" /> 142 <Compile Include="Default\Xml\Compact\IntList2XmlFormatter.cs" /> 143 <Compile Include="Default\Xml\Primitive\Guid2XmlFormatter.cs" /> 144 <Compile Include="Default\Xml\Primitive\TimeSpan2XmlFormatter.cs" /> 145 <Compile Include="Default\Xml\XmlFormatterBase.cs" /> 146 <Compile Include="Default\Xml\Primitive\PrimitiveXmlFormatterBase.cs" /> 147 <Compile Include="Default\Xml\Compact\CompactXmlFormatterBase.cs" /> 148 <Compile Include="Default\Xml\Primitive\Char2XmlFormatter.cs" /> 123 <Compile Include="Default\DebugString\PrimitiveSerializers\Bool2DebugStringSerializer.cs" /> 124 <Compile Include="Default\DebugString\PrimitiveSerializers\Byte2DebugStringSerializer.cs" /> 125 <Compile Include="Default\DebugString\PrimitiveSerializers\Char2DebugStringSerializer.cs" /> 126 <Compile Include="Default\DebugString\PrimitiveSerializers\DateTime2DebugStringSerializer.cs" /> 127 <Compile Include="Default\DebugString\PrimitiveSerializers\Doubld2DebugStringSerializer.cs" /> 128 <Compile Include="Default\DebugString\PrimitiveSerializers\Float2DebugStringSerializer.cs" /> 129 <Compile Include="Default\DebugString\PrimitiveSerializers\Int2DebugStringSerializer.cs" /> 130 <Compile Include="Default\DebugString\PrimitiveSerializers\Long2DebugStringSerializer.cs" /> 131 <Compile Include="Default\DebugString\PrimitiveSerializers\SByte2DebugStringSerializer.cs" /> 132 <Compile Include="Default\DebugString\PrimitiveSerializers\Short2DebugStringSerializer.cs" /> 133 <Compile Include="Default\DebugString\PrimitiveSerializers\String2DebugStringSerializer.cs" /> 134 <Compile Include="Default\DebugString\PrimitiveSerializers\Type2DebugStringSerializer.cs" /> 135 <Compile Include="Default\DebugString\PrimitiveSerializers\UInt2DebugStringSerializer.cs" /> 136 <Compile Include="Default\DebugString\PrimitiveSerializers\ULong2DebugStringSerializer.cs" /> 137 <Compile Include="Default\DebugString\PrimitiveSerializers\UShort2DebugStringSerializer.cs" /> 138 <Compile Include="Default\DebugString\PrimitiveSerializers\ValueType2DebugStringSerializerBase.cs" /> 139 <Compile Include="Default\Xml\Compact\CompactXmlSerializerBase.cs" /> 140 <Compile Include="Default\Xml\Compact\DoubleArray2XmlSerializer.cs" /> 141 <Compile Include="Default\Xml\Compact\DoubleList2XmlSerializer.cs" /> 142 <Compile Include="Default\Xml\Compact\IntArray2XmlSerializer.cs" /> 143 <Compile Include="Default\Xml\Compact\IntList2XmlSerializer.cs" /> 144 <Compile Include="Default\Xml\Compact\NumberArray2XmlSerializerBase.cs" /> 145 <Compile Include="Default\Xml\Compact\NumberEnumeration2XmlSerializerBase.cs" /> 146 <Compile Include="Default\Xml\Primitive\Bool2XmlSerializer.cs" /> 147 <Compile Include="Default\Xml\Primitive\Byte2XmlSerializer.cs" /> 148 <Compile Include="Default\Xml\Primitive\Char2XmlFormatter.cs"> 149 <SubType>Code</SubType> 150 </Compile> 151 <Compile Include="Default\Xml\Primitive\DateTime2XmlSerializer.cs" /> 152 <Compile Include="Default\Xml\Primitive\Decimal2XmlSerializer.cs" /> 153 <Compile Include="Default\Xml\Primitive\DecimalNumber2XmlSerializerBase.cs" /> 154 <Compile Include="Default\Xml\Primitive\Double2XmlSerializer.cs" /> 155 <Compile Include="Default\Xml\Primitive\Float2XmlSerializer.cs" /> 156 <Compile Include="Default\Xml\Primitive\Guid2XmlSerializer.cs" /> 157 <Compile Include="Default\Xml\Primitive\Int2XmlSerializer.cs" /> 158 <Compile Include="Default\Xml\Primitive\Long2XmlSerializer.cs" /> 159 <Compile Include="Default\Xml\Primitive\PrimitiveXmlSerializerBase.cs" /> 160 <Compile Include="Default\Xml\Primitive\SByte2XmlSerializer.cs" /> 161 <Compile Include="Default\Xml\Primitive\Short2XmlSerializer.cs" /> 162 <Compile Include="Default\Xml\Primitive\SimpleNumber2XmlSerializerBase.cs" /> 163 <Compile Include="Default\Xml\Primitive\String2XmlSerializer.cs" /> 164 <Compile Include="Default\Xml\Primitive\TimeSpan2XmlSerializer.cs" /> 165 <Compile Include="Default\Xml\Primitive\UInt2XmlSerializer.cs" /> 166 <Compile Include="Default\Xml\Primitive\ULong2XmlSerializer.cs" /> 167 <Compile Include="Default\Xml\Primitive\UShort2XmlSerializer.cs" /> 168 <Compile Include="Default\Xml\XmlSerializerBase.cs" /> 149 169 <Compile Include="Default\Xml\XmlStringConstants.cs" /> 150 170 <Compile Include="Default\Xml\XmlString.cs" /> 151 <Compile Include="Default\Xml\Primitive\Double2XmlFormatter.cs" />152 <Compile Include="Default\Xml\Primitive\Decimal2XmlFormatter.cs" />153 <Compile Include="Default\Xml\Primitive\Float2XmlFormatter.cs" />154 <Compile Include="Default\Xml\Primitive\UInt2XmlFormatter.cs" />155 <Compile Include="Default\Xml\Primitive\Long2XmlFormatter.cs" />156 <Compile Include="Default\Xml\Primitive\ULong2XmlFormatter.cs" />157 <Compile Include="Default\Xml\Primitive\Int2XmlFormatter.cs" />158 <Compile Include="Default\Xml\Primitive\SByte2XmlFormatter.cs" />159 <Compile Include="Default\Xml\Primitive\Byte2XmlFormatter.cs" />160 <Compile Include="Default\Xml\Primitive\Short2XmlFormatter.cs" />161 <Compile Include="Default\Xml\Primitive\UShort2XmlFormatter.cs" />162 <Compile Include="Default\Xml\Primitive\Bool2XmlFormatter.cs" />163 <Compile Include="Default\Xml\Primitive\DecimalNumber2XmlFormatterBase.cs" />164 <Compile Include="Default\Xml\Primitive\String2XmlFormatter.cs" />165 <Compile Include="Default\Xml\Primitive\SimpleNumber2XmlFormatterBase.cs" />166 <Compile Include="Default\Xml\Primitive\DateTime2XmlFormatter.cs" />167 171 <Compile Include="Default\Xml\XmlFormat.cs" /> 168 172 <Compile Include="HeuristicLabPersistencePlugin.cs" /> 169 173 <Compile Include="Core\Deserializer.cs" /> 170 174 <Compile Include="Core\Tag.cs" /> 175 <Compile Include="Interfaces\ICompositeSerializer.cs" /> 176 <Compile Include="Interfaces\IPrimitiveSerializer.cs" /> 171 177 <Compile Include="Interfaces\ISerialData.cs" /> 172 178 <Compile Include="Interfaces\IFormat.cs" /> 173 <Compile Include="Interfaces\IDecomposer.cs" />174 <Compile Include="Interfaces\IFormatter.cs" />175 179 <Compile Include="Core\ConfigurationService.cs" /> 176 180 <Compile Include="Core\Tokens\MetaInfoBeginToken.cs" /> … … 191 195 <DependentUpon>Settings.settings</DependentUpon> 192 196 </Compile> 193 <Compile Include="Default\Decomposers\Storable\StorableAttribute.cs" />194 197 <Compile Include="Default\Xml\XmlGenerator.cs" /> 195 198 <Compile Include="Default\Xml\XmlParser.cs" /> -
trunk/sources/HeuristicLab.Persistence/3.3/Interfaces/ICompositeSerializer.cs
r1805 r1823 5 5 namespace HeuristicLab.Persistence.Interfaces { 6 6 7 public interface I Decomposer {7 public interface ICompositeSerializer { 8 8 9 9 /// <summary> 10 /// Defines the Priorty of this Decomposer. Higher number means11 /// higher prioriy. Negative numbers are fallback decomposers.12 /// All default generic decomposers have priority 100. Specializations10 /// Defines the Priorty of this composite serializer. Higher number means 11 /// higher prioriy. Negative numbers are fallback serializers. 12 /// All default generic composite serializers have priority 100. Specializations 13 13 /// have priority 200 so they will be tried first. Priorities are 14 14 /// only considered for default configurations. … … 17 17 18 18 /// <summary> 19 /// Determines for every type whether the decomposer is applicable.19 /// Determines for every type whether the composite serializer is applicable. 20 20 /// </summary> 21 bool Can Decompose(Type type);21 bool CanSerialize(Type type); 22 22 23 23 /// <summary> -
trunk/sources/HeuristicLab.Persistence/3.3/Interfaces/IPrimitiveSerializer.cs
r1805 r1823 4 4 5 5 /// <summary> 6 /// Marker interface of serial data formatters. Transform data of type SourceType7 /// into the serialization format SerialDataType. Derive from FormatterBase instead6 /// Marker interface primitive serializers. Transform data of type SourceType 7 /// into the serialization format SerialDataType. Derive from PrimitiveSerializerBase instead 8 8 /// of implementing this interface. 9 9 /// </summary> 10 public interface I Formatter {10 public interface IPrimitiveSerializer { 11 11 Type SerialDataType { get; } 12 12 Type SourceType { get; } … … 16 16 17 17 /// <summary> 18 /// Marker interface of serial data formatters. Transform data of type Source19 /// into the serialization format SerialData . Derive from FormatterBase instead18 /// Marker interface primitive serializers. Transform data of type SourceType 19 /// into the serialization format SerialDataType. Derive from PrimitiveSerializerBase instead 20 20 /// of implementing this interface. 21 /// </summary> 22 public interface I Formatter<Source, SerialData> : IFormatter where SerialData : ISerialData {21 /// </summary> 22 public interface IPrimitiveSerializer<Source, SerialData> : IPrimitiveSerializer where SerialData : ISerialData { 23 23 SerialData Format(Source o); 24 24 Source Parse(SerialData t); -
trunk/sources/HeuristicLab.Persistence/3.3/Interfaces/ISerialData.cs
r1566 r1823 6 6 /// <summary> 7 7 /// Marker interface for serialized values generated and parsed by 8 /// the formatterand output and read by generator and parser.8 /// primitive serializers and output and read by generator and parser. 9 9 /// </summary> 10 10 public interface ISerialData { } -
trunk/sources/HeuristicLab.Persistence/UnitTests/StorableAttributeTests.cs
r1625 r1823 3 3 using HeuristicLab.Persistence.Core; 4 4 using Microsoft.VisualStudio.TestTools.UnitTesting; 5 using HeuristicLab.Persistence.Default. Decomposers.Storable;5 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 6 6 7 7 namespace HeuristicLab.Persistence.Test { -
trunk/sources/HeuristicLab.Persistence/UnitTests/UseCases.cs
r1822 r1823 10 10 using System.IO; 11 11 using System.Reflection; 12 using HeuristicLab.Persistence.Default. Decomposers.Storable;12 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 13 13 using HeuristicLab.Persistence.Interfaces; 14 14 using HeuristicLab.Persistence.Default.Xml.Primitive; 15 using HeuristicLab.Persistence.Default. Decomposers;15 using HeuristicLab.Persistence.Default.CompositeSerializers; 16 16 using HeuristicLab.Persistence.Auxiliary; 17 17 using System.Text.RegularExpressions; … … 432 432 XmlGenerator.Serialize(sdt, tempFile, 433 433 new Configuration(new XmlFormat(), 434 new List<I Formatter> { new String2XmlFormatter() },435 new List<I Decomposer> {436 new Storable Decomposer(),437 new Number2String Decomposer() }));434 new List<IPrimitiveSerializer> { new String2XmlSerializer() }, 435 new List<ICompositeSerializer> { 436 new StorableSerializer(), 437 new Number2StringSerializer() })); 438 438 object o = XmlParser.Deserialize(tempFile); 439 439 Assert.AreEqual( -
trunk/sources/HeuristicLab.Random/3.3/MersenneTwister.cs
r1688 r1823 37 37 using System.Xml; 38 38 using HeuristicLab.Core; 39 using HeuristicLab.Persistence.Default. Decomposers.Storable;39 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 40 40 41 41 namespace HeuristicLab.Random { -
trunk/sources/HeuristicLab.Random/3.3/NormalDistributedRandom.cs
r1688 r1823 26 26 using System.Xml; 27 27 using System.Globalization; 28 using HeuristicLab.Persistence.Default. Decomposers.Storable;28 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 29 29 30 30 namespace HeuristicLab.Random { -
trunk/sources/HeuristicLab.Routing.TSP/3.3/TSPTour.cs
r1699 r1823 27 27 using HeuristicLab.Data; 28 28 using HeuristicLab.Permutation; 29 using HeuristicLab.Persistence.Default. Decomposers.Storable;29 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 30 30 31 31 namespace HeuristicLab.Routing.TSP {
Note: See TracChangeset
for help on using the changeset viewer.