Index: /branches/New Persistence Exploration/Persistence/HeuristicLab.Persistence.GUI/HeuristicLab.Persistence.GUI.csproj
===================================================================
--- /branches/New Persistence Exploration/Persistence/HeuristicLab.Persistence.GUI/HeuristicLab.Persistence.GUI.csproj (revision 1373)
+++ /branches/New Persistence Exploration/Persistence/HeuristicLab.Persistence.GUI/HeuristicLab.Persistence.GUI.csproj (revision 1373)
@@ -0,0 +1,76 @@
+
+
+
+ Debug
+ AnyCPU
+ 9.0.30729
+ 2.0
+ {A9E282EA-180F-4233-B809-AEDF0787545C}
+ WinExe
+ Properties
+ HeuristicLab.Persistence.GUI
+ HeuristicLab.Persistence.GUI
+ v3.5
+ 512
+ HeuristicLab.Persistence.GUI.Program
+ Full
+
+
+ true
+ full
+ false
+ bin\Debug\
+ DEBUG;TRACE
+ prompt
+ 4
+
+
+ pdbonly
+ true
+ bin\Release\
+ TRACE
+ prompt
+ 4
+
+
+
+
+
+ {102BC7D3-0EF9-439C-8F6D-96FF0FDB8E1B}
+ HeuristicLab.Persistence
+
+
+
+
+ Form
+
+
+ PersistenceConfigurationForm.cs
+
+
+
+
+
+
+ 3.5
+
+
+
+
+
+
+
+
+ PersistenceConfigurationForm.cs
+
+
+
+
+
+
Index: /branches/New Persistence Exploration/Persistence/HeuristicLab.Persistence.GUI/PersistenceConfigurationForm.Designer.cs
===================================================================
--- /branches/New Persistence Exploration/Persistence/HeuristicLab.Persistence.GUI/PersistenceConfigurationForm.Designer.cs (revision 1373)
+++ /branches/New Persistence Exploration/Persistence/HeuristicLab.Persistence.GUI/PersistenceConfigurationForm.Designer.cs (revision 1373)
@@ -0,0 +1,101 @@
+namespace HeuristicLab.Persistence.GUI {
+ partial class PersistenceConfigurationForm {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing) {
+ if (disposing && (components != null)) {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent() {
+ System.Windows.Forms.ListViewItem listViewItem1 = new System.Windows.Forms.ListViewItem("Bli");
+ System.Windows.Forms.ListViewItem listViewItem2 = new System.Windows.Forms.ListViewItem("Bla");
+ System.Windows.Forms.ListViewItem listViewItem3 = new System.Windows.Forms.ListViewItem("Blo");
+ this.decomposerList = new System.Windows.Forms.ListView();
+ this.DecomposersColumn = new System.Windows.Forms.ColumnHeader();
+ this.checkbox = new System.Windows.Forms.CheckedListBox();
+ this.SuspendLayout();
+ //
+ // decomposerList
+ //
+ this.decomposerList.Activation = System.Windows.Forms.ItemActivation.OneClick;
+ this.decomposerList.AllowDrop = true;
+ this.decomposerList.CheckBoxes = true;
+ this.decomposerList.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
+ this.DecomposersColumn});
+ this.decomposerList.FullRowSelect = true;
+ this.decomposerList.GridLines = true;
+ this.decomposerList.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable;
+ listViewItem1.Checked = true;
+ listViewItem1.StateImageIndex = 1;
+ listViewItem1.Tag = "";
+ listViewItem2.Checked = true;
+ listViewItem2.StateImageIndex = 1;
+ listViewItem3.Checked = true;
+ listViewItem3.StateImageIndex = 1;
+ this.decomposerList.Items.AddRange(new System.Windows.Forms.ListViewItem[] {
+ listViewItem1,
+ listViewItem2,
+ listViewItem3});
+ this.decomposerList.Location = new System.Drawing.Point(25, 12);
+ this.decomposerList.Name = "decomposerList";
+ this.decomposerList.ShowGroups = false;
+ this.decomposerList.Size = new System.Drawing.Size(194, 278);
+ this.decomposerList.TabIndex = 0;
+ this.decomposerList.UseCompatibleStateImageBehavior = false;
+ this.decomposerList.View = System.Windows.Forms.View.Details;
+ this.decomposerList.Resize += new System.EventHandler(this.decomposerList_Resize);
+ this.decomposerList.ItemChecked += new System.Windows.Forms.ItemCheckedEventHandler(this.decomposerList_ItemChecked);
+ this.decomposerList.DragDrop += new System.Windows.Forms.DragEventHandler(this.decomposerList_DragDrop);
+ this.decomposerList.DragEnter += new System.Windows.Forms.DragEventHandler(this.decomposerList_DragEnter);
+ this.decomposerList.ItemDrag += new System.Windows.Forms.ItemDragEventHandler(this.decomposerList_ItemDrag);
+ //
+ // DecomposersColumn
+ //
+ this.DecomposersColumn.Text = "Decomposers";
+ this.DecomposersColumn.Width = 190;
+ //
+ // checkbox
+ //
+ this.checkbox.FormattingEnabled = true;
+ this.checkbox.Location = new System.Drawing.Point(314, 103);
+ this.checkbox.Name = "checkbox";
+ this.checkbox.Size = new System.Drawing.Size(180, 154);
+ this.checkbox.TabIndex = 1;
+ this.checkbox.ThreeDCheckBoxes = true;
+ //
+ // PersistenceConfigurationForm
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(597, 580);
+ this.Controls.Add(this.checkbox);
+ this.Controls.Add(this.decomposerList);
+ this.Name = "PersistenceConfigurationForm";
+ this.Text = "PersistenceConfigurationForm";
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.ListView decomposerList;
+ private System.Windows.Forms.ColumnHeader DecomposersColumn;
+ private System.Windows.Forms.CheckedListBox checkbox;
+ }
+}
Index: /branches/New Persistence Exploration/Persistence/HeuristicLab.Persistence.GUI/PersistenceConfigurationForm.cs
===================================================================
--- /branches/New Persistence Exploration/Persistence/HeuristicLab.Persistence.GUI/PersistenceConfigurationForm.cs (revision 1373)
+++ /branches/New Persistence Exploration/Persistence/HeuristicLab.Persistence.GUI/PersistenceConfigurationForm.cs (revision 1373)
@@ -0,0 +1,96 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Windows.Forms;
+using HeuristicLab.Persistence.Default.Xml;
+using HeuristicLab.Persistence.Interfaces;
+
+namespace HeuristicLab.Persistence.GUI {
+ public partial class PersistenceConfigurationForm : Form {
+ public PersistenceConfigurationForm() {
+ InitializeComponent();
+ decomposerList.Items.Clear();
+ foreach ( IDecomposer decomposer in ConfigurationService.Instance.AllDecomposers ) {
+ var item = decomposerList.Items.Add(decomposer.GetType().Name);
+ item.Checked = true;
+ item.Tag = decomposer;
+ }
+ }
+
+ private void decomposerList_ItemDrag(object sender, ItemDragEventArgs e) {
+ decomposerList.DoDragDrop(decomposerList.SelectedItems, DragDropEffects.Move);
+ }
+
+ private void decomposerList_DragEnter(object sender, DragEventArgs e) {
+ if ( e.Data.GetDataPresent(typeof(ListView.SelectedListViewItemCollection).FullName)) {
+ e.Effect = DragDropEffects.Move;
+ }
+ }
+
+ private void decomposerList_DragDrop(object sender, DragEventArgs e) {
+ if (decomposerList.SelectedItems.Count == 0) {
+ return;
+ }
+ //Returns the location of the mouse pointer in the ListView control.
+ Point cp = decomposerList.PointToClient(new Point(e.X, e.Y));
+ //Obtain the item that is located at the specified location of the mouse pointer.
+ ListViewItem dragToItem = decomposerList.GetItemAt(cp.X, cp.Y);
+ if (dragToItem == null) {
+ return;
+ }
+ //Obtain the index of the item at the mouse pointer.
+ int dragIndex = dragToItem.Index;
+ ListViewItem[] sel = new ListViewItem[decomposerList.SelectedItems.Count];
+ for (int i = 0; i <= decomposerList.SelectedItems.Count - 1; i++) {
+ sel[i] = decomposerList.SelectedItems[i];
+ }
+ for (int i = 0; i < sel.GetLength(0); i++) {
+ //Obtain the ListViewItem to be dragged to the target location.
+ ListViewItem dragItem = sel[i];
+ int itemIndex = dragIndex;
+ if (itemIndex == dragItem.Index) {
+ return;
+ }
+ if (dragItem.Index < itemIndex)
+ itemIndex++;
+ else
+ itemIndex = dragIndex + i;
+ //Insert the item at the mouse pointer.
+ ListViewItem insertItem = (ListViewItem) dragItem.Clone();
+ decomposerList.Items.Insert(itemIndex, insertItem);
+ //Removes the item from the initial location while
+ //the item is moved to the new location.
+ decomposerList.Items.Remove(dragItem);
+ }
+ Update();
+ }
+
+ private void decomposerList_Resize(object sender, EventArgs e) {
+ DecomposersColumn.Width = decomposerList.Width - 4;
+ }
+
+ private IEnumerable GetDecomposers() {
+ List decomposers = new List();
+ foreach ( ListViewItem item in decomposerList.Items ) {
+ if (item != null && item.Checked)
+ decomposers.Add((IDecomposer) item.Tag);
+ }
+ return decomposers;
+ }
+
+ private void Update() {
+ checkbox.Items.Clear();
+ foreach (var decomposer in GetDecomposers())
+ checkbox.Items.Add(decomposer.GetType().Name);
+ }
+
+ private void decomposerList_ItemChecked(object sender, ItemCheckedEventArgs e) {
+ Update();
+ }
+
+ }
+}
Index: /branches/New Persistence Exploration/Persistence/HeuristicLab.Persistence.GUI/PersistenceConfigurationForm.resx
===================================================================
--- /branches/New Persistence Exploration/Persistence/HeuristicLab.Persistence.GUI/PersistenceConfigurationForm.resx (revision 1373)
+++ /branches/New Persistence Exploration/Persistence/HeuristicLab.Persistence.GUI/PersistenceConfigurationForm.resx (revision 1373)
@@ -0,0 +1,120 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
Index: /branches/New Persistence Exploration/Persistence/HeuristicLab.Persistence.GUI/Program.cs
===================================================================
--- /branches/New Persistence Exploration/Persistence/HeuristicLab.Persistence.GUI/Program.cs (revision 1373)
+++ /branches/New Persistence Exploration/Persistence/HeuristicLab.Persistence.GUI/Program.cs (revision 1373)
@@ -0,0 +1,15 @@
+using System;
+using System.Windows.Forms;
+using HeuristicLab.Persistence.GUI;
+
+namespace HeuristicLab.Persistence.GUI {
+
+ static class Program {
+ [STAThread]
+ static void Main() {
+ Application.EnableVisualStyles();
+ Application.SetCompatibleTextRenderingDefault(false);
+ Application.Run(new PersistenceConfigurationForm());
+ }
+ }
+}
Index: /branches/New Persistence Exploration/Persistence/HeuristicLab.Persistence.GUI/app.config
===================================================================
--- /branches/New Persistence Exploration/Persistence/HeuristicLab.Persistence.GUI/app.config (revision 1373)
+++ /branches/New Persistence Exploration/Persistence/HeuristicLab.Persistence.GUI/app.config (revision 1373)
@@ -0,0 +1,3 @@
+
+
+
Index: /branches/New Persistence Exploration/Persistence/Persistence.sln
===================================================================
--- /branches/New Persistence Exploration/Persistence/Persistence.sln (revision 1372)
+++ /branches/New Persistence Exploration/Persistence/Persistence.sln (revision 1373)
@@ -7,4 +7,6 @@
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.PluginInfrastructure", "..\..\..\trunk\sources\HeuristicLab.PluginInfrastructure\HeuristicLab.PluginInfrastructure.csproj", "{94186A6A-5176-4402-AE83-886557B53CCA}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Persistence.GUI", "HeuristicLab.Persistence.GUI\HeuristicLab.Persistence.GUI.csproj", "{A9E282EA-180F-4233-B809-AEDF0787545C}"
EndProject
Global
@@ -36,4 +38,10 @@
{94186A6A-5176-4402-AE83-886557B53CCA}.Release|x86.ActiveCfg = Release|x86
{94186A6A-5176-4402-AE83-886557B53CCA}.Release|x86.Build.0 = Release|x86
+ {A9E282EA-180F-4233-B809-AEDF0787545C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {A9E282EA-180F-4233-B809-AEDF0787545C}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {A9E282EA-180F-4233-B809-AEDF0787545C}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {A9E282EA-180F-4233-B809-AEDF0787545C}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {A9E282EA-180F-4233-B809-AEDF0787545C}.Release|Any CPU.Build.0 = Release|Any CPU
+ {A9E282EA-180F-4233-B809-AEDF0787545C}.Release|x86.ActiveCfg = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
Index: /branches/New Persistence Exploration/Persistence/Persistence/Core/PersistenceConfiguration.cs
===================================================================
--- /branches/New Persistence Exploration/Persistence/Persistence/Core/PersistenceConfiguration.cs (revision 1372)
+++ /branches/New Persistence Exploration/Persistence/Persistence/Core/PersistenceConfiguration.cs (revision 1373)
@@ -51,8 +51,20 @@
public class ConfigurationService {
+ private static ConfigurationService instance;
private readonly Dictionary> formatters;
private readonly List decomposers;
+
+ public Dictionary> AllFormatters {
+ get {
+ return formatters;
+ }
+ }
+
+ public List AllDecomposers {
+ get {
+ return decomposers;
+ }
+ }
- private static ConfigurationService instance;
public static ConfigurationService Instance {
get {