changeset 0:90ea68d4f92f

First release
author Ivo Smits <Ivo@UCIS.nl>
date Sat, 08 Nov 2014 22:43:51 +0100
parents
children 27ccad26a830
files .hgignore .hgsub .hgsubstate ARClient/ARClient.csproj ARClient/Form1.Designer.cs ARClient/Form1.cs ARClient/Form1.resx ARClient/MARC.cs ARClient/Program.cs ARClient/Properties/AssemblyInfo.cs ARClient/Properties/Settings.Designer.cs ARClient/Properties/Settings.settings ARClient/frmEditResource.Designer.cs ARClient/frmEditResource.cs ARClient/frmEditResource.resx ARClient/frmSettings.Designer.cs ARClient/frmSettings.cs ARClient/frmSettings.resx ARClient/frmSync.Designer.cs ARClient/frmSync.cs ARClient/frmSync.resx ARClient/frmTextInput.Designer.cs ARClient/frmTextInput.cs ARClient/frmTextInput.resx MARC.sln
diffstat 25 files changed, 4876 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/.hgignore	Sat Nov 08 22:43:51 2014 +0100
@@ -0,0 +1,4 @@
+syntax: glob
+*/bin/*
+*/obj/*
+*.suo
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/.hgsub	Sat Nov 08 22:43:51 2014 +0100
@@ -0,0 +1,1 @@
+UCIS.Core = ../ucis.core
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/.hgsubstate	Sat Nov 08 22:43:51 2014 +0100
@@ -0,0 +1,1 @@
+df53bdd49507cbe30db7a3fa0b41ea515ece90e3 UCIS.Core
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ARClient/ARClient.csproj	Sat Nov 08 22:43:51 2014 +0100
@@ -0,0 +1,111 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProductVersion>9.0.30729</ProductVersion>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{84FCD326-D7C1-4D03-845B-433CA0A4E696}</ProjectGuid>
+    <OutputType>WinExe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>ARClient</RootNamespace>
+    <AssemblyName>ARClient</AssemblyName>
+    <TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="System" />
+    <Reference Include="System.Drawing" />
+    <Reference Include="System.Windows.Forms" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="Form1.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="Form1.Designer.cs">
+      <DependentUpon>Form1.cs</DependentUpon>
+    </Compile>
+    <Compile Include="frmEditResource.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="frmEditResource.Designer.cs">
+      <DependentUpon>frmEditResource.cs</DependentUpon>
+    </Compile>
+    <Compile Include="frmSettings.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="frmSettings.Designer.cs">
+      <DependentUpon>frmSettings.cs</DependentUpon>
+    </Compile>
+    <Compile Include="frmSync.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="frmSync.Designer.cs">
+      <DependentUpon>frmSync.cs</DependentUpon>
+    </Compile>
+    <Compile Include="frmTextInput.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="frmTextInput.Designer.cs">
+      <DependentUpon>frmTextInput.cs</DependentUpon>
+    </Compile>
+    <Compile Include="MARC.cs" />
+    <Compile Include="Program.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+    <EmbeddedResource Include="Form1.resx">
+      <DependentUpon>Form1.cs</DependentUpon>
+    </EmbeddedResource>
+    <EmbeddedResource Include="frmSettings.resx">
+      <DependentUpon>frmSettings.cs</DependentUpon>
+    </EmbeddedResource>
+    <EmbeddedResource Include="frmSync.resx">
+      <DependentUpon>frmSync.cs</DependentUpon>
+    </EmbeddedResource>
+    <EmbeddedResource Include="frmTextInput.resx">
+      <DependentUpon>frmTextInput.cs</DependentUpon>
+    </EmbeddedResource>
+    <None Include="Properties\Settings.settings">
+      <Generator>SettingsSingleFileGenerator</Generator>
+      <LastGenOutput>Settings.Designer.cs</LastGenOutput>
+    </None>
+    <Compile Include="Properties\Settings.Designer.cs">
+      <AutoGen>True</AutoGen>
+      <DependentUpon>Settings.settings</DependentUpon>
+      <DesignTimeSharedInput>True</DesignTimeSharedInput>
+    </Compile>
+  </ItemGroup>
+  <ItemGroup>
+    <EmbeddedResource Include="frmEditResource.resx">
+      <DependentUpon>frmEditResource.cs</DependentUpon>
+    </EmbeddedResource>
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\UCIS.Core\UCIS.Core.csproj">
+      <Project>{3200885C-E36B-400B-BE21-6209B47832E6}</Project>
+      <Name>UCIS.Core</Name>
+    </ProjectReference>
+  </ItemGroup>
+  <ItemGroup>
+    <EmbeddedResource Include="..\UCIS.Core\bin\Release\UCIS.Core.dll">
+      <Link>UCIS.Core.dll</Link>
+    </EmbeddedResource>
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+</Project>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ARClient/Form1.Designer.cs	Sat Nov 08 22:43:51 2014 +0100
@@ -0,0 +1,473 @@
+namespace ARClient {
+	partial class Form1 {
+		/// <summary>
+		/// Required designer variable.
+		/// </summary>
+		private System.ComponentModel.IContainer components = null;
+
+		/// <summary>
+		/// Clean up any resources being used.
+		/// </summary>
+		/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+		protected override void Dispose(bool disposing) {
+			if (disposing && (components != null)) {
+				components.Dispose();
+			}
+			base.Dispose(disposing);
+		}
+
+		#region Windows Form Designer generated code
+
+		/// <summary>
+		/// Required method for Designer support - do not modify
+		/// the contents of this method with the code editor.
+		/// </summary>
+		private void InitializeComponent() {
+			this.lvwResourceValue = new System.Windows.Forms.TreeView();
+			this.splitContainer1 = new System.Windows.Forms.SplitContainer();
+			this.groupBox1 = new System.Windows.Forms.GroupBox();
+			this.lstResources = new System.Windows.Forms.ListBox();
+			this.cmbResourceFilter = new System.Windows.Forms.ComboBox();
+			this.groupBox3 = new System.Windows.Forms.GroupBox();
+			this.groupBox2 = new System.Windows.Forms.GroupBox();
+			this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
+			this.txtResourceSerial = new System.Windows.Forms.TextBox();
+			this.label3 = new System.Windows.Forms.Label();
+			this.label4 = new System.Windows.Forms.Label();
+			this.txtResourceStatus = new System.Windows.Forms.TextBox();
+			this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
+			this.txtResourceLabel = new System.Windows.Forms.TextBox();
+			this.txtResourceKey = new System.Windows.Forms.TextBox();
+			this.label1 = new System.Windows.Forms.Label();
+			this.label2 = new System.Windows.Forms.Label();
+			this.menuStrip1 = new System.Windows.Forms.MenuStrip();
+			this.databaseToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+			this.newDatabaseToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+			this.reloadDatabaseToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+			this.saveDatabaseToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+			this.openDatabaseToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+			this.saveDatabaseAsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+			this.importDatabaseToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+			this.synchronizeResourcesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+			this.settingsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+			this.resourceToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+			this.addNewToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+			this.editSelectedToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+			this.deleteSelectedToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+			this.addKeyToFilterListToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+			this.splitContainer1.Panel1.SuspendLayout();
+			this.splitContainer1.Panel2.SuspendLayout();
+			this.splitContainer1.SuspendLayout();
+			this.groupBox1.SuspendLayout();
+			this.groupBox3.SuspendLayout();
+			this.groupBox2.SuspendLayout();
+			this.tableLayoutPanel2.SuspendLayout();
+			this.tableLayoutPanel1.SuspendLayout();
+			this.menuStrip1.SuspendLayout();
+			this.SuspendLayout();
+			// 
+			// lvwResourceValue
+			// 
+			this.lvwResourceValue.Dock = System.Windows.Forms.DockStyle.Fill;
+			this.lvwResourceValue.Location = new System.Drawing.Point(3, 16);
+			this.lvwResourceValue.Name = "lvwResourceValue";
+			this.lvwResourceValue.Size = new System.Drawing.Size(715, 306);
+			this.lvwResourceValue.TabIndex = 3;
+			// 
+			// splitContainer1
+			// 
+			this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
+			this.splitContainer1.Location = new System.Drawing.Point(0, 24);
+			this.splitContainer1.Name = "splitContainer1";
+			// 
+			// splitContainer1.Panel1
+			// 
+			this.splitContainer1.Panel1.Controls.Add(this.groupBox1);
+			// 
+			// splitContainer1.Panel2
+			// 
+			this.splitContainer1.Panel2.Controls.Add(this.groupBox3);
+			this.splitContainer1.Panel2.Controls.Add(this.groupBox2);
+			this.splitContainer1.Size = new System.Drawing.Size(944, 422);
+			this.splitContainer1.SplitterDistance = 219;
+			this.splitContainer1.TabIndex = 4;
+			// 
+			// groupBox1
+			// 
+			this.groupBox1.Controls.Add(this.lstResources);
+			this.groupBox1.Controls.Add(this.cmbResourceFilter);
+			this.groupBox1.Dock = System.Windows.Forms.DockStyle.Fill;
+			this.groupBox1.Location = new System.Drawing.Point(0, 0);
+			this.groupBox1.Name = "groupBox1";
+			this.groupBox1.Size = new System.Drawing.Size(219, 422);
+			this.groupBox1.TabIndex = 4;
+			this.groupBox1.TabStop = false;
+			this.groupBox1.Text = "Resources";
+			// 
+			// lstResources
+			// 
+			this.lstResources.Dock = System.Windows.Forms.DockStyle.Fill;
+			this.lstResources.FormattingEnabled = true;
+			this.lstResources.Location = new System.Drawing.Point(3, 37);
+			this.lstResources.Name = "lstResources";
+			this.lstResources.SelectionMode = System.Windows.Forms.SelectionMode.MultiExtended;
+			this.lstResources.Size = new System.Drawing.Size(213, 381);
+			this.lstResources.Sorted = true;
+			this.lstResources.TabIndex = 0;
+			this.lstResources.SelectedIndexChanged += new System.EventHandler(this.lstResources_SelectedIndexChanged);
+			this.lstResources.DoubleClick += new System.EventHandler(this.lstResources_DoubleClick);
+			// 
+			// cmbResourceFilter
+			// 
+			this.cmbResourceFilter.Dock = System.Windows.Forms.DockStyle.Top;
+			this.cmbResourceFilter.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+			this.cmbResourceFilter.FormattingEnabled = true;
+			this.cmbResourceFilter.Items.AddRange(new object[] {
+            "All resources",
+            "My resources",
+            "Filtered resources",
+            "Expired resources",
+            "Domain names",
+            "IPv4 networks",
+            "IPv6 networks",
+            "AS numbers",
+            "Key information"});
+			this.cmbResourceFilter.Location = new System.Drawing.Point(3, 16);
+			this.cmbResourceFilter.Name = "cmbResourceFilter";
+			this.cmbResourceFilter.Size = new System.Drawing.Size(213, 21);
+			this.cmbResourceFilter.TabIndex = 2;
+			this.cmbResourceFilter.SelectedIndexChanged += new System.EventHandler(this.cmbResourceFilter_SelectedIndexChanged);
+			// 
+			// groupBox3
+			// 
+			this.groupBox3.Controls.Add(this.lvwResourceValue);
+			this.groupBox3.Dock = System.Windows.Forms.DockStyle.Fill;
+			this.groupBox3.Location = new System.Drawing.Point(0, 97);
+			this.groupBox3.Name = "groupBox3";
+			this.groupBox3.Size = new System.Drawing.Size(721, 325);
+			this.groupBox3.TabIndex = 5;
+			this.groupBox3.TabStop = false;
+			this.groupBox3.Text = "Resource value";
+			// 
+			// groupBox2
+			// 
+			this.groupBox2.AutoSize = true;
+			this.groupBox2.Controls.Add(this.tableLayoutPanel2);
+			this.groupBox2.Controls.Add(this.tableLayoutPanel1);
+			this.groupBox2.Dock = System.Windows.Forms.DockStyle.Top;
+			this.groupBox2.Location = new System.Drawing.Point(0, 0);
+			this.groupBox2.Name = "groupBox2";
+			this.groupBox2.Size = new System.Drawing.Size(721, 97);
+			this.groupBox2.TabIndex = 4;
+			this.groupBox2.TabStop = false;
+			this.groupBox2.Text = "Resource information";
+			// 
+			// tableLayoutPanel2
+			// 
+			this.tableLayoutPanel2.AutoSize = true;
+			this.tableLayoutPanel2.ColumnCount = 4;
+			this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 100F));
+			this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
+			this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 100F));
+			this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
+			this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F));
+			this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F));
+			this.tableLayoutPanel2.Controls.Add(this.txtResourceSerial, 1, 0);
+			this.tableLayoutPanel2.Controls.Add(this.label3, 0, 0);
+			this.tableLayoutPanel2.Controls.Add(this.label4, 2, 0);
+			this.tableLayoutPanel2.Controls.Add(this.txtResourceStatus, 3, 0);
+			this.tableLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Top;
+			this.tableLayoutPanel2.Location = new System.Drawing.Point(3, 68);
+			this.tableLayoutPanel2.Name = "tableLayoutPanel2";
+			this.tableLayoutPanel2.RowCount = 1;
+			this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+			this.tableLayoutPanel2.Size = new System.Drawing.Size(715, 26);
+			this.tableLayoutPanel2.TabIndex = 7;
+			// 
+			// txtResourceSerial
+			// 
+			this.txtResourceSerial.Dock = System.Windows.Forms.DockStyle.Fill;
+			this.txtResourceSerial.Location = new System.Drawing.Point(103, 3);
+			this.txtResourceSerial.Name = "txtResourceSerial";
+			this.txtResourceSerial.ReadOnly = true;
+			this.txtResourceSerial.Size = new System.Drawing.Size(251, 20);
+			this.txtResourceSerial.TabIndex = 7;
+			// 
+			// label3
+			// 
+			this.label3.Anchor = System.Windows.Forms.AnchorStyles.Left;
+			this.label3.AutoSize = true;
+			this.label3.Location = new System.Drawing.Point(3, 6);
+			this.label3.Name = "label3";
+			this.label3.Size = new System.Drawing.Size(33, 13);
+			this.label3.TabIndex = 4;
+			this.label3.Text = "Serial";
+			this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+			// 
+			// label4
+			// 
+			this.label4.Anchor = System.Windows.Forms.AnchorStyles.Left;
+			this.label4.AutoSize = true;
+			this.label4.Location = new System.Drawing.Point(360, 6);
+			this.label4.Name = "label4";
+			this.label4.Size = new System.Drawing.Size(37, 13);
+			this.label4.TabIndex = 5;
+			this.label4.Text = "Status";
+			this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+			// 
+			// txtResourceStatus
+			// 
+			this.txtResourceStatus.Dock = System.Windows.Forms.DockStyle.Fill;
+			this.txtResourceStatus.Location = new System.Drawing.Point(460, 3);
+			this.txtResourceStatus.Name = "txtResourceStatus";
+			this.txtResourceStatus.ReadOnly = true;
+			this.txtResourceStatus.Size = new System.Drawing.Size(252, 20);
+			this.txtResourceStatus.TabIndex = 8;
+			// 
+			// tableLayoutPanel1
+			// 
+			this.tableLayoutPanel1.AutoSize = true;
+			this.tableLayoutPanel1.ColumnCount = 2;
+			this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 100F));
+			this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+			this.tableLayoutPanel1.Controls.Add(this.txtResourceLabel, 1, 0);
+			this.tableLayoutPanel1.Controls.Add(this.txtResourceKey, 1, 1);
+			this.tableLayoutPanel1.Controls.Add(this.label1, 0, 0);
+			this.tableLayoutPanel1.Controls.Add(this.label2, 0, 1);
+			this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Top;
+			this.tableLayoutPanel1.Location = new System.Drawing.Point(3, 16);
+			this.tableLayoutPanel1.Name = "tableLayoutPanel1";
+			this.tableLayoutPanel1.RowCount = 2;
+			this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
+			this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
+			this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
+			this.tableLayoutPanel1.Size = new System.Drawing.Size(715, 52);
+			this.tableLayoutPanel1.TabIndex = 6;
+			// 
+			// txtResourceLabel
+			// 
+			this.txtResourceLabel.Dock = System.Windows.Forms.DockStyle.Fill;
+			this.txtResourceLabel.Location = new System.Drawing.Point(103, 3);
+			this.txtResourceLabel.Name = "txtResourceLabel";
+			this.txtResourceLabel.ReadOnly = true;
+			this.txtResourceLabel.Size = new System.Drawing.Size(609, 20);
+			this.txtResourceLabel.TabIndex = 6;
+			// 
+			// txtResourceKey
+			// 
+			this.txtResourceKey.Dock = System.Windows.Forms.DockStyle.Fill;
+			this.txtResourceKey.Location = new System.Drawing.Point(103, 29);
+			this.txtResourceKey.Name = "txtResourceKey";
+			this.txtResourceKey.ReadOnly = true;
+			this.txtResourceKey.Size = new System.Drawing.Size(609, 20);
+			this.txtResourceKey.TabIndex = 5;
+			// 
+			// label1
+			// 
+			this.label1.Anchor = System.Windows.Forms.AnchorStyles.Left;
+			this.label1.AutoSize = true;
+			this.label1.Location = new System.Drawing.Point(3, 6);
+			this.label1.Name = "label1";
+			this.label1.Size = new System.Drawing.Size(53, 13);
+			this.label1.TabIndex = 0;
+			this.label1.Text = "Resource";
+			this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+			// 
+			// label2
+			// 
+			this.label2.Anchor = System.Windows.Forms.AnchorStyles.Left;
+			this.label2.AutoSize = true;
+			this.label2.Location = new System.Drawing.Point(3, 32);
+			this.label2.Name = "label2";
+			this.label2.Size = new System.Drawing.Size(58, 13);
+			this.label2.TabIndex = 1;
+			this.label2.Text = "Owner key";
+			this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+			// 
+			// menuStrip1
+			// 
+			this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
+            this.databaseToolStripMenuItem,
+            this.synchronizeResourcesToolStripMenuItem,
+            this.settingsToolStripMenuItem,
+            this.resourceToolStripMenuItem});
+			this.menuStrip1.Location = new System.Drawing.Point(0, 0);
+			this.menuStrip1.Name = "menuStrip1";
+			this.menuStrip1.Size = new System.Drawing.Size(944, 24);
+			this.menuStrip1.TabIndex = 5;
+			this.menuStrip1.Text = "menuStrip1";
+			// 
+			// databaseToolStripMenuItem
+			// 
+			this.databaseToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
+            this.newDatabaseToolStripMenuItem,
+            this.reloadDatabaseToolStripMenuItem,
+            this.saveDatabaseToolStripMenuItem,
+            this.openDatabaseToolStripMenuItem,
+            this.saveDatabaseAsToolStripMenuItem,
+            this.importDatabaseToolStripMenuItem});
+			this.databaseToolStripMenuItem.Name = "databaseToolStripMenuItem";
+			this.databaseToolStripMenuItem.Size = new System.Drawing.Size(65, 20);
+			this.databaseToolStripMenuItem.Text = "Database";
+			// 
+			// newDatabaseToolStripMenuItem
+			// 
+			this.newDatabaseToolStripMenuItem.Name = "newDatabaseToolStripMenuItem";
+			this.newDatabaseToolStripMenuItem.Size = new System.Drawing.Size(171, 22);
+			this.newDatabaseToolStripMenuItem.Text = "New database";
+			this.newDatabaseToolStripMenuItem.Click += new System.EventHandler(this.newDatabaseToolStripMenuItem_Click);
+			// 
+			// reloadDatabaseToolStripMenuItem
+			// 
+			this.reloadDatabaseToolStripMenuItem.Name = "reloadDatabaseToolStripMenuItem";
+			this.reloadDatabaseToolStripMenuItem.Size = new System.Drawing.Size(171, 22);
+			this.reloadDatabaseToolStripMenuItem.Text = "Reload database";
+			this.reloadDatabaseToolStripMenuItem.Click += new System.EventHandler(this.reloadDatabaseToolStripMenuItem_Click);
+			// 
+			// saveDatabaseToolStripMenuItem
+			// 
+			this.saveDatabaseToolStripMenuItem.Name = "saveDatabaseToolStripMenuItem";
+			this.saveDatabaseToolStripMenuItem.Size = new System.Drawing.Size(171, 22);
+			this.saveDatabaseToolStripMenuItem.Text = "Save database";
+			this.saveDatabaseToolStripMenuItem.Click += new System.EventHandler(this.saveDatabaseToolStripMenuItem_Click);
+			// 
+			// openDatabaseToolStripMenuItem
+			// 
+			this.openDatabaseToolStripMenuItem.Name = "openDatabaseToolStripMenuItem";
+			this.openDatabaseToolStripMenuItem.Size = new System.Drawing.Size(171, 22);
+			this.openDatabaseToolStripMenuItem.Text = "Open database";
+			this.openDatabaseToolStripMenuItem.Click += new System.EventHandler(this.openDatabaseToolStripMenuItem_Click);
+			// 
+			// saveDatabaseAsToolStripMenuItem
+			// 
+			this.saveDatabaseAsToolStripMenuItem.Name = "saveDatabaseAsToolStripMenuItem";
+			this.saveDatabaseAsToolStripMenuItem.Size = new System.Drawing.Size(171, 22);
+			this.saveDatabaseAsToolStripMenuItem.Text = "Save database as";
+			this.saveDatabaseAsToolStripMenuItem.Click += new System.EventHandler(this.saveDatabaseAsToolStripMenuItem_Click);
+			// 
+			// importDatabaseToolStripMenuItem
+			// 
+			this.importDatabaseToolStripMenuItem.Name = "importDatabaseToolStripMenuItem";
+			this.importDatabaseToolStripMenuItem.Size = new System.Drawing.Size(171, 22);
+			this.importDatabaseToolStripMenuItem.Text = "Import database";
+			this.importDatabaseToolStripMenuItem.Click += new System.EventHandler(this.importDatabaseToolStripMenuItem_Click);
+			// 
+			// synchronizeResourcesToolStripMenuItem
+			// 
+			this.synchronizeResourcesToolStripMenuItem.Name = "synchronizeResourcesToolStripMenuItem";
+			this.synchronizeResourcesToolStripMenuItem.Size = new System.Drawing.Size(127, 20);
+			this.synchronizeResourcesToolStripMenuItem.Text = "Synchronize resources";
+			// 
+			// settingsToolStripMenuItem
+			// 
+			this.settingsToolStripMenuItem.Name = "settingsToolStripMenuItem";
+			this.settingsToolStripMenuItem.Size = new System.Drawing.Size(58, 20);
+			this.settingsToolStripMenuItem.Text = "Settings";
+			this.settingsToolStripMenuItem.Click += new System.EventHandler(this.settingsToolStripMenuItem_Click);
+			// 
+			// resourceToolStripMenuItem
+			// 
+			this.resourceToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
+            this.addNewToolStripMenuItem,
+            this.editSelectedToolStripMenuItem,
+            this.deleteSelectedToolStripMenuItem,
+            this.addKeyToFilterListToolStripMenuItem});
+			this.resourceToolStripMenuItem.Name = "resourceToolStripMenuItem";
+			this.resourceToolStripMenuItem.Size = new System.Drawing.Size(64, 20);
+			this.resourceToolStripMenuItem.Text = "Resource";
+			// 
+			// addNewToolStripMenuItem
+			// 
+			this.addNewToolStripMenuItem.Name = "addNewToolStripMenuItem";
+			this.addNewToolStripMenuItem.Size = new System.Drawing.Size(178, 22);
+			this.addNewToolStripMenuItem.Text = "Add new";
+			this.addNewToolStripMenuItem.Click += new System.EventHandler(this.addNewToolStripMenuItem_Click);
+			// 
+			// editSelectedToolStripMenuItem
+			// 
+			this.editSelectedToolStripMenuItem.Name = "editSelectedToolStripMenuItem";
+			this.editSelectedToolStripMenuItem.Size = new System.Drawing.Size(178, 22);
+			this.editSelectedToolStripMenuItem.Text = "Edit selected";
+			this.editSelectedToolStripMenuItem.Click += new System.EventHandler(this.editSelectedToolStripMenuItem_Click);
+			// 
+			// deleteSelectedToolStripMenuItem
+			// 
+			this.deleteSelectedToolStripMenuItem.Name = "deleteSelectedToolStripMenuItem";
+			this.deleteSelectedToolStripMenuItem.Size = new System.Drawing.Size(178, 22);
+			this.deleteSelectedToolStripMenuItem.Text = "Delete selected";
+			this.deleteSelectedToolStripMenuItem.Click += new System.EventHandler(this.deleteSelectedToolStripMenuItem_Click);
+			// 
+			// addKeyToFilterListToolStripMenuItem
+			// 
+			this.addKeyToFilterListToolStripMenuItem.Name = "addKeyToFilterListToolStripMenuItem";
+			this.addKeyToFilterListToolStripMenuItem.Size = new System.Drawing.Size(178, 22);
+			this.addKeyToFilterListToolStripMenuItem.Text = "Add key to filter list";
+			this.addKeyToFilterListToolStripMenuItem.Click += new System.EventHandler(this.addKeyToFilterListToolStripMenuItem_Click);
+			// 
+			// Form1
+			// 
+			this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+			this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+			this.ClientSize = new System.Drawing.Size(944, 446);
+			this.Controls.Add(this.splitContainer1);
+			this.Controls.Add(this.menuStrip1);
+			this.Name = "Form1";
+			this.Text = "MARC Resource Manager";
+			this.Load += new System.EventHandler(this.Form1_Load);
+			this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Form1_FormClosing);
+			this.splitContainer1.Panel1.ResumeLayout(false);
+			this.splitContainer1.Panel2.ResumeLayout(false);
+			this.splitContainer1.Panel2.PerformLayout();
+			this.splitContainer1.ResumeLayout(false);
+			this.groupBox1.ResumeLayout(false);
+			this.groupBox3.ResumeLayout(false);
+			this.groupBox2.ResumeLayout(false);
+			this.groupBox2.PerformLayout();
+			this.tableLayoutPanel2.ResumeLayout(false);
+			this.tableLayoutPanel2.PerformLayout();
+			this.tableLayoutPanel1.ResumeLayout(false);
+			this.tableLayoutPanel1.PerformLayout();
+			this.menuStrip1.ResumeLayout(false);
+			this.menuStrip1.PerformLayout();
+			this.ResumeLayout(false);
+			this.PerformLayout();
+
+		}
+
+		#endregion
+
+		private System.Windows.Forms.TreeView lvwResourceValue;
+		private System.Windows.Forms.SplitContainer splitContainer1;
+		private System.Windows.Forms.GroupBox groupBox1;
+		private System.Windows.Forms.ComboBox cmbResourceFilter;
+		private System.Windows.Forms.GroupBox groupBox3;
+		private System.Windows.Forms.GroupBox groupBox2;
+		private System.Windows.Forms.MenuStrip menuStrip1;
+		private System.Windows.Forms.ToolStripMenuItem synchronizeResourcesToolStripMenuItem;
+		private System.Windows.Forms.Label label2;
+		private System.Windows.Forms.Label label1;
+		private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
+		private System.Windows.Forms.TextBox txtResourceKey;
+		private System.Windows.Forms.TableLayoutPanel tableLayoutPanel2;
+		private System.Windows.Forms.TextBox txtResourceSerial;
+		private System.Windows.Forms.Label label3;
+		private System.Windows.Forms.Label label4;
+		private System.Windows.Forms.TextBox txtResourceStatus;
+		private System.Windows.Forms.TextBox txtResourceLabel;
+		private System.Windows.Forms.ToolStripMenuItem settingsToolStripMenuItem;
+		private System.Windows.Forms.ToolStripMenuItem databaseToolStripMenuItem;
+		private System.Windows.Forms.ToolStripMenuItem newDatabaseToolStripMenuItem;
+		private System.Windows.Forms.ToolStripMenuItem reloadDatabaseToolStripMenuItem;
+		private System.Windows.Forms.ToolStripMenuItem saveDatabaseToolStripMenuItem;
+		private System.Windows.Forms.ToolStripMenuItem openDatabaseToolStripMenuItem;
+		private System.Windows.Forms.ToolStripMenuItem saveDatabaseAsToolStripMenuItem;
+		private System.Windows.Forms.ToolStripMenuItem importDatabaseToolStripMenuItem;
+		private System.Windows.Forms.ToolStripMenuItem resourceToolStripMenuItem;
+		private System.Windows.Forms.ToolStripMenuItem addNewToolStripMenuItem;
+		private System.Windows.Forms.ToolStripMenuItem editSelectedToolStripMenuItem;
+		private System.Windows.Forms.ToolStripMenuItem deleteSelectedToolStripMenuItem;
+		private System.Windows.Forms.ToolStripMenuItem addKeyToFilterListToolStripMenuItem;
+		internal System.Windows.Forms.ListBox lstResources;
+	}
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ARClient/Form1.cs	Sat Nov 08 22:43:51 2014 +0100
@@ -0,0 +1,600 @@
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.IO;
+using System.Text;
+using System.Windows.Forms;
+using UCIS.NaCl.v2;
+using UCIS.Util;
+
+namespace ARClient {
+	partial class Form1 : Form {
+		public Boolean DatabaseSaved { get; set; }
+		public String Database { get; private set; }
+		public ed25519keypair SecretKey { get; set; }
+		public MARCKey PublicKey { get; set; }
+		public Dictionary<MARCLabel, MARCUpdate> Resources { get; private set; }
+		public List<String> Peers { get; private set; }
+		public List<MARCKey> BlockedKeys { get; private set; }
+		public ResourceTypeFilter FilterFlags { get; set; }
+
+		public enum ResourceTypeFilter : uint {
+			AnonetIPv4 = 1,
+			AnonetIPv6 = 2,
+			AnonetDomain = 4,
+			ASNumber= 8,
+			OtherIPv4 = 16,
+			OtherIPv6 = 32,
+			OtherDomain = 64,
+			Other = 128,
+			Invalid = 256,
+			Key = 512,
+
+			None = 0,
+			All = 0xffffffff,
+		}
+
+		public Form1() {
+			InitializeComponent();
+		}
+
+		private void Form1_Load(object sender, EventArgs e) {
+			DatabaseSaved = true;
+			String dbpath = Path.Combine(Environment.CurrentDirectory, "marc.mdb");
+			if (!File.Exists(dbpath) || !LoadDatabase(dbpath)) {
+				MessageBox.Show("The standard database could not be loaded. The system will now generate a new key pair. If you already have a key pair and want to use it, make sure to import the key file or open the existing database.", "MARC - New database", MessageBoxButtons.OK, MessageBoxIcon.Information);
+				CreateDatabase();
+				if (!File.Exists(dbpath)) Database = dbpath;
+			}
+			cmbResourceFilter.SelectedIndex = 0;
+		}
+
+		public void UpdatePeersList() {
+			synchronizeResourcesToolStripMenuItem.DropDownItems.Clear();
+			ToolStripItem item = synchronizeResourcesToolStripMenuItem.DropDownItems.Add("All peers");
+			item.Tag = null;
+			item.Click += SynchronizeServerToolStripMenuItem_Click;
+			foreach (String peer in Peers) {
+				item = synchronizeResourcesToolStripMenuItem.DropDownItems.Add(peer);
+				item.Tag = peer;
+				item.Click += SynchronizeServerToolStripMenuItem_Click;
+			}
+		}
+
+		internal Boolean IsResourceFiltered(MARCUpdate update) {
+			if (BlockedKeys.Contains(update.Key)) return true;
+			Byte[] label = update.Label.Bytes;
+			if (label == null || label.Length < 1) return 0 != (FilterFlags & ResourceTypeFilter.Invalid);
+			switch (label[0]) {
+				case 0:
+					if (label.Length != 33 || !ArrayUtil.Equal(ArrayUtil.Slice(label, 1), update.Key.Bytes)) return 0 == (FilterFlags & ResourceTypeFilter.Invalid);
+					return 0 == (FilterFlags & ResourceTypeFilter.Key);
+				case 1:
+					if (label.Length != 6) return 0 == (FilterFlags & ResourceTypeFilter.Invalid);
+					if (label[5] > 32) return 0 == (FilterFlags & ResourceTypeFilter.Invalid);
+					if (label[1] == 1) return 0 == (FilterFlags & ResourceTypeFilter.AnonetIPv4);
+					return 0 == (FilterFlags & ResourceTypeFilter.OtherIPv4);
+				case 2:
+					if (label.Length != 18) return 0 == (FilterFlags & ResourceTypeFilter.Invalid);
+					if (label[17] > 128) return 0 == (FilterFlags & ResourceTypeFilter.Invalid);
+					if (label[1] == 0xfc || label[1] == 0xfd) return 0 == (FilterFlags & ResourceTypeFilter.AnonetIPv6);
+					return 0 == (FilterFlags & ResourceTypeFilter.OtherIPv6);
+				case 3:
+					if (label.Length != 5) return 0 == (FilterFlags & ResourceTypeFilter.Invalid);
+					return 0 == (FilterFlags & ResourceTypeFilter.ASNumber);
+				case 4:
+					String dom = Encoding.UTF8.GetString(label, 1, label.Length - 1);
+					if (dom.EndsWith(".ano")) return 0 == (FilterFlags & ResourceTypeFilter.AnonetDomain);
+					return 0 == (FilterFlags & ResourceTypeFilter.OtherDomain);
+				default:
+					return 0 == (FilterFlags & ResourceTypeFilter.Other);
+			}
+		}
+
+		public void GenerateKeyPair() {
+			if (DialogResult.Yes != MessageBox.Show(this, "Generating a new key pair will erase your old key pair from the local database. If you lose your key you will no longer be able to update your resource claims. Please make sure that you either have a backup of your key, or have no claims! Do you want to continue?", "MARC - Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation)) {
+				return;
+			}
+			if (DialogResult.Yes != MessageBox.Show(this, "Are you really sure you want to overwrite your key? There is no way back! Did you make a backup?", "MARC - Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation)) {
+				return;
+			}
+			SecretKey = new ed25519keypair();
+			PublicKey = new MARCKey(SecretKey.PublicKey);
+			DatabaseSaved = false;
+		}
+
+		#region "Database UI stuff"
+		private Boolean WarnDatabaseSaved() {
+			if (DatabaseSaved) return true;
+			return DialogResult.Yes == MessageBox.Show(this, "The current database is not saved. You may lose data if you continue. Losing your key pair will render your unable to update your resources. Are you sure you want to continue?", "MARC - Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation);
+		}
+		private Boolean SaveDatabase() {
+			if (Database == null) {
+				return SaveDatabaseAs();
+			} else {
+				return SaveDatabase(Database);
+			}
+		}
+		private Boolean SaveDatabaseAs() {
+			SaveFileDialog dialog = new SaveFileDialog();
+			dialog.OverwritePrompt = true;
+			dialog.Title = "MARC - Save database file";
+			SetupFileDialog(dialog);
+			if (dialog.ShowDialog(this) != DialogResult.OK) return false;
+			return SaveDatabase(dialog.FileName);
+		}
+		private String SelectDatabaseOpen(String title) {
+			OpenFileDialog dialog = new OpenFileDialog();
+			dialog.Multiselect = false;
+			dialog.ShowReadOnly = false;
+			dialog.CheckFileExists = true;
+			dialog.Title = "MARC - " + title;
+			SetupFileDialog(dialog);
+			if (dialog.ShowDialog(this) != DialogResult.OK) return null;
+			return dialog.FileName;
+		}
+		private void SetupFileDialog(FileDialog dialog) {
+			dialog.AddExtension = true;
+			dialog.CheckPathExists = true;
+			dialog.DefaultExt = "mdb";
+			dialog.DereferenceLinks = true;
+			dialog.FileName = Database;
+			dialog.Filter = "MARC Database files (*.mdb)|*.mdb|All files (*.*)|*.*";
+			dialog.InitialDirectory = Database == null ? Environment.CurrentDirectory : Path.GetDirectoryName(Database);
+			dialog.SupportMultiDottedExtensions = true;
+			dialog.ValidateNames = true;
+		}
+		private void Form1_FormClosing(object sender, FormClosingEventArgs e) {
+			if (DatabaseSaved) return;
+			switch (MessageBox.Show(this, "The current database has not been saved. Losing your key pair may render you unable to update your resources! Do you want to save the database?", "MARC - Warning", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Warning)) {
+				case DialogResult.Yes:
+					if (!SaveDatabase()) e.Cancel = true;
+					break;
+				case DialogResult.No:
+					break;
+				case DialogResult.Cancel:
+					e.Cancel = true;
+					break;
+			}
+		}
+		#endregion
+
+		#region "Database file"
+		private Boolean LoadDatabase(String fn) {
+			if (!WarnDatabaseSaved()) return false;
+			try {
+				lstResources.BeginUpdate();
+				lstResources.Sorted = false;
+				using (FileStream fs = File.OpenRead(fn)) {
+					BinaryReader br = new BinaryReader(fs, Encoding.UTF8);
+					if (br.ReadString() != "MARC") throw new Exception("This file is not a MARC database");
+					Byte version = br.ReadByte();
+					Resources = new Dictionary<MARCLabel, MARCUpdate>();
+					Peers = new List<string>();
+					BlockedKeys = new List<MARCKey>();
+					FilterFlags = ResourceTypeFilter.All;
+					lstResources.Items.Clear();
+					if (version == 2) {
+						SecretKey = new ed25519keypair(br.ReadBytes(32));
+						PublicKey = new MARCKey(SecretKey.PublicKey);
+
+						Int32 c = br.ReadInt32();
+						for (int i = 0; i < c; i++) {
+							Int32 len = br.ReadInt32();
+							if (len == 0) continue;
+							ImportUpdate(br.ReadBytes(len), true);
+						}
+
+						c = br.ReadInt32();
+						for (int i = 0; i < c; i++) Peers.Add(br.ReadString());
+						c = br.ReadInt32();
+						for (int i = 0; i < c; i++) BlockedKeys.Add(new MARCKey(br.ReadBytes(32)));
+
+						FilterFlags = (ResourceTypeFilter)br.ReadInt32();
+					} else if (version == 3) {
+						UInt32 len = Functions.FromBigEndian((UInt32)br.ReadInt32());
+						{
+							Byte[] metabytes = br.ReadBytes((int)len);
+							IDictionary metadata = MARCUpdate.DecodeValue(metabytes) as IDictionary;
+							if (metadata != null) {
+								if (metadata["keys"] != null)
+									foreach (IDictionary metakey in (IList)metadata["keys"]) {
+										if (!metakey.Contains("key")) continue;
+										SecretKey = new ed25519keypair(((BinaryString)metakey["key"]).Bytes);
+										PublicKey = new MARCKey(SecretKey.PublicKey);
+										break;
+									}
+								if (metadata["peers"] != null)
+									foreach (IDictionary metapeer in (IList)metadata["peers"])
+										Peers.Add(metapeer["address"].ToString());
+								if (metadata["blockedkeys"] != null)
+									foreach (BinaryString metablockedkey in (IList)metadata["blockedkeys"])
+										BlockedKeys.Add(new MARCKey(metablockedkey.Bytes));
+								if (metadata["filterflags"] != null)
+									FilterFlags = (ResourceTypeFilter)Functions.DecodeInt32BigEndian(((BinaryString)metadata["filterflags"]).Bytes, 0);
+							}
+						}
+						while (true) {
+							Byte[] lenbytes = br.ReadBytes(4);
+							if (lenbytes.Length == 0) break;
+							if (lenbytes.Length != 4) throw new Exception("Database truncated");
+							len = Functions.DecodeInt32BigEndian(lenbytes, 0);
+							ImportUpdate(br.ReadBytes((int)len), true);
+						}
+					} else {
+						throw new Exception("Unsupported database version");
+					}
+					br.Close();
+					Database = fn;
+					DatabaseSaved = true;
+					UpdatePeersList();
+					return true;
+				}
+			} catch (Exception ex) {
+				Console.Error.WriteLine(ex.ToString());
+				MessageBox.Show(this, "Failed to load the database: " + ex.Message, "MARC - Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
+				return false;
+			} finally {
+				lstResources.Sorted = true;
+				lstResources.EndUpdate();
+			}
+		}
+		private Boolean ImportDatabase(String fn) {
+			try {
+				lstResources.BeginUpdate();
+				lstResources.Sorted = false;
+				using (FileStream fs = File.OpenRead(fn)) {
+					BinaryReader br = new BinaryReader(fs, Encoding.UTF8);
+					if (br.ReadString() != "MARC") throw new Exception("This file is not a MARC database");
+					Byte version = br.ReadByte();
+					if (version == 2) {
+						br.ReadBytes(32);
+						Int32 c = br.ReadInt32();
+						for (int i = 0; i < c; i++) {
+							Int32 len = br.ReadInt32();
+							if (len == 0) continue;
+							ImportUpdate(br.ReadBytes(len), false);
+						}
+					} else if (version == 3) {
+						UInt32 len = Functions.FromBigEndian((UInt32)br.ReadInt32());
+						br.ReadBytes((int)len);
+						while (true) {
+							Byte[] lenbytes = br.ReadBytes(4);
+							if (lenbytes.Length == 0) break;
+							if (lenbytes.Length != 4) throw new Exception("Database truncated");
+							len = Functions.DecodeInt32BigEndian(lenbytes, 0);
+							ImportUpdate(br.ReadBytes((int)len), false);
+						}
+					} else {
+						throw new Exception("Unsupported database version");
+					}
+					br.Close();
+					return true;
+				}
+			} catch (Exception ex) {
+				Console.Error.WriteLine(ex.ToString());
+				MessageBox.Show(this, "Failed to import the database: " + ex.Message, "MARC - Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
+				return false;
+			} finally {
+				lstResources.Sorted = true;
+				lstResources.EndUpdate();
+			}
+		}
+		private Boolean SaveDatabase(String fn) {
+			try {
+				if (File.Exists(fn) && fn != Database) {
+					if (DialogResult.No == MessageBox.Show(this, "The file " + fn + " exists. Are you sure you want to overwrite it?", "MARC - Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Warning)) {
+						return false;
+					}
+				}
+				String tempfile = Path.GetTempFileName();
+				using (FileStream fs = File.Create(tempfile)) {
+					BinaryWriter wr = new BinaryWriter(fs, Encoding.UTF8);
+					wr.Write("MARC");
+					wr.Write((Byte)3); //Version
+					{
+						Hashtable metadata = new Hashtable();
+						ArrayList metakeys = new ArrayList();
+						Hashtable metakey = new Hashtable();
+						metakey.Add("key", SecretKey.SecretKey);
+						metakeys.Add(metakey);
+						metadata.Add("keys", metakeys);
+						ArrayList metapeers = new ArrayList();
+						foreach (String peer in Peers) {
+							Hashtable metapeer = new Hashtable();
+							metapeer.Add("address", peer);
+							metapeers.Add(metapeer);
+						}
+						metadata.Add("peers", metapeers);
+						ArrayList metablockedkeys = new ArrayList();
+						foreach (MARCKey peer in BlockedKeys) metablockedkeys.Add(peer.Bytes);
+						metadata.Add("blockedkeys", metablockedkeys);
+						metadata.Add("filterflags", Functions.EncodeInt32BigEndian((uint)FilterFlags));
+						Byte[] metabytes = MARCUpdate.EncodeValue(metadata);
+						wr.Write(Functions.EncodeInt32BigEndian((uint)metabytes.Length));
+						wr.Write(metabytes);
+					}
+					lock (Resources) {
+						foreach (MARCUpdate update in Resources.Values) {
+							Byte[] message = update.UpdateMessage;
+							if (message == null) {
+								wr.Write((Int32)0);
+							} else {
+								wr.Write((Int32)Functions.ToBigEndian((UInt32)message.Length));
+								wr.Write(message);
+							}
+						}
+					}
+					wr.Close();
+					File.Delete(fn);
+					File.Move(tempfile, fn);
+					Database = fn;
+					DatabaseSaved = true;
+					return true;
+				}
+			} catch (Exception ex) {
+				Console.Error.WriteLine(ex.ToString());
+				MessageBox.Show(this, "Failed to save the database: " + ex.Message, "MARC - Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
+				return false;
+			}
+		}
+		#endregion
+
+		#region "Other database management"
+		private void CreateDatabase() {
+			if (!WarnDatabaseSaved()) return;
+			Database = null;
+			SecretKey = new ed25519keypair();
+			PublicKey = new MARCKey(SecretKey.PublicKey);
+			Resources = new Dictionary<MARCLabel, MARCUpdate>();
+			Peers = new List<string>();
+			BlockedKeys = new List<MARCKey>();
+			FilterFlags = ResourceTypeFilter.All & ~ResourceTypeFilter.Invalid;
+			Peers.Add("http://marc.ucis.ano/");
+			lstResources.Items.Clear();
+			UpdatePeersList();
+			DatabaseSaved = true;
+		}
+		public Boolean ImportUpdate(Byte[] update, Boolean quick) {
+			try {
+				MARCUpdate resource = MARCUpdate.Decode(update);
+				MARCLabel label = resource.Label;
+				MARCUpdate current;
+				if (!quick && IsResourceFiltered(resource)) return false;
+				lock (Resources) {
+					if (Resources.TryGetValue(label, out current)) {
+						if (current.Serial >= resource.Serial) return false;
+						if (!current.CanUpdate(resource.Key)) return false;
+					} else {
+						if (!quick && resource.Value == null) return false;
+						if (!quick && resource.Expired) return false;
+						current = null;
+					}
+					if (!quick && !resource.VerifySignature()) return false;
+					DatabaseSaved = false;
+					Resources[label] = resource;
+				}
+				if (InvokeRequired) {
+					Invoke((MethodInvoker)delegate() {
+						ResourceHasChanged(resource, current);
+					});
+				} else {
+					ResourceHasChanged(resource, current);
+				}
+				return true;
+			} catch (Exception ex) {
+				Console.Error.WriteLine(ex.ToString());
+				return false;
+			}
+		}
+		#endregion
+
+		public void ReplaceOrAddResource(MARCUpdate newres) {
+			MARCUpdate old;
+			lock (Resources) {
+				if (!Resources.TryGetValue(newres.Label, out old)) old = null;
+				Resources[newres.Label] = newres;
+				ResourceHasChanged(newres, old);
+			}
+		}
+		public void ResourceHasChanged(MARCUpdate newres, MARCUpdate oldres) {
+			Boolean selected = false;
+			if (oldres != null) {
+				selected = lstResources.SelectedItem == oldres;
+				lstResources.Items.Remove(oldres);
+			}
+			if (newres != null) {
+				AddResourceToListFiltered(newres);
+				if (selected) {
+					lstResources.SelectedItem = newres;
+					ShowResourceDetails(newres);
+				}
+			}
+		}
+
+		#region "Resource list box"
+		private void cmbResourceFilter_SelectedIndexChanged(object sender, EventArgs e) {
+			RefreshResourceList();
+		}
+		public void RefreshResourceList() {
+			lstResources.BeginUpdate();
+			lstResources.Sorted = false;
+			lstResources.Items.Clear();
+			lock (Resources) foreach (MARCUpdate update in Resources.Values) AddResourceToListFiltered(update);
+			lstResources.Sorted = true;
+			lstResources.EndUpdate();
+		}
+		private void AddResourceToListFiltered(MARCUpdate update) {
+			switch (cmbResourceFilter.SelectedIndex) {
+				case 1: //My resources
+					if (update.Key != PublicKey) return;
+					break;
+				case 2: //Filtered items
+					if (!IsResourceFiltered(update)) return;
+					break;
+				case 3: //Expired items
+					if (!update.Expired) return;
+					break;
+				case 4: //Domain names
+					if (update.Label.Bytes.Length < 1 || update.Label.Bytes[0] != 4) return;
+					break;
+				case 5: //IPv4 networks
+					if (update.Label.Bytes.Length != 6 || update.Label.Bytes[0] != 1) return;
+					break;
+				case 6: //IPv6 networks
+					if (update.Label.Bytes.Length != 18 || update.Label.Bytes[0] != 2) return;
+					break;
+				case 7: //AS numbers
+					if (update.Label.Bytes.Length != 5 || update.Label.Bytes[0] != 3) return;
+					break;
+				case 8: //Key info
+					if (update.Label.Bytes.Length != 33 || update.Label.Bytes[0] != 0) return;
+					break;
+				case 0: //All resources
+				default:
+					break;
+			}
+			lstResources.Items.Add(update);
+		}
+		private void lstResources_SelectedIndexChanged(object sender, EventArgs e) {
+			if (lstResources.SelectedItem == null) return;
+			ShowResourceDetails((MARCUpdate)lstResources.SelectedItem);
+		}
+		#endregion
+
+		#region "Resource details area"
+		private void ShowResourceDetails(MARCUpdate update) {
+			txtResourceKey.Text = update.Key.ToString();
+			txtResourceLabel.Text = update.Label.ToString();
+			txtResourceSerial.Text = update.Serial.ToString();
+			UInt32 tsnow = checked((UInt32)(DateTime.UtcNow - (new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc))).TotalSeconds);
+			UInt32 tslastyear = tsnow - 365 * 24 * 60 * 60;
+			String[] flags = null;
+			if (PublicKey == update.Key) UCIS.Util.ArrayUtil.Add(ref flags, "Owned");
+			else if (update.CanUpdate(PublicKey)) UCIS.Util.ArrayUtil.Add(ref flags, "Transferable");
+			if (update.Expired) UCIS.Util.ArrayUtil.Add(ref flags, "Expired");
+			if (flags == null || flags.Length == 0) UCIS.Util.ArrayUtil.Add(ref flags, "Claimed");
+			txtResourceStatus.Text = String.Join(", ", flags);
+			lvwResourceValue.SuspendLayout();
+			lvwResourceValue.Nodes.Clear();
+
+			if (update.Value is IDictionary) {
+				foreach (DictionaryEntry child in (IDictionary)update.Value) lvwResourceValue.Nodes.Add(AddResourceValueInTree(child.Key.ToString() + ": ", child.Value));
+			} else if (update.Value is ICollection) {
+				foreach (Object child in (ICollection)update.Value) lvwResourceValue.Nodes.Add(AddResourceValueInTree(String.Empty, child));
+			} else if (update.Value == null) {
+				lvwResourceValue.Nodes.Add("Null");
+			} else {
+				lvwResourceValue.Nodes.Add(update.Value.ToString());
+			}
+
+			lvwResourceValue.ResumeLayout();
+		}
+		private TreeNode AddResourceValueInTree(String prefix, Object value) {
+			TreeNode node = new TreeNode();
+			if (value is IDictionary) {
+				node.Text = prefix + "Dictionary";
+				foreach (DictionaryEntry child in (IDictionary)value) node.Nodes.Add(AddResourceValueInTree(child.Key.ToString() + ": ", child.Value));
+			} else if (value is ICollection) {
+				node.Text = prefix + "Collection";
+				foreach (Object child in (ICollection)value) node.Nodes.Add(AddResourceValueInTree(String.Empty, child));
+			} else if (value == null) {
+				node.Text = prefix + "Null";
+			} else {
+				node.Text = prefix + value.ToString();
+			}
+			node.Expand();
+			return node;
+		}
+		#endregion
+
+		#region "Menu bar"
+		private void settingsToolStripMenuItem_Click(object sender, EventArgs e) {
+			frmSettings form = new frmSettings();
+			form.MainForm = this;
+			form.ShowDialog(this);
+		}
+
+		public void newDatabaseToolStripMenuItem_Click(object sender, EventArgs e) {
+			CreateDatabase();
+		}
+		public void reloadDatabaseToolStripMenuItem_Click(object sender, EventArgs e) {
+			if (Database == null || !File.Exists(Database)) {
+				openDatabaseToolStripMenuItem_Click(sender, e);
+			} else {
+				LoadDatabase(Database);
+			}
+		}
+		public void saveDatabaseToolStripMenuItem_Click(object sender, EventArgs e) {
+			SaveDatabase();
+		}
+		public void saveDatabaseAsToolStripMenuItem_Click(object sender, EventArgs e) {
+			SaveDatabaseAs();
+		}
+		public void openDatabaseToolStripMenuItem_Click(object sender, EventArgs e) {
+			String fn = SelectDatabaseOpen("Open database");
+			if (fn == null) return;
+			LoadDatabase(fn);
+		}
+		public void importDatabaseToolStripMenuItem_Click(object sender, EventArgs e) {
+			String fn = SelectDatabaseOpen("Open database");
+			if (fn == null) return;
+			ImportDatabase(fn);
+		}
+		private void SynchronizeServerToolStripMenuItem_Click(object sender, EventArgs e) {
+			ToolStripMenuItem tsi = sender as ToolStripMenuItem;
+			frmSync form = new frmSync();
+			form.MainForm = this;
+			form.Hosts = (tsi == null || tsi.Tag == null) ? (IEnumerable<String>)Peers : new String[] { tsi.Tag.ToString() };
+			form.ShowDialog(this);
+		}
+
+		private void deleteSelectedToolStripMenuItem_Click(object sender, EventArgs e) {
+			MessageBox.Show(this, "This will delete the resources only from the local database. It may be retrieved again during synchronization.", "MARC - Delete resource", MessageBoxButtons.OK, MessageBoxIcon.Information);
+			List<MARCUpdate> ToDelete = new List<MARCUpdate>();
+			foreach (Object item in lstResources.SelectedItems) {
+				MARCUpdate update = (MARCUpdate)item;
+				if (Resources.Remove(update.Label)) ToDelete.Add(update);
+				DatabaseSaved = false;
+			}
+			lstResources.BeginUpdate();
+			lstResources.Sorted = false;
+			foreach (MARCUpdate item in ToDelete) ResourceHasChanged(null, item);
+			lstResources.Sorted = true;
+			lstResources.EndUpdate();
+		}
+
+		private void addKeyToFilterListToolStripMenuItem_Click(object sender, EventArgs e) {
+			if (lstResources.SelectedItems.Count == 0) return;
+			foreach (Object item in lstResources.SelectedItems) {
+				MARCUpdate update = (MARCUpdate)item;
+				if (BlockedKeys.Contains(update.Key)) continue;
+				BlockedKeys.Add(update.Key);
+				DatabaseSaved = false;
+			}
+			MessageBox.Show(this, "The selected key has been added to the filter list. Use the Settings window to delete all filtered items from the local database.", "MARC - Key filter", MessageBoxButtons.OK, MessageBoxIcon.Information);
+		}
+
+		private void addNewToolStripMenuItem_Click(object sender, EventArgs e) {
+			frmEditResource form = new frmEditResource();
+			form.MainForm = this;
+			form.ShowDialog(this);
+		}
+
+		private void editSelectedToolStripMenuItem_Click(object sender, EventArgs e) {
+			MARCUpdate resource = lstResources.SelectedItem as MARCUpdate;
+			if (resource == null) return;
+			frmEditResource form = new frmEditResource();
+			form.MainForm = this;
+			form.Label = resource.Label.Bytes;
+			form.Value = resource.Value as IDictionary;
+			form.ImportData();
+			form.ShowDialog(this);
+		}
+		#endregion
+
+		private void lstResources_DoubleClick(object sender, EventArgs e) {
+			editSelectedToolStripMenuItem_Click(sender, e);
+		}
+	}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ARClient/Form1.resx	Sat Nov 08 22:43:51 2014 +0100
@@ -0,0 +1,123 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <metadata name="menuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>169, 17</value>
+  </metadata>
+</root>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ARClient/MARC.cs	Sat Nov 08 22:43:51 2014 +0100
@@ -0,0 +1,392 @@
+using System;
+using System.Collections;
+using System.IO;
+using System.Net;
+using System.Text;
+using UCIS.NaCl.v2;
+//using UCIS.NaCl.crypto_sign;
+using UCIS.Util;
+
+namespace ARClient {
+	public static class Functions {
+		public static String bin2hex(Byte[] bytes) {
+			StringBuilder sb = new StringBuilder();
+			foreach (Byte b in bytes) sb.Append(b.ToString("x2"));
+			return sb.ToString();
+		}
+		public static Byte[] hex2bin(String hex) {
+			if (hex.Length % 2 != 0) hex = "0" + hex;
+			Byte[] r = new Byte[hex.Length / 2];
+			for (int i = 0; i < r.Length; i++) if (!Byte.TryParse(hex.Substring(2 * i, 2), System.Globalization.NumberStyles.HexNumber, null, out r[i])) return null;
+			return r;
+		}
+		public static UInt32 DecodeInt32BigEndian(Byte[] data, int i) {
+			return (UInt32)(data[i + 3] + 256 * (data[i + 2] + 256 * (data[i + 1] + 256 * data[i])));
+		}
+		public static Byte[] EncodeInt32BigEndian(UInt32 v) {
+			Byte[] r = new Byte[4];
+			UInt32 j;
+			j = v % 256; r[3] = (Byte)j; v >>= 8;
+			j = v % 256; r[2] = (Byte)j; v >>= 8;
+			j = v % 256; r[1] = (Byte)j; v >>= 8;
+			j = v % 256; r[0] = (Byte)j;
+			return r;
+		}
+		public static UInt16 DecodeInt16BigEndian(Byte[] data, int i) {
+			return (UInt16)(data[i + 1] + 256 * data[i]);
+		}
+		public static Byte[] EncodeInt16BigEndian(UInt16 v) {
+			Byte[] r = new Byte[4];
+			int j;
+			j = v % 256; r[1] = (Byte)j; v >>= 8;
+			j = v % 256; r[0] = (Byte)j;
+			return r;
+		}
+		public static UInt32 ToBigEndian(UInt32 value) {
+			if (!BitConverter.IsLittleEndian) return value;
+			return ((value >> 24) & 0xff) | ((value >> 8) & 0xff00) | ((value << 8) & 0xff0000) | ((value << 24) & 0xff000000);
+		}
+		public static UInt32 FromBigEndian(UInt32 value) {
+			if (!BitConverter.IsLittleEndian) return value;
+			return ((value >> 24) & 0xff) | ((value >> 8) & 0xff00) | ((value << 8) & 0xff0000) | ((value << 24) & 0xff000000);
+		}
+		public static int CompareByteArrays(Byte[] a, Byte[] b) {
+			for (int i = 0; i < Math.Min(b.Length, a.Length); i++) if (b[i] != a[i]) return a[i] - b[i];
+			return b.Length - a.Length;
+		}
+		public static String GetNameForLabel(Byte[] label) {
+			if (label == null || label.Length < 1) return String.Empty;
+			switch (label[0]) {
+				case 0:
+					if (label.Length != 33) break;
+					return "Key: " + bin2hex(ArrayUtil.Slice(label, 1));
+				case 1:
+					if (label.Length != 6) break;
+					return "IPv4: " + label[1].ToString() + "." + label[2].ToString() + "." + label[3].ToString() + "." + label[4].ToString() + "/" + label[5].ToString();
+				case 2:
+					if (label.Length != 18) break;
+					return "IPv6: " + (new IPAddress(ArrayUtil.Slice(label, 1, 16))).ToString() + "/" + label[17].ToString();
+				case 3:
+					if (label.Length != 5) break;
+					return "AS Number: " + DecodeInt32BigEndian(label, 1).ToString();
+				case 4:
+					return "Domain: " + Encoding.UTF8.GetString(label, 1, label.Length - 1);
+
+			}
+			return bin2hex(label);
+		}
+	}
+	public struct BinaryString : IComparable {
+		public Byte[] Bytes { get; private set; }
+		public BinaryString(Byte[] bytes) : this() {
+			if (bytes == null) throw new ArgumentNullException("bytes");
+			this.Bytes = bytes;
+		}
+		public BinaryString(Byte[] bytes, int offset, int length) : this(ArrayUtil.Slice(bytes, offset, length)) { }
+		public override string ToString() {
+			return Encoding.UTF8.GetString(Bytes);
+		}
+		public static explicit operator Byte[](BinaryString bs) {
+			return bs.Bytes;
+		}
+		public static explicit operator String(BinaryString bs) {
+			return bs.ToString();
+		}
+		public int CompareTo(Object otherobj) {
+			if (otherobj == null) return 1;
+			if (otherobj is BinaryString) return Functions.CompareByteArrays(Bytes, ((BinaryString)otherobj).Bytes);
+			if (otherobj is Byte[]) return Functions.CompareByteArrays(Bytes, ((Byte[])otherobj));
+			if (otherobj is String) return ToString().CompareTo(otherobj);
+			return 1;
+		}
+		public override bool Equals(object obj) {
+			return CompareTo(obj) == 0;
+		}
+		public static Boolean operator ==(BinaryString a, Object b) {
+			return a.Equals(b);
+		}
+		public static Boolean operator !=(BinaryString a, Object b) {
+			return !a.Equals(b);
+		}
+		public override int GetHashCode() {
+			int hash = Bytes.Length;
+			foreach (Byte b in Bytes) hash += b;
+			return hash;
+		}
+	}
+	public class MARCUpdate {
+		public static readonly DateTime UnixEpoch = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
+		public static long DateTimeToUnix(DateTime value) { return (long)(value.ToUniversalTime() - UnixEpoch).TotalSeconds; }
+		public static DateTime DateTimeFromUnix(long seconds) { return UnixEpoch.AddSeconds(seconds);}
+
+		public Byte Version { get; private set; }
+		public MARCKey Key { get; private set; }
+		public UInt32 Serial { get; private set; }
+		public MARCLabel Label { get; private set; }
+		public MARCKey? Transfer { get; private set; }
+		public UInt32? Expiration { get; private set; }
+		public Byte[] UpdateMessage { get; private set; }
+		private int ValueOffset = -1;
+		private Object mValue = null;
+		public Object Value {
+			get {
+				if (mValue == null) mValue = DecodeValue(UpdateMessage, ValueOffset, UpdateMessage.Length - ValueOffset);
+				return mValue;
+			}
+			private set {
+				mValue = value;
+			}
+		}
+		public Boolean Expired {
+			get {
+				long currentTime = DateTimeToUnix(DateTime.UtcNow);
+				return (Serial + 365 * 24 * 60 * 60 < currentTime) || ((Expiration ?? UInt32.MaxValue) < currentTime);
+			}
+		}
+		public Boolean CanUpdate(MARCKey key) {
+			if (key == this.Key) return true;
+			if (Expired) return true;
+			if (Transfer != null && (Transfer.Value.Bytes.Length == 0 || Transfer.Value == key)) return true;
+			return false;
+		}
+		public DateTime UpdateTimestamp { get { return DateTimeFromUnix(Serial); } }
+		public DateTime ExpirationTimestamp { get { return Expiration == null ? DateTime.MaxValue : DateTimeFromUnix(Expiration.Value); } }
+		private MARCUpdate() {
+		}
+		public static MARCUpdate Create(ed25519keypair key, UInt32 serial, Byte[] label, Object value, UInt32? expiration, Byte[] transfer) {
+			MARCUpdate update = new MARCUpdate();
+			update.Version = 2;
+			update.Key = new MARCKey(key.PublicKey);
+			update.Serial = serial;
+			if (label.Length > 255) throw new ArgumentException("label");
+			update.Label = new MARCLabel(label);
+			update.Value = value;
+			update.Expiration = expiration;
+			update.Transfer = transfer == null ? null : new MARCKey?(new MARCKey(transfer));
+
+			MemoryStream buffer = new MemoryStream(1 + 32 + 64 + 4 + 1 + update.Label.Bytes.Length + 1);
+			buffer.WriteByte(update.Version);
+			buffer.Write(key.PublicKey, 0, 32);
+			buffer.Write(new Byte[64], 0, 64); //Signature placeholder
+			buffer.Write(Functions.EncodeInt32BigEndian(update.Serial), 0, 4);
+			buffer.WriteByte(checked((Byte)update.Label.Bytes.Length));
+			buffer.Write(update.Label.Bytes, 0, update.Label.Bytes.Length);
+			int extcnt = 0;
+			if (update.Transfer != null) extcnt++;
+			if (update.Expiration != null) extcnt++;
+			buffer.WriteByte((Byte)extcnt);
+			if (update.Transfer != null) {
+				buffer.WriteByte(1);
+				buffer.Write(Functions.EncodeInt16BigEndian(checked((UInt16)update.Transfer.Value.Bytes.Length)), 0, 2);
+				buffer.Write(update.Transfer.Value.Bytes, 0, update.Transfer.Value.Bytes.Length);
+			}
+			if (update.Expiration != null) {
+				buffer.WriteByte(4);
+				buffer.Write(Functions.EncodeInt16BigEndian(4), 0, 2);
+				buffer.Write(Functions.EncodeInt32BigEndian(update.Expiration.Value), 0, 4);
+			}
+			update.ValueOffset = (int)buffer.Position;
+			if (update.Value != null) EncodeValue(buffer, update.Value);
+			Byte[] signature = key.GetSignature(buffer.GetBuffer(), 1 + 32 + 64, (int)buffer.Length - 1 - 32 - 64);
+			buffer.Seek(1 + 32, SeekOrigin.Begin);
+			buffer.Write(signature, 0, 64);
+			update.UpdateMessage = buffer.ToArray();
+			if (!update.VerifySignature()) throw new Exception("Key pair does not match");
+			return update;
+		}
+		public static MARCUpdate Decode(Byte[] data) {
+			int i = 0;
+			int l = data.Length;
+			if (l < 1 + 32 + 64) throw new Exception("Truncated data");
+			MARCUpdate update = new MARCUpdate();
+			update.Version = data[i++];
+			if (update.Version != 2) throw new Exception(String.Format("Unexpected version number {0}", update.Version));
+			update.Key = new MARCKey(data, i, 32); i += 32;
+			i += 64;
+			if (data.Length < i + 4 + 1 + 1) throw new Exception("Truncated data");
+			update.Serial = (UInt32)Functions.DecodeInt32BigEndian(data, i); i += 4;
+			int labellen = data[i++];
+			if (data.Length < i + labellen + 1) throw new Exception("Truncated data");
+			update.Label = new MARCLabel(data, i, labellen); i += labellen;
+			for (int j = data[i++]; j > 0; j--) {
+				if (data.Length < i + 3) throw new Exception("Truncated data");
+				int extid = data[i++];
+				int extlen = Functions.DecodeInt16BigEndian(data, i); i += 2;
+				if (data.Length < i + extlen) throw new Exception("Truncated data");
+				switch (extid) {
+					case 1: if (extlen == 0 || extlen >= 32) update.Transfer = new MARCKey(data, i, Math.Min(extlen, 32)); break;
+					case 4: if (extlen >= 4) update.Expiration = Functions.DecodeInt32BigEndian(data, i); break;
+				}
+				i += extlen;
+			}
+			update.ValueOffset = i;
+			update.UpdateMessage = data;
+			return update;
+		}
+		public Boolean VerifySignature() {
+			if (UpdateMessage == null) return false;
+			if (UpdateMessage.Length < 1 + 32 + 64) return false;
+			return ed25519.VerifySignature(new ArraySegment<Byte>(UpdateMessage, 1 + 32 + 64, UpdateMessage.Length - 1 - 32 - 64), new ArraySegment<byte>(UpdateMessage, 1 + 32, 64), ArrayUtil.Slice(UpdateMessage, 1, 32));
+		}
+
+		public static Byte[] EncodeValue(Object value) {
+			using (MemoryStream ms = new MemoryStream()) {
+				EncodeValue(ms, value);
+				return ms.ToArray();
+			}
+		}
+		private static void EncodeValue(MemoryStream to, Object value) {
+			if (value == null) {
+				to.WriteByte(0);
+			} else if (value is Byte[]) {
+				Byte[] s = (Byte[])value;
+				to.WriteByte(1);
+				to.Write(s, 0, s.Length);
+			} else if (value is IDictionary) {
+				to.WriteByte(3);
+				IDictionary list = (IDictionary)value;
+				foreach (DictionaryEntry item in list) {
+					Byte[] s = Encoding.UTF8.GetBytes(item.Key.ToString());
+					to.WriteByte(checked((Byte)s.Length));
+					to.Write(s, 0, s.Length);
+					long startpos = to.Position;
+					to.Write(new Byte[4], 0, 4);
+					EncodeValue(to, item.Value);
+					uint length = (uint)(to.Position - startpos - 4);
+					to.Seek(startpos, SeekOrigin.Begin);
+					to.Write(Functions.EncodeInt32BigEndian(length), 0, 4);
+					to.Seek(length, SeekOrigin.Current);
+				}
+			} else if (value is IList) {
+				to.WriteByte(2);
+				IList list = (IList)value;
+				foreach (Object item in list) {
+					long startpos = to.Position;
+					to.Write(new Byte[4], 0, 4);
+					EncodeValue(to, item);
+					uint length = (uint)(to.Position - startpos - 4);
+					to.Seek(startpos, SeekOrigin.Begin);
+					to.Write(Functions.EncodeInt32BigEndian(length), 0, 4);
+					to.Seek(length, SeekOrigin.Current);
+				}
+			} else {
+				to.WriteByte(1);
+				Byte[] s;
+				if (value is BinaryString) {
+					s = ((BinaryString)value).Bytes;
+				} else if (value is Byte[]) {
+					s = (Byte[])value;
+				} else {
+					s = Encoding.UTF8.GetBytes(value.ToString());
+				}
+				to.Write(s, 0, s.Length);
+			}
+		}
+		public static Object DecodeValue(Byte[] data) {
+			return DecodeValue(data, 0, data.Length);
+		}
+		private static Object DecodeValue(Byte[] data, int i, int l) {
+			if (l < 1) return null;
+			Byte type = data[i]; i++; l--;
+			switch (type) {
+				case 0: return null;
+				case 1: return new BinaryString(data, i, l);
+				case 2: {
+						ArrayList value = new ArrayList();
+						while (l > 0) {
+							if (l < 4) throw new Exception("Truncated");
+							Int32 len = (Int32)Functions.DecodeInt32BigEndian(data, i); i += 4; l -= 4;
+							if (l < len) throw new Exception("Truncated");
+							value.Add(DecodeValue(data, i, len)); i += len; l -= len;
+						}
+						return value;
+					}
+				case 3: {
+						Hashtable value = new Hashtable();
+						while (l > 0) {
+							if (l < 5) throw new Exception("Truncated");
+							Int32 len = data[i]; i++; l--;
+							if (l < 4 + len) throw new Exception("Truncated");
+							String key = Encoding.UTF8.GetString(data, i, len); i += len; l -= len;
+							len = (Int32)Functions.DecodeInt32BigEndian(data, i); i += 4; l -= 4;
+							if (l < len) throw new Exception("Truncated");
+							value.Add(key, DecodeValue(data, i, len)); i += len; l -= len;
+						}
+						return value;
+					}
+				default: return null;
+			}
+		}
+
+		public override String ToString() {
+			return Label.ToString();
+		}
+	}
+	public struct MARCLabel : IComparable {
+		public Byte[] Bytes { get; private set; }
+		public MARCLabel(Byte[] label)
+			: this() {
+			if (label == null) throw new ArgumentNullException("label");
+			if (label.Length > 255) throw new ArgumentException("Parameter label is too long", "label");
+			this.Bytes = label;
+		}
+		public MARCLabel(Byte[] label, int offset, int len)
+			: this() {
+			this.Bytes = new Byte[len];
+			Buffer.BlockCopy(label, offset, this.Bytes, 0, len);
+		}
+		public int CompareTo(Object otherobj) {
+			if (otherobj == null || !(otherobj is MARCLabel)) return 1;
+			return Functions.CompareByteArrays(Bytes, ((MARCLabel)otherobj).Bytes);
+		}
+		public override bool Equals(object obj) {
+			return CompareTo(obj) == 0;
+		}
+		public static Boolean operator ==(MARCLabel a, Object b) {
+			return a.Equals(b);
+		}
+		public static Boolean operator !=(MARCLabel a, Object b) {
+			return !a.Equals(b);
+		}
+		public override int GetHashCode() {
+			int hash = Bytes.Length;
+			foreach (Byte b in Bytes) hash += b;
+			return hash;
+		}
+
+		public override String ToString() {
+			return Functions.GetNameForLabel(Bytes);
+		}
+	}
+	public struct MARCKey : IComparable {
+		public Byte[] Bytes { get; private set; }
+		public MARCKey(Byte[] key)
+			: this() {
+			if (key == null) throw new ArgumentNullException("key");
+			if (key.Length != 32 && key.Length != 0) throw new ArgumentException("Incorrect key length", "key");
+			this.Bytes = key;
+		}
+		public MARCKey(Byte[] label, int offset, int len) : this(ArrayUtil.Slice(label, offset, len)) { }
+		public int CompareTo(Object otherobj) {
+			if (otherobj == null || !(otherobj is MARCKey)) return 1;
+			return Functions.CompareByteArrays(Bytes, ((MARCKey)otherobj).Bytes);
+		}
+		public override bool Equals(object obj) {
+			return CompareTo(obj) == 0;
+		}
+		public static Boolean operator ==(MARCKey a, Object b) {
+			return a.Equals(b);
+		}
+		public static Boolean operator !=(MARCKey a, Object b) {
+			return !a.Equals(b);
+		}
+		public override int GetHashCode() {
+			int hash = Bytes.Length;
+			foreach (Byte b in Bytes) hash += b;
+			return hash;
+		}
+		public override string ToString() {
+			return Functions.bin2hex(Bytes);
+		}
+	}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ARClient/Program.cs	Sat Nov 08 22:43:51 2014 +0100
@@ -0,0 +1,31 @@
+using System;
+using System.IO;
+using System.Reflection;
+using System.Windows.Forms;
+
+namespace ARClient {
+	static class Program {
+		/// <summary>
+		/// The main entry point for the application.
+		/// </summary>
+		[STAThread]
+		static void Main() {
+			AppDomain.CurrentDomain.AssemblyResolve += ResolveAssembly;
+			Main2();
+		}
+		static void Main2() {
+			Application.EnableVisualStyles();
+			try { Application.SetCompatibleTextRenderingDefault(false); } catch { }
+			Application.Run(new Form1());
+		}
+		private static Assembly ResolveAssembly(Object sender, ResolveEventArgs e) {
+			String resourceName = "ARClient." + new AssemblyName(e.Name).Name + ".dll";
+			using (Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream(resourceName)) {
+				if (stream == null) return null;
+				Byte[] assemblyData = new Byte[stream.Length];
+				stream.Read(assemblyData, 0, assemblyData.Length);
+				return Assembly.Load(assemblyData);
+			}
+		}
+	}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ARClient/Properties/AssemblyInfo.cs	Sat Nov 08 22:43:51 2014 +0100
@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following 
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("ARClient")]
+[assembly: AssemblyDescription("MARC Client Application")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("Ivo Smits")]
+[assembly: AssemblyProduct("ARClient")]
+[assembly: AssemblyCopyright("Copyright © Ivo Smits 2011-2014")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible 
+// to COM components.  If you need to access a type in this assembly from 
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("27d1953b-343f-4f33-939d-79c7dfb40a42")]
+
+// Version information for an assembly consists of the following four values:
+//
+//      Major Version
+//      Minor Version 
+//      Build Number
+//      Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers 
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("2.1.0.0")]
+[assembly: AssemblyFileVersion("2.1.0.0")]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ARClient/Properties/Settings.Designer.cs	Sat Nov 08 22:43:51 2014 +0100
@@ -0,0 +1,26 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+//     This code was generated by a tool.
+//     Runtime Version:2.0.50727.3623
+//
+//     Changes to this file may cause incorrect behavior and will be lost if
+//     the code is regenerated.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace ARClient.Properties {
+
+
+	[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+	[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "9.0.0.0")]
+	internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
+
+		private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
+
+		public static Settings Default {
+			get {
+				return defaultInstance;
+			}
+		}
+	}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ARClient/Properties/Settings.settings	Sat Nov 08 22:43:51 2014 +0100
@@ -0,0 +1,7 @@
+<?xml version='1.0' encoding='utf-8'?>
+<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
+  <Profiles>
+    <Profile Name="(Default)" />
+  </Profiles>
+  <Settings />
+</SettingsFile>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ARClient/frmEditResource.Designer.cs	Sat Nov 08 22:43:51 2014 +0100
@@ -0,0 +1,851 @@
+namespace ARClient {
+	partial class frmEditResource {
+		/// <summary>
+		/// Required designer variable.
+		/// </summary>
+		private System.ComponentModel.IContainer components = null;
+
+		/// <summary>
+		/// Clean up any resources being used.
+		/// </summary>
+		/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+		protected override void Dispose(bool disposing) {
+			if (disposing && (components != null)) {
+				components.Dispose();
+			}
+			base.Dispose(disposing);
+		}
+
+		#region Windows Form Designer generated code
+
+		/// <summary>
+		/// Required method for Designer support - do not modify
+		/// the contents of this method with the code editor.
+		/// </summary>
+		private void InitializeComponent() {
+			System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmEditResource));
+			this.tabControl1 = new System.Windows.Forms.TabControl();
+			this.tabPage1 = new System.Windows.Forms.TabPage();
+			this.groupBox2 = new System.Windows.Forms.GroupBox();
+			this.btnLabelNext = new System.Windows.Forms.Button();
+			this.lblLabelValid = new System.Windows.Forms.Label();
+			this.lblLabelHint = new System.Windows.Forms.Label();
+			this.txtLabelValue = new System.Windows.Forms.TextBox();
+			this.groupBox1 = new System.Windows.Forms.GroupBox();
+			this.radTypeDomain = new System.Windows.Forms.RadioButton();
+			this.radTypeOtherHex = new System.Windows.Forms.RadioButton();
+			this.radTypeIPv4 = new System.Windows.Forms.RadioButton();
+			this.radTypeIPv6 = new System.Windows.Forms.RadioButton();
+			this.radTypeASNumber = new System.Windows.Forms.RadioButton();
+			this.tabPage2 = new System.Windows.Forms.TabPage();
+			this.lvwData = new System.Windows.Forms.TreeView();
+			this.groupBox3 = new System.Windows.Forms.GroupBox();
+			this.btnDataDeleteAll = new System.Windows.Forms.Button();
+			this.btnDataEditString = new System.Windows.Forms.Button();
+			this.btnDataAddSring = new System.Windows.Forms.Button();
+			this.btnDataAddCollection = new System.Windows.Forms.Button();
+			this.btnDataAddDictionary = new System.Windows.Forms.Button();
+			this.btnDataDelete = new System.Windows.Forms.Button();
+			this.btnDataAddDNS = new System.Windows.Forms.Button();
+			this.btnDataSetDescription = new System.Windows.Forms.Button();
+			this.btnDataSetOwner = new System.Windows.Forms.Button();
+			this.tabPage3 = new System.Windows.Forms.TabPage();
+			this.grpUpdateConflict = new System.Windows.Forms.GroupBox();
+			this.btnUpdateDelete = new System.Windows.Forms.Button();
+			this.label9 = new System.Windows.Forms.Label();
+			this.grpUpdateExport = new System.Windows.Forms.GroupBox();
+			this.tableLayoutPanel4 = new System.Windows.Forms.TableLayoutPanel();
+			this.panel1 = new System.Windows.Forms.Panel();
+			this.txtUpdateTransfer = new System.Windows.Forms.TextBox();
+			this.chkUpdateTransferEnabled = new System.Windows.Forms.CheckBox();
+			this.dtpUpdateExpiration = new System.Windows.Forms.DateTimePicker();
+			this.btnUpdateNow = new System.Windows.Forms.Button();
+			this.label11 = new System.Windows.Forms.Label();
+			this.label5 = new System.Windows.Forms.Label();
+			this.txtUpdateOwner = new System.Windows.Forms.TextBox();
+			this.label8 = new System.Windows.Forms.Label();
+			this.groupBox4 = new System.Windows.Forms.GroupBox();
+			this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
+			this.txtUpdateCurrentExpiration = new System.Windows.Forms.TextBox();
+			this.label10 = new System.Windows.Forms.Label();
+			this.txtUpdateCurrentTransfer = new System.Windows.Forms.TextBox();
+			this.label6 = new System.Windows.Forms.Label();
+			this.txtUpdateCurrentSize = new System.Windows.Forms.TextBox();
+			this.label7 = new System.Windows.Forms.Label();
+			this.txtUpdateCurrentStatus = new System.Windows.Forms.TextBox();
+			this.label4 = new System.Windows.Forms.Label();
+			this.txtUpdateCurrentSerial = new System.Windows.Forms.TextBox();
+			this.label3 = new System.Windows.Forms.Label();
+			this.txtUpdateLabel = new System.Windows.Forms.TextBox();
+			this.txtUpdateCurrentOwner = new System.Windows.Forms.TextBox();
+			this.label1 = new System.Windows.Forms.Label();
+			this.label2 = new System.Windows.Forms.Label();
+			this.tabControl1.SuspendLayout();
+			this.tabPage1.SuspendLayout();
+			this.groupBox2.SuspendLayout();
+			this.groupBox1.SuspendLayout();
+			this.tabPage2.SuspendLayout();
+			this.groupBox3.SuspendLayout();
+			this.tabPage3.SuspendLayout();
+			this.grpUpdateConflict.SuspendLayout();
+			this.grpUpdateExport.SuspendLayout();
+			this.tableLayoutPanel4.SuspendLayout();
+			this.panel1.SuspendLayout();
+			this.groupBox4.SuspendLayout();
+			this.tableLayoutPanel1.SuspendLayout();
+			this.SuspendLayout();
+			// 
+			// tabControl1
+			// 
+			this.tabControl1.Controls.Add(this.tabPage1);
+			this.tabControl1.Controls.Add(this.tabPage2);
+			this.tabControl1.Controls.Add(this.tabPage3);
+			this.tabControl1.Dock = System.Windows.Forms.DockStyle.Fill;
+			this.tabControl1.Location = new System.Drawing.Point(0, 0);
+			this.tabControl1.Name = "tabControl1";
+			this.tabControl1.SelectedIndex = 0;
+			this.tabControl1.Size = new System.Drawing.Size(736, 375);
+			this.tabControl1.TabIndex = 0;
+			this.tabControl1.SelectedIndexChanged += new System.EventHandler(this.tabControl1_SelectedIndexChanged);
+			// 
+			// tabPage1
+			// 
+			this.tabPage1.Controls.Add(this.groupBox2);
+			this.tabPage1.Controls.Add(this.groupBox1);
+			this.tabPage1.Location = new System.Drawing.Point(4, 22);
+			this.tabPage1.Name = "tabPage1";
+			this.tabPage1.Padding = new System.Windows.Forms.Padding(3);
+			this.tabPage1.Size = new System.Drawing.Size(728, 349);
+			this.tabPage1.TabIndex = 0;
+			this.tabPage1.Text = "Resource label";
+			this.tabPage1.UseVisualStyleBackColor = true;
+			// 
+			// groupBox2
+			// 
+			this.groupBox2.Controls.Add(this.btnLabelNext);
+			this.groupBox2.Controls.Add(this.lblLabelValid);
+			this.groupBox2.Controls.Add(this.lblLabelHint);
+			this.groupBox2.Controls.Add(this.txtLabelValue);
+			this.groupBox2.Dock = System.Windows.Forms.DockStyle.Fill;
+			this.groupBox2.Location = new System.Drawing.Point(118, 3);
+			this.groupBox2.Name = "groupBox2";
+			this.groupBox2.Size = new System.Drawing.Size(607, 343);
+			this.groupBox2.TabIndex = 7;
+			this.groupBox2.TabStop = false;
+			// 
+			// btnLabelNext
+			// 
+			this.btnLabelNext.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
+			this.btnLabelNext.Location = new System.Drawing.Point(520, 118);
+			this.btnLabelNext.Name = "btnLabelNext";
+			this.btnLabelNext.Size = new System.Drawing.Size(81, 26);
+			this.btnLabelNext.TabIndex = 3;
+			this.btnLabelNext.Text = "Next";
+			this.btnLabelNext.UseVisualStyleBackColor = true;
+			this.btnLabelNext.Click += new System.EventHandler(this.btnLabelNext_Click);
+			// 
+			// lblLabelValid
+			// 
+			this.lblLabelValid.AutoSize = true;
+			this.lblLabelValid.Location = new System.Drawing.Point(6, 125);
+			this.lblLabelValid.Name = "lblLabelValid";
+			this.lblLabelValid.Size = new System.Drawing.Size(107, 13);
+			this.lblLabelValid.TabIndex = 2;
+			this.lblLabelValid.Text = "The label is not valid.";
+			// 
+			// lblLabelHint
+			// 
+			this.lblLabelHint.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+						| System.Windows.Forms.AnchorStyles.Right)));
+			this.lblLabelHint.Location = new System.Drawing.Point(6, 16);
+			this.lblLabelHint.Name = "lblLabelHint";
+			this.lblLabelHint.Size = new System.Drawing.Size(595, 66);
+			this.lblLabelHint.TabIndex = 1;
+			this.lblLabelHint.Text = "label1";
+			// 
+			// txtLabelValue
+			// 
+			this.txtLabelValue.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+						| System.Windows.Forms.AnchorStyles.Right)));
+			this.txtLabelValue.Location = new System.Drawing.Point(6, 85);
+			this.txtLabelValue.Name = "txtLabelValue";
+			this.txtLabelValue.Size = new System.Drawing.Size(595, 20);
+			this.txtLabelValue.TabIndex = 0;
+			this.txtLabelValue.TextChanged += new System.EventHandler(this.txtLabelValue_TextChanged);
+			// 
+			// groupBox1
+			// 
+			this.groupBox1.Controls.Add(this.radTypeDomain);
+			this.groupBox1.Controls.Add(this.radTypeOtherHex);
+			this.groupBox1.Controls.Add(this.radTypeIPv4);
+			this.groupBox1.Controls.Add(this.radTypeIPv6);
+			this.groupBox1.Controls.Add(this.radTypeASNumber);
+			this.groupBox1.Dock = System.Windows.Forms.DockStyle.Left;
+			this.groupBox1.Location = new System.Drawing.Point(3, 3);
+			this.groupBox1.Name = "groupBox1";
+			this.groupBox1.Size = new System.Drawing.Size(115, 343);
+			this.groupBox1.TabIndex = 6;
+			this.groupBox1.TabStop = false;
+			this.groupBox1.Text = "Resource type";
+			// 
+			// radTypeDomain
+			// 
+			this.radTypeDomain.AutoSize = true;
+			this.radTypeDomain.Location = new System.Drawing.Point(6, 19);
+			this.radTypeDomain.Name = "radTypeDomain";
+			this.radTypeDomain.Size = new System.Drawing.Size(61, 17);
+			this.radTypeDomain.TabIndex = 0;
+			this.radTypeDomain.TabStop = true;
+			this.radTypeDomain.Text = "Domain";
+			this.radTypeDomain.UseVisualStyleBackColor = true;
+			this.radTypeDomain.CheckedChanged += new System.EventHandler(this.radType_CheckedChanged);
+			// 
+			// radTypeOtherHex
+			// 
+			this.radTypeOtherHex.AutoSize = true;
+			this.radTypeOtherHex.Location = new System.Drawing.Point(6, 134);
+			this.radTypeOtherHex.Name = "radTypeOtherHex";
+			this.radTypeOtherHex.Size = new System.Drawing.Size(51, 17);
+			this.radTypeOtherHex.TabIndex = 5;
+			this.radTypeOtherHex.TabStop = true;
+			this.radTypeOtherHex.Text = "Other";
+			this.radTypeOtherHex.UseVisualStyleBackColor = true;
+			this.radTypeOtherHex.CheckedChanged += new System.EventHandler(this.radType_CheckedChanged);
+			// 
+			// radTypeIPv4
+			// 
+			this.radTypeIPv4.AutoSize = true;
+			this.radTypeIPv4.Location = new System.Drawing.Point(6, 42);
+			this.radTypeIPv4.Name = "radTypeIPv4";
+			this.radTypeIPv4.Size = new System.Drawing.Size(88, 17);
+			this.radTypeIPv4.TabIndex = 1;
+			this.radTypeIPv4.TabStop = true;
+			this.radTypeIPv4.Text = "IPv4 network";
+			this.radTypeIPv4.UseVisualStyleBackColor = true;
+			this.radTypeIPv4.CheckedChanged += new System.EventHandler(this.radType_CheckedChanged);
+			// 
+			// radTypeIPv6
+			// 
+			this.radTypeIPv6.AutoSize = true;
+			this.radTypeIPv6.Location = new System.Drawing.Point(6, 65);
+			this.radTypeIPv6.Name = "radTypeIPv6";
+			this.radTypeIPv6.Size = new System.Drawing.Size(88, 17);
+			this.radTypeIPv6.TabIndex = 2;
+			this.radTypeIPv6.TabStop = true;
+			this.radTypeIPv6.Text = "IPv6 network";
+			this.radTypeIPv6.UseVisualStyleBackColor = true;
+			this.radTypeIPv6.CheckedChanged += new System.EventHandler(this.radType_CheckedChanged);
+			// 
+			// radTypeASNumber
+			// 
+			this.radTypeASNumber.AutoSize = true;
+			this.radTypeASNumber.Location = new System.Drawing.Point(6, 88);
+			this.radTypeASNumber.Name = "radTypeASNumber";
+			this.radTypeASNumber.Size = new System.Drawing.Size(79, 17);
+			this.radTypeASNumber.TabIndex = 3;
+			this.radTypeASNumber.TabStop = true;
+			this.radTypeASNumber.Text = "AS Number";
+			this.radTypeASNumber.UseVisualStyleBackColor = true;
+			this.radTypeASNumber.CheckedChanged += new System.EventHandler(this.radType_CheckedChanged);
+			// 
+			// tabPage2
+			// 
+			this.tabPage2.Controls.Add(this.lvwData);
+			this.tabPage2.Controls.Add(this.groupBox3);
+			this.tabPage2.Location = new System.Drawing.Point(4, 22);
+			this.tabPage2.Name = "tabPage2";
+			this.tabPage2.Padding = new System.Windows.Forms.Padding(3);
+			this.tabPage2.Size = new System.Drawing.Size(728, 349);
+			this.tabPage2.TabIndex = 1;
+			this.tabPage2.Text = "Resource data";
+			this.tabPage2.UseVisualStyleBackColor = true;
+			// 
+			// lvwData
+			// 
+			this.lvwData.Dock = System.Windows.Forms.DockStyle.Fill;
+			this.lvwData.Location = new System.Drawing.Point(3, 3);
+			this.lvwData.Name = "lvwData";
+			this.lvwData.Size = new System.Drawing.Size(588, 343);
+			this.lvwData.TabIndex = 4;
+			// 
+			// groupBox3
+			// 
+			this.groupBox3.Controls.Add(this.btnDataDeleteAll);
+			this.groupBox3.Controls.Add(this.btnDataEditString);
+			this.groupBox3.Controls.Add(this.btnDataAddSring);
+			this.groupBox3.Controls.Add(this.btnDataAddCollection);
+			this.groupBox3.Controls.Add(this.btnDataAddDictionary);
+			this.groupBox3.Controls.Add(this.btnDataDelete);
+			this.groupBox3.Controls.Add(this.btnDataAddDNS);
+			this.groupBox3.Controls.Add(this.btnDataSetDescription);
+			this.groupBox3.Controls.Add(this.btnDataSetOwner);
+			this.groupBox3.Dock = System.Windows.Forms.DockStyle.Right;
+			this.groupBox3.Location = new System.Drawing.Point(591, 3);
+			this.groupBox3.Name = "groupBox3";
+			this.groupBox3.Size = new System.Drawing.Size(134, 343);
+			this.groupBox3.TabIndex = 0;
+			this.groupBox3.TabStop = false;
+			this.groupBox3.Text = "Operations";
+			// 
+			// btnDataDeleteAll
+			// 
+			this.btnDataDeleteAll.Dock = System.Windows.Forms.DockStyle.Bottom;
+			this.btnDataDeleteAll.Location = new System.Drawing.Point(3, 202);
+			this.btnDataDeleteAll.Name = "btnDataDeleteAll";
+			this.btnDataDeleteAll.Size = new System.Drawing.Size(128, 23);
+			this.btnDataDeleteAll.TabIndex = 8;
+			this.btnDataDeleteAll.Text = "Delete all data";
+			this.btnDataDeleteAll.UseVisualStyleBackColor = true;
+			this.btnDataDeleteAll.Click += new System.EventHandler(this.btnDataDeleteAll_Click);
+			// 
+			// btnDataEditString
+			// 
+			this.btnDataEditString.Dock = System.Windows.Forms.DockStyle.Bottom;
+			this.btnDataEditString.Location = new System.Drawing.Point(3, 225);
+			this.btnDataEditString.Name = "btnDataEditString";
+			this.btnDataEditString.Size = new System.Drawing.Size(128, 23);
+			this.btnDataEditString.TabIndex = 7;
+			this.btnDataEditString.Text = "Edit string";
+			this.btnDataEditString.UseVisualStyleBackColor = true;
+			this.btnDataEditString.Click += new System.EventHandler(this.btnDataEditString_Click);
+			// 
+			// btnDataAddSring
+			// 
+			this.btnDataAddSring.Dock = System.Windows.Forms.DockStyle.Bottom;
+			this.btnDataAddSring.Location = new System.Drawing.Point(3, 248);
+			this.btnDataAddSring.Name = "btnDataAddSring";
+			this.btnDataAddSring.Size = new System.Drawing.Size(128, 23);
+			this.btnDataAddSring.TabIndex = 6;
+			this.btnDataAddSring.Text = "Add string";
+			this.btnDataAddSring.UseVisualStyleBackColor = true;
+			this.btnDataAddSring.Click += new System.EventHandler(this.btnDataAddSring_Click);
+			// 
+			// btnDataAddCollection
+			// 
+			this.btnDataAddCollection.Dock = System.Windows.Forms.DockStyle.Bottom;
+			this.btnDataAddCollection.Location = new System.Drawing.Point(3, 271);
+			this.btnDataAddCollection.Name = "btnDataAddCollection";
+			this.btnDataAddCollection.Size = new System.Drawing.Size(128, 23);
+			this.btnDataAddCollection.TabIndex = 5;
+			this.btnDataAddCollection.Text = "Add collection";
+			this.btnDataAddCollection.UseVisualStyleBackColor = true;
+			this.btnDataAddCollection.Click += new System.EventHandler(this.btnDataAddCollection_Click);
+			// 
+			// btnDataAddDictionary
+			// 
+			this.btnDataAddDictionary.Dock = System.Windows.Forms.DockStyle.Bottom;
+			this.btnDataAddDictionary.Location = new System.Drawing.Point(3, 294);
+			this.btnDataAddDictionary.Name = "btnDataAddDictionary";
+			this.btnDataAddDictionary.Size = new System.Drawing.Size(128, 23);
+			this.btnDataAddDictionary.TabIndex = 4;
+			this.btnDataAddDictionary.Text = "Add dictionary";
+			this.btnDataAddDictionary.UseVisualStyleBackColor = true;
+			this.btnDataAddDictionary.Click += new System.EventHandler(this.btnDataAddDictionary_Click);
+			// 
+			// btnDataDelete
+			// 
+			this.btnDataDelete.Dock = System.Windows.Forms.DockStyle.Bottom;
+			this.btnDataDelete.Location = new System.Drawing.Point(3, 317);
+			this.btnDataDelete.Name = "btnDataDelete";
+			this.btnDataDelete.Size = new System.Drawing.Size(128, 23);
+			this.btnDataDelete.TabIndex = 3;
+			this.btnDataDelete.Text = "Delete selected entry";
+			this.btnDataDelete.UseVisualStyleBackColor = true;
+			this.btnDataDelete.Click += new System.EventHandler(this.btnDataDelete_Click);
+			// 
+			// btnDataAddDNS
+			// 
+			this.btnDataAddDNS.Dock = System.Windows.Forms.DockStyle.Top;
+			this.btnDataAddDNS.Location = new System.Drawing.Point(3, 62);
+			this.btnDataAddDNS.Name = "btnDataAddDNS";
+			this.btnDataAddDNS.Size = new System.Drawing.Size(128, 23);
+			this.btnDataAddDNS.TabIndex = 2;
+			this.btnDataAddDNS.Text = "Add DNS server";
+			this.btnDataAddDNS.UseVisualStyleBackColor = true;
+			this.btnDataAddDNS.Click += new System.EventHandler(this.btnDataAddDNS_Click);
+			// 
+			// btnDataSetDescription
+			// 
+			this.btnDataSetDescription.Dock = System.Windows.Forms.DockStyle.Top;
+			this.btnDataSetDescription.Location = new System.Drawing.Point(3, 39);
+			this.btnDataSetDescription.Name = "btnDataSetDescription";
+			this.btnDataSetDescription.Size = new System.Drawing.Size(128, 23);
+			this.btnDataSetDescription.TabIndex = 1;
+			this.btnDataSetDescription.Text = "Set description";
+			this.btnDataSetDescription.UseVisualStyleBackColor = true;
+			this.btnDataSetDescription.Click += new System.EventHandler(this.btnDataSetDescription_Click);
+			// 
+			// btnDataSetOwner
+			// 
+			this.btnDataSetOwner.Dock = System.Windows.Forms.DockStyle.Top;
+			this.btnDataSetOwner.Location = new System.Drawing.Point(3, 16);
+			this.btnDataSetOwner.Name = "btnDataSetOwner";
+			this.btnDataSetOwner.Size = new System.Drawing.Size(128, 23);
+			this.btnDataSetOwner.TabIndex = 0;
+			this.btnDataSetOwner.Text = "Set owner name";
+			this.btnDataSetOwner.UseVisualStyleBackColor = true;
+			this.btnDataSetOwner.Click += new System.EventHandler(this.btnDataSetOwner_Click);
+			// 
+			// tabPage3
+			// 
+			this.tabPage3.Controls.Add(this.grpUpdateConflict);
+			this.tabPage3.Controls.Add(this.grpUpdateExport);
+			this.tabPage3.Controls.Add(this.groupBox4);
+			this.tabPage3.Location = new System.Drawing.Point(4, 22);
+			this.tabPage3.Name = "tabPage3";
+			this.tabPage3.Size = new System.Drawing.Size(728, 349);
+			this.tabPage3.TabIndex = 2;
+			this.tabPage3.Text = "Generate update";
+			this.tabPage3.UseVisualStyleBackColor = true;
+			// 
+			// grpUpdateConflict
+			// 
+			this.grpUpdateConflict.Controls.Add(this.btnUpdateDelete);
+			this.grpUpdateConflict.Controls.Add(this.label9);
+			this.grpUpdateConflict.Dock = System.Windows.Forms.DockStyle.Top;
+			this.grpUpdateConflict.Location = new System.Drawing.Point(0, 246);
+			this.grpUpdateConflict.Name = "grpUpdateConflict";
+			this.grpUpdateConflict.Size = new System.Drawing.Size(728, 100);
+			this.grpUpdateConflict.TabIndex = 2;
+			this.grpUpdateConflict.TabStop = false;
+			this.grpUpdateConflict.Text = "Error";
+			// 
+			// btnUpdateDelete
+			// 
+			this.btnUpdateDelete.Location = new System.Drawing.Point(462, 68);
+			this.btnUpdateDelete.Margin = new System.Windows.Forms.Padding(0);
+			this.btnUpdateDelete.Name = "btnUpdateDelete";
+			this.btnUpdateDelete.Size = new System.Drawing.Size(261, 26);
+			this.btnUpdateDelete.TabIndex = 12;
+			this.btnUpdateDelete.Text = "Delete resource";
+			this.btnUpdateDelete.UseVisualStyleBackColor = true;
+			this.btnUpdateDelete.Click += new System.EventHandler(this.btnUpdateDelete_Click);
+			// 
+			// label9
+			// 
+			this.label9.Dock = System.Windows.Forms.DockStyle.Top;
+			this.label9.Location = new System.Drawing.Point(3, 16);
+			this.label9.Name = "label9";
+			this.label9.Size = new System.Drawing.Size(722, 52);
+			this.label9.TabIndex = 0;
+			this.label9.Text = resources.GetString("label9.Text");
+			// 
+			// grpUpdateExport
+			// 
+			this.grpUpdateExport.AutoSize = true;
+			this.grpUpdateExport.Controls.Add(this.tableLayoutPanel4);
+			this.grpUpdateExport.Dock = System.Windows.Forms.DockStyle.Top;
+			this.grpUpdateExport.Location = new System.Drawing.Point(0, 149);
+			this.grpUpdateExport.Name = "grpUpdateExport";
+			this.grpUpdateExport.Size = new System.Drawing.Size(728, 97);
+			this.grpUpdateExport.TabIndex = 1;
+			this.grpUpdateExport.TabStop = false;
+			this.grpUpdateExport.Text = "Update";
+			// 
+			// tableLayoutPanel4
+			// 
+			this.tableLayoutPanel4.AutoSize = true;
+			this.tableLayoutPanel4.ColumnCount = 4;
+			this.tableLayoutPanel4.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 100F));
+			this.tableLayoutPanel4.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
+			this.tableLayoutPanel4.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 100F));
+			this.tableLayoutPanel4.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
+			this.tableLayoutPanel4.Controls.Add(this.panel1, 1, 1);
+			this.tableLayoutPanel4.Controls.Add(this.dtpUpdateExpiration, 1, 2);
+			this.tableLayoutPanel4.Controls.Add(this.btnUpdateNow, 3, 2);
+			this.tableLayoutPanel4.Controls.Add(this.label11, 0, 1);
+			this.tableLayoutPanel4.Controls.Add(this.label5, 0, 2);
+			this.tableLayoutPanel4.Controls.Add(this.txtUpdateOwner, 1, 0);
+			this.tableLayoutPanel4.Controls.Add(this.label8, 0, 0);
+			this.tableLayoutPanel4.Dock = System.Windows.Forms.DockStyle.Top;
+			this.tableLayoutPanel4.Location = new System.Drawing.Point(3, 16);
+			this.tableLayoutPanel4.Name = "tableLayoutPanel4";
+			this.tableLayoutPanel4.RowCount = 3;
+			this.tableLayoutPanel4.RowStyles.Add(new System.Windows.Forms.RowStyle());
+			this.tableLayoutPanel4.RowStyles.Add(new System.Windows.Forms.RowStyle());
+			this.tableLayoutPanel4.RowStyles.Add(new System.Windows.Forms.RowStyle());
+			this.tableLayoutPanel4.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
+			this.tableLayoutPanel4.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
+			this.tableLayoutPanel4.Size = new System.Drawing.Size(722, 78);
+			this.tableLayoutPanel4.TabIndex = 8;
+			// 
+			// panel1
+			// 
+			this.panel1.AutoSize = true;
+			this.tableLayoutPanel4.SetColumnSpan(this.panel1, 3);
+			this.panel1.Controls.Add(this.txtUpdateTransfer);
+			this.panel1.Controls.Add(this.chkUpdateTransferEnabled);
+			this.panel1.Dock = System.Windows.Forms.DockStyle.Top;
+			this.panel1.Location = new System.Drawing.Point(103, 29);
+			this.panel1.MinimumSize = new System.Drawing.Size(0, 20);
+			this.panel1.Name = "panel1";
+			this.panel1.Size = new System.Drawing.Size(616, 20);
+			this.panel1.TabIndex = 21;
+			// 
+			// txtUpdateTransfer
+			// 
+			this.txtUpdateTransfer.Dock = System.Windows.Forms.DockStyle.Fill;
+			this.txtUpdateTransfer.Location = new System.Drawing.Point(15, 0);
+			this.txtUpdateTransfer.Name = "txtUpdateTransfer";
+			this.txtUpdateTransfer.Size = new System.Drawing.Size(601, 20);
+			this.txtUpdateTransfer.TabIndex = 21;
+			// 
+			// chkUpdateTransferEnabled
+			// 
+			this.chkUpdateTransferEnabled.AutoSize = true;
+			this.chkUpdateTransferEnabled.Dock = System.Windows.Forms.DockStyle.Left;
+			this.chkUpdateTransferEnabled.Location = new System.Drawing.Point(0, 0);
+			this.chkUpdateTransferEnabled.Name = "chkUpdateTransferEnabled";
+			this.chkUpdateTransferEnabled.Size = new System.Drawing.Size(15, 20);
+			this.chkUpdateTransferEnabled.TabIndex = 20;
+			this.chkUpdateTransferEnabled.UseVisualStyleBackColor = true;
+			// 
+			// dtpUpdateExpiration
+			// 
+			this.dtpUpdateExpiration.Checked = false;
+			this.dtpUpdateExpiration.Dock = System.Windows.Forms.DockStyle.Fill;
+			this.dtpUpdateExpiration.Location = new System.Drawing.Point(103, 55);
+			this.dtpUpdateExpiration.Name = "dtpUpdateExpiration";
+			this.dtpUpdateExpiration.ShowCheckBox = true;
+			this.dtpUpdateExpiration.Size = new System.Drawing.Size(255, 20);
+			this.dtpUpdateExpiration.TabIndex = 13;
+			// 
+			// btnUpdateNow
+			// 
+			this.btnUpdateNow.Dock = System.Windows.Forms.DockStyle.Fill;
+			this.btnUpdateNow.Location = new System.Drawing.Point(461, 52);
+			this.btnUpdateNow.Margin = new System.Windows.Forms.Padding(0);
+			this.btnUpdateNow.Name = "btnUpdateNow";
+			this.btnUpdateNow.Size = new System.Drawing.Size(261, 26);
+			this.btnUpdateNow.TabIndex = 18;
+			this.btnUpdateNow.Text = "Update resource";
+			this.btnUpdateNow.UseVisualStyleBackColor = true;
+			this.btnUpdateNow.Click += new System.EventHandler(this.btnUpdateNow_Click);
+			// 
+			// label11
+			// 
+			this.label11.Anchor = System.Windows.Forms.AnchorStyles.Left;
+			this.label11.AutoSize = true;
+			this.label11.Location = new System.Drawing.Point(3, 32);
+			this.label11.Name = "label11";
+			this.label11.Size = new System.Drawing.Size(78, 13);
+			this.label11.TabIndex = 16;
+			this.label11.Text = "Transfer to key";
+			this.label11.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+			// 
+			// label5
+			// 
+			this.label5.Anchor = System.Windows.Forms.AnchorStyles.Left;
+			this.label5.AutoSize = true;
+			this.label5.Location = new System.Drawing.Point(3, 58);
+			this.label5.Name = "label5";
+			this.label5.Size = new System.Drawing.Size(53, 13);
+			this.label5.TabIndex = 6;
+			this.label5.Text = "Expiration";
+			this.label5.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+			// 
+			// txtUpdateOwner
+			// 
+			this.tableLayoutPanel4.SetColumnSpan(this.txtUpdateOwner, 3);
+			this.txtUpdateOwner.Dock = System.Windows.Forms.DockStyle.Fill;
+			this.txtUpdateOwner.Location = new System.Drawing.Point(103, 3);
+			this.txtUpdateOwner.Name = "txtUpdateOwner";
+			this.txtUpdateOwner.ReadOnly = true;
+			this.txtUpdateOwner.Size = new System.Drawing.Size(616, 20);
+			this.txtUpdateOwner.TabIndex = 5;
+			// 
+			// label8
+			// 
+			this.label8.Anchor = System.Windows.Forms.AnchorStyles.Left;
+			this.label8.AutoSize = true;
+			this.label8.Location = new System.Drawing.Point(3, 6);
+			this.label8.Name = "label8";
+			this.label8.Size = new System.Drawing.Size(58, 13);
+			this.label8.TabIndex = 1;
+			this.label8.Text = "Owner key";
+			this.label8.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+			// 
+			// groupBox4
+			// 
+			this.groupBox4.AutoSize = true;
+			this.groupBox4.Controls.Add(this.tableLayoutPanel1);
+			this.groupBox4.Dock = System.Windows.Forms.DockStyle.Top;
+			this.groupBox4.Location = new System.Drawing.Point(0, 0);
+			this.groupBox4.Name = "groupBox4";
+			this.groupBox4.Size = new System.Drawing.Size(728, 149);
+			this.groupBox4.TabIndex = 0;
+			this.groupBox4.TabStop = false;
+			this.groupBox4.Text = "Current status";
+			// 
+			// tableLayoutPanel1
+			// 
+			this.tableLayoutPanel1.AutoSize = true;
+			this.tableLayoutPanel1.ColumnCount = 4;
+			this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 100F));
+			this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
+			this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 100F));
+			this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
+			this.tableLayoutPanel1.Controls.Add(this.txtUpdateCurrentExpiration, 3, 3);
+			this.tableLayoutPanel1.Controls.Add(this.label10, 2, 3);
+			this.tableLayoutPanel1.Controls.Add(this.txtUpdateCurrentTransfer, 1, 2);
+			this.tableLayoutPanel1.Controls.Add(this.label6, 0, 2);
+			this.tableLayoutPanel1.Controls.Add(this.txtUpdateCurrentSize, 1, 4);
+			this.tableLayoutPanel1.Controls.Add(this.label7, 0, 4);
+			this.tableLayoutPanel1.Controls.Add(this.txtUpdateCurrentStatus, 3, 4);
+			this.tableLayoutPanel1.Controls.Add(this.label4, 2, 4);
+			this.tableLayoutPanel1.Controls.Add(this.txtUpdateCurrentSerial, 1, 3);
+			this.tableLayoutPanel1.Controls.Add(this.label3, 0, 3);
+			this.tableLayoutPanel1.Controls.Add(this.txtUpdateLabel, 1, 0);
+			this.tableLayoutPanel1.Controls.Add(this.txtUpdateCurrentOwner, 1, 1);
+			this.tableLayoutPanel1.Controls.Add(this.label1, 0, 0);
+			this.tableLayoutPanel1.Controls.Add(this.label2, 0, 1);
+			this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Top;
+			this.tableLayoutPanel1.Location = new System.Drawing.Point(3, 16);
+			this.tableLayoutPanel1.Name = "tableLayoutPanel1";
+			this.tableLayoutPanel1.RowCount = 5;
+			this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
+			this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
+			this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
+			this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
+			this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
+			this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
+			this.tableLayoutPanel1.Size = new System.Drawing.Size(722, 130);
+			this.tableLayoutPanel1.TabIndex = 8;
+			// 
+			// txtUpdateCurrentExpiration
+			// 
+			this.txtUpdateCurrentExpiration.Dock = System.Windows.Forms.DockStyle.Fill;
+			this.txtUpdateCurrentExpiration.Location = new System.Drawing.Point(464, 81);
+			this.txtUpdateCurrentExpiration.Name = "txtUpdateCurrentExpiration";
+			this.txtUpdateCurrentExpiration.ReadOnly = true;
+			this.txtUpdateCurrentExpiration.Size = new System.Drawing.Size(255, 20);
+			this.txtUpdateCurrentExpiration.TabIndex = 18;
+			// 
+			// label10
+			// 
+			this.label10.Anchor = System.Windows.Forms.AnchorStyles.Left;
+			this.label10.AutoSize = true;
+			this.label10.Location = new System.Drawing.Point(364, 84);
+			this.label10.Name = "label10";
+			this.label10.Size = new System.Drawing.Size(53, 13);
+			this.label10.TabIndex = 17;
+			this.label10.Text = "Expiration";
+			this.label10.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+			// 
+			// txtUpdateCurrentTransfer
+			// 
+			this.tableLayoutPanel1.SetColumnSpan(this.txtUpdateCurrentTransfer, 3);
+			this.txtUpdateCurrentTransfer.Dock = System.Windows.Forms.DockStyle.Fill;
+			this.txtUpdateCurrentTransfer.Location = new System.Drawing.Point(103, 55);
+			this.txtUpdateCurrentTransfer.Name = "txtUpdateCurrentTransfer";
+			this.txtUpdateCurrentTransfer.ReadOnly = true;
+			this.txtUpdateCurrentTransfer.Size = new System.Drawing.Size(616, 20);
+			this.txtUpdateCurrentTransfer.TabIndex = 16;
+			// 
+			// label6
+			// 
+			this.label6.Anchor = System.Windows.Forms.AnchorStyles.Left;
+			this.label6.AutoSize = true;
+			this.label6.Location = new System.Drawing.Point(3, 58);
+			this.label6.Name = "label6";
+			this.label6.Size = new System.Drawing.Size(78, 13);
+			this.label6.TabIndex = 15;
+			this.label6.Text = "Transfer to key";
+			this.label6.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+			// 
+			// txtUpdateCurrentSize
+			// 
+			this.txtUpdateCurrentSize.Dock = System.Windows.Forms.DockStyle.Fill;
+			this.txtUpdateCurrentSize.Location = new System.Drawing.Point(103, 107);
+			this.txtUpdateCurrentSize.Name = "txtUpdateCurrentSize";
+			this.txtUpdateCurrentSize.ReadOnly = true;
+			this.txtUpdateCurrentSize.Size = new System.Drawing.Size(255, 20);
+			this.txtUpdateCurrentSize.TabIndex = 14;
+			// 
+			// label7
+			// 
+			this.label7.Anchor = System.Windows.Forms.AnchorStyles.Left;
+			this.label7.AutoSize = true;
+			this.label7.Location = new System.Drawing.Point(3, 110);
+			this.label7.Name = "label7";
+			this.label7.Size = new System.Drawing.Size(27, 13);
+			this.label7.TabIndex = 13;
+			this.label7.Text = "Size";
+			this.label7.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+			// 
+			// txtUpdateCurrentStatus
+			// 
+			this.txtUpdateCurrentStatus.Dock = System.Windows.Forms.DockStyle.Fill;
+			this.txtUpdateCurrentStatus.Location = new System.Drawing.Point(464, 107);
+			this.txtUpdateCurrentStatus.Name = "txtUpdateCurrentStatus";
+			this.txtUpdateCurrentStatus.ReadOnly = true;
+			this.txtUpdateCurrentStatus.Size = new System.Drawing.Size(255, 20);
+			this.txtUpdateCurrentStatus.TabIndex = 10;
+			// 
+			// label4
+			// 
+			this.label4.Anchor = System.Windows.Forms.AnchorStyles.Left;
+			this.label4.AutoSize = true;
+			this.label4.Location = new System.Drawing.Point(364, 110);
+			this.label4.Name = "label4";
+			this.label4.Size = new System.Drawing.Size(37, 13);
+			this.label4.TabIndex = 9;
+			this.label4.Text = "Status";
+			this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+			// 
+			// txtUpdateCurrentSerial
+			// 
+			this.txtUpdateCurrentSerial.Dock = System.Windows.Forms.DockStyle.Fill;
+			this.txtUpdateCurrentSerial.Location = new System.Drawing.Point(103, 81);
+			this.txtUpdateCurrentSerial.Name = "txtUpdateCurrentSerial";
+			this.txtUpdateCurrentSerial.ReadOnly = true;
+			this.txtUpdateCurrentSerial.Size = new System.Drawing.Size(255, 20);
+			this.txtUpdateCurrentSerial.TabIndex = 8;
+			// 
+			// label3
+			// 
+			this.label3.Anchor = System.Windows.Forms.AnchorStyles.Left;
+			this.label3.AutoSize = true;
+			this.label3.Location = new System.Drawing.Point(3, 84);
+			this.label3.Name = "label3";
+			this.label3.Size = new System.Drawing.Size(33, 13);
+			this.label3.TabIndex = 7;
+			this.label3.Text = "Serial";
+			this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+			// 
+			// txtUpdateLabel
+			// 
+			this.tableLayoutPanel1.SetColumnSpan(this.txtUpdateLabel, 3);
+			this.txtUpdateLabel.Dock = System.Windows.Forms.DockStyle.Fill;
+			this.txtUpdateLabel.Location = new System.Drawing.Point(103, 3);
+			this.txtUpdateLabel.Name = "txtUpdateLabel";
+			this.txtUpdateLabel.ReadOnly = true;
+			this.txtUpdateLabel.Size = new System.Drawing.Size(616, 20);
+			this.txtUpdateLabel.TabIndex = 6;
+			// 
+			// txtUpdateCurrentOwner
+			// 
+			this.tableLayoutPanel1.SetColumnSpan(this.txtUpdateCurrentOwner, 3);
+			this.txtUpdateCurrentOwner.Dock = System.Windows.Forms.DockStyle.Fill;
+			this.txtUpdateCurrentOwner.Location = new System.Drawing.Point(103, 29);
+			this.txtUpdateCurrentOwner.Name = "txtUpdateCurrentOwner";
+			this.txtUpdateCurrentOwner.ReadOnly = true;
+			this.txtUpdateCurrentOwner.Size = new System.Drawing.Size(616, 20);
+			this.txtUpdateCurrentOwner.TabIndex = 5;
+			// 
+			// label1
+			// 
+			this.label1.Anchor = System.Windows.Forms.AnchorStyles.Left;
+			this.label1.AutoSize = true;
+			this.label1.Location = new System.Drawing.Point(3, 6);
+			this.label1.Name = "label1";
+			this.label1.Size = new System.Drawing.Size(53, 13);
+			this.label1.TabIndex = 0;
+			this.label1.Text = "Resource";
+			this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+			// 
+			// label2
+			// 
+			this.label2.Anchor = System.Windows.Forms.AnchorStyles.Left;
+			this.label2.AutoSize = true;
+			this.label2.Location = new System.Drawing.Point(3, 32);
+			this.label2.Name = "label2";
+			this.label2.Size = new System.Drawing.Size(58, 13);
+			this.label2.TabIndex = 1;
+			this.label2.Text = "Owner key";
+			this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+			// 
+			// frmEditResource
+			// 
+			this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+			this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+			this.ClientSize = new System.Drawing.Size(736, 375);
+			this.Controls.Add(this.tabControl1);
+			this.Name = "frmEditResource";
+			this.Text = "MARC Resource Editor";
+			this.Load += new System.EventHandler(this.frmEditResource_Load);
+			this.tabControl1.ResumeLayout(false);
+			this.tabPage1.ResumeLayout(false);
+			this.groupBox2.ResumeLayout(false);
+			this.groupBox2.PerformLayout();
+			this.groupBox1.ResumeLayout(false);
+			this.groupBox1.PerformLayout();
+			this.tabPage2.ResumeLayout(false);
+			this.groupBox3.ResumeLayout(false);
+			this.tabPage3.ResumeLayout(false);
+			this.tabPage3.PerformLayout();
+			this.grpUpdateConflict.ResumeLayout(false);
+			this.grpUpdateExport.ResumeLayout(false);
+			this.grpUpdateExport.PerformLayout();
+			this.tableLayoutPanel4.ResumeLayout(false);
+			this.tableLayoutPanel4.PerformLayout();
+			this.panel1.ResumeLayout(false);
+			this.panel1.PerformLayout();
+			this.groupBox4.ResumeLayout(false);
+			this.groupBox4.PerformLayout();
+			this.tableLayoutPanel1.ResumeLayout(false);
+			this.tableLayoutPanel1.PerformLayout();
+			this.ResumeLayout(false);
+
+		}
+
+		#endregion
+
+		private System.Windows.Forms.TabControl tabControl1;
+		private System.Windows.Forms.TabPage tabPage1;
+		private System.Windows.Forms.RadioButton radTypeOtherHex;
+		private System.Windows.Forms.RadioButton radTypeASNumber;
+		private System.Windows.Forms.RadioButton radTypeIPv6;
+		private System.Windows.Forms.RadioButton radTypeIPv4;
+		private System.Windows.Forms.RadioButton radTypeDomain;
+		private System.Windows.Forms.TabPage tabPage2;
+		private System.Windows.Forms.TabPage tabPage3;
+		private System.Windows.Forms.GroupBox groupBox1;
+		private System.Windows.Forms.GroupBox groupBox2;
+		private System.Windows.Forms.Label lblLabelHint;
+		private System.Windows.Forms.TextBox txtLabelValue;
+		private System.Windows.Forms.Label lblLabelValid;
+		private System.Windows.Forms.Button btnLabelNext;
+		private System.Windows.Forms.GroupBox groupBox3;
+		private System.Windows.Forms.TreeView lvwData;
+		private System.Windows.Forms.Button btnDataAddSring;
+		private System.Windows.Forms.Button btnDataAddCollection;
+		private System.Windows.Forms.Button btnDataAddDictionary;
+		private System.Windows.Forms.Button btnDataDelete;
+		private System.Windows.Forms.Button btnDataAddDNS;
+		private System.Windows.Forms.Button btnDataSetDescription;
+		private System.Windows.Forms.Button btnDataSetOwner;
+		private System.Windows.Forms.Button btnDataEditString;
+		private System.Windows.Forms.GroupBox groupBox4;
+		private System.Windows.Forms.GroupBox grpUpdateExport;
+		private System.Windows.Forms.TableLayoutPanel tableLayoutPanel4;
+		private System.Windows.Forms.TextBox txtUpdateOwner;
+		private System.Windows.Forms.Label label8;
+		private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
+		private System.Windows.Forms.TextBox txtUpdateLabel;
+		private System.Windows.Forms.TextBox txtUpdateCurrentOwner;
+		private System.Windows.Forms.Label label1;
+		private System.Windows.Forms.Label label2;
+		private System.Windows.Forms.GroupBox grpUpdateConflict;
+		private System.Windows.Forms.Label label9;
+		private System.Windows.Forms.Button btnUpdateDelete;
+		private System.Windows.Forms.Button btnDataDeleteAll;
+		private System.Windows.Forms.TextBox txtUpdateCurrentSerial;
+		private System.Windows.Forms.Label label3;
+		private System.Windows.Forms.TextBox txtUpdateCurrentExpiration;
+		private System.Windows.Forms.Label label10;
+		private System.Windows.Forms.TextBox txtUpdateCurrentTransfer;
+		private System.Windows.Forms.Label label6;
+		private System.Windows.Forms.TextBox txtUpdateCurrentSize;
+		private System.Windows.Forms.Label label7;
+		private System.Windows.Forms.TextBox txtUpdateCurrentStatus;
+		private System.Windows.Forms.Label label4;
+		private System.Windows.Forms.Button btnUpdateNow;
+		private System.Windows.Forms.Label label11;
+		private System.Windows.Forms.Label label5;
+		private System.Windows.Forms.DateTimePicker dtpUpdateExpiration;
+		private System.Windows.Forms.Panel panel1;
+		private System.Windows.Forms.TextBox txtUpdateTransfer;
+		private System.Windows.Forms.CheckBox chkUpdateTransferEnabled;
+	}
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ARClient/frmEditResource.cs	Sat Nov 08 22:43:51 2014 +0100
@@ -0,0 +1,371 @@
+using System;
+using System.Collections;
+using System.Net;
+using System.Text;
+using System.Windows.Forms;
+
+namespace ARClient {
+	partial class frmEditResource : Form {
+		public Form1 MainForm { get; set; }
+		public Byte[] Label = null;
+		public IDictionary Value = new Hashtable();
+		public UInt32 UpdateSerial = 0;
+
+		public frmEditResource() {
+			InitializeComponent();
+			radTypeDomain.Checked = true;
+		}
+
+		private void frmEditResource_Load(object sender, EventArgs e) {
+			tabControl1_SelectedIndexChanged(null, null);
+		}
+		public void ImportData() {
+			tabControl1.SelectedIndex = 1;
+		}
+
+		private void radType_CheckedChanged(object sender, EventArgs e) {
+			if (radTypeDomain.Checked) {
+				lblLabelHint.Text = "Enter the domain name including the top level component. For an Anonet domain, your domain name must end in '.ano'.";
+				if (Label != null && Label.Length > 1 && Label[0] == 4) txtLabelValue.Text = Encoding.UTF8.GetString(Label, 1, Label.Length - 1);
+				else txtLabelValue_TextChanged(sender, e);
+			} else if (radTypeIPv4.Checked) {
+				lblLabelHint.Text = "Enter the IPv4 network in CIDR notation, e.g. '1.2.3.0/24'.";
+				if (Label != null && Label.Length == 6 && Label[0] == 1) txtLabelValue.Text = Label[1].ToString() + "." + Label[2].ToString() + "." + Label[3].ToString() + "." + Label[4].ToString() + "/" + Label[5].ToString();
+				else txtLabelValue_TextChanged(sender, e);
+			} else if (radTypeIPv6.Checked) {
+				lblLabelHint.Text = "Enter the IPv6 network in CIDR notation, e.g. 'fd63:1e39:6f73:001b::/64'.";
+				if (Label != null && Label.Length == 18 && Label[0] == 2) {
+					Byte[] address = new Byte[16];
+					Buffer.BlockCopy(Label, 2, address, 0, 16);
+					txtLabelValue.Text = (new IPAddress(address)).ToString() + "/" + Label[17].ToString();
+				} else txtLabelValue_TextChanged(sender, e);
+			} else if (radTypeASNumber.Checked) {
+				lblLabelHint.Text = "Enter the AS number.";
+				if (Label != null && Label.Length == 5 && Label[0] == 3) txtLabelValue.Text = Functions.DecodeInt32BigEndian(Label, 1).ToString();
+				else txtLabelValue_TextChanged(sender, e);
+			} else if (radTypeOtherHex.Checked) {
+				lblLabelHint.Text = "Expert usage! Enter the raw label value in hexadecimal notation.";
+				if (Label != null) txtLabelValue.Text = Functions.bin2hex(Label);
+				else txtLabelValue_TextChanged(sender, e);
+			} else {
+				lblLabelHint.Text = "Select a resource type.";
+			}
+		}
+
+		private Boolean TryParseLabel() {
+			Label = null;
+			if (radTypeDomain.Checked) {
+				if (txtLabelValue.Text.Length < 1) return false;
+				Byte[] bytes = Encoding.UTF8.GetBytes(txtLabelValue.Text.ToLowerInvariant());
+				Label = new Byte[bytes.Length + 1];
+				Label[0] = 4;
+				bytes.CopyTo(Label, 1);
+				return true;
+			} else if (radTypeIPv4.Checked) {
+				String[] parts1 = txtLabelValue.Text.Split('/');
+				if (parts1.Length != 2) return false;
+				String[] parts2 = parts1[0].Split('.');
+				if (parts2.Length != 4) return false;
+				Byte[] bytes = new Byte[6];
+				bytes[0] = 1;
+				for (int i = 0; i < 4; i++) if (!Byte.TryParse(parts2[i], out bytes[i + 1])) return false;
+				if (!Byte.TryParse(parts1[1], out bytes[5])) return false;
+				if (bytes[5] > 32) return false;
+				Label = bytes;
+				return true;
+			} else if (radTypeIPv6.Checked) {
+				String[] parts1 = txtLabelValue.Text.Split('/');
+				if (parts1.Length != 2) return false;
+				IPAddress addr;
+				if (!IPAddress.TryParse(parts1[0], out addr)) return false;
+				if (addr.AddressFamily != System.Net.Sockets.AddressFamily.InterNetworkV6) return false;
+				Byte len;
+				if (!Byte.TryParse(parts1[1], out len)) return false;
+				if (len > 128) return false;
+				Label = new Byte[18];
+				Label[0] = 2;
+				addr.GetAddressBytes().CopyTo(Label, 1);
+				Label[17] = len;
+				return true;
+			} else if (radTypeASNumber.Checked) {
+				UInt32 asn;
+				if (!UInt32.TryParse(txtLabelValue.Text, out asn)) return false;
+				Label = new Byte[5];
+				Label[0] = 3;
+				Functions.EncodeInt32BigEndian(asn).CopyTo(Label, 1);
+				return true;
+			} else if (radTypeOtherHex.Checked) {
+				Label = Functions.hex2bin(txtLabelValue.Text);
+				return Label != null;
+			} else {
+				return false;
+			}
+		}
+
+		private void txtLabelValue_TextChanged(object sender, EventArgs e) {
+			Boolean valid = TryParseLabel();
+			lblLabelValid.Visible = !valid;
+			btnLabelNext.Visible = valid;
+		}
+
+		private void btnLabelNext_Click(object sender, EventArgs e) {
+			tabControl1.SelectedIndex++;
+		}
+
+		private void UpdateValueTree() {
+			lvwData.SuspendLayout();
+			lvwData.Nodes.Clear();
+
+			if (Value is IDictionary) {
+				foreach (DictionaryEntry child in (IDictionary)Value) lvwData.Nodes.Add(AddResourceValueInTree(child.Key.ToString() + ": ", child.Value));
+			} else if (Value is ICollection) {
+				foreach (Object child in (ICollection)Value) lvwData.Nodes.Add(AddResourceValueInTree(String.Empty, child));
+			} else if (Value == null) {
+				lvwData.Nodes.Add("Null").Tag = null;
+			} else {
+				lvwData.Nodes.Add(Value.ToString()).Tag = Value;
+			}
+
+			lvwData.ResumeLayout();
+		}
+		private TreeNode AddResourceValueInTree(String prefix, Object value) {
+			TreeNode node = new TreeNode();
+			if (value is IDictionary) {
+				node.Text = prefix + "Dictionary";
+				foreach (DictionaryEntry child in (IDictionary)value) node.Nodes.Add(AddResourceValueInTree(child.Key.ToString() + ": ", child.Value));
+			} else if (value is ICollection) {
+				node.Text = prefix + "Collection";
+				foreach (Object child in (ICollection)value) node.Nodes.Add(AddResourceValueInTree(String.Empty, child));
+			} else if (value == null) {
+				node.Text = prefix + "Null";
+			} else {
+				node.Text = prefix + value.ToString();
+			}
+			node.Tag = value;
+			node.Expand();
+			return node;
+		}
+
+		private void btnDataSetOwner_Click(object sender, EventArgs e) {
+			frmTextInput form = new frmTextInput();
+			form.Text = "MARC - Resource data";
+			form.Description = "Enter the owner name:";
+			if (!(Value is IDictionary)) Value = new Hashtable();
+			if (Value.Contains("owner")) form.Value = Value["owner"].ToString();
+			if (form.ShowDialog(this) != DialogResult.OK) return;
+			Value["owner"] = form.Value;
+			UpdateValueTree();
+		}
+		private void btnDataSetDescription_Click(object sender, EventArgs e) {
+			frmTextInput form = new frmTextInput();
+			form.Text = "MARC - Resource data";
+			form.Description = "Enter the resource description:";
+			if (!(Value is IDictionary)) Value = new Hashtable();
+			if (Value.Contains("descr")) form.Value = Value["descr"].ToString();
+			if (form.ShowDialog(this) != DialogResult.OK) return;
+			Value["descr"] = form.Value;
+			UpdateValueTree();
+		}
+		private void btnDataAddDNS_Click(object sender, EventArgs e) {
+			frmTextInput form = new frmTextInput();
+			form.Text = "MARC - Resource data";
+			form.Description = "Enter the nameserver name in the current zone, or add a dot ad the end to use a nameserver in another zone:";
+			form.Value = "ns1";
+			if (form.ShowDialog(this) != DialogResult.OK) return;
+			String nsname = form.Value;
+			String nsip4 = null, nsip6 = null;
+			if (!nsname.EndsWith(".")) {
+				form.Description = "Enter the nameserver IPv4 address, if any:";
+				form.Value = "";
+				if (form.ShowDialog(this) == DialogResult.OK) nsip4 = form.Value;
+				form.Description = "Enter the nameserver IPv6 address, if any:";
+				form.Value = "";
+				if (form.ShowDialog(this) == DialogResult.OK) nsip6 = form.Value;
+			}
+			if (!(Value is IDictionary)) Value = new Hashtable();
+			if (Value["ns"] == null || !(Value["ns"] is IDictionary)) Value["ns"] = new Hashtable();
+			IDictionary dns = (IDictionary)Value["ns"];
+			IList ns = new ArrayList();
+			dns[nsname] = ns;
+			if (nsip4 != null && nsip4.Length > 0) ns.Add(nsip4);
+			if (nsip6 != null && nsip6.Length > 0) ns.Add(nsip6);
+			UpdateValueTree();
+		}
+
+		private void btnDataEditString_Click(object sender, EventArgs e) {
+			if (lvwData.SelectedNode == null || lvwData.SelectedNode.Tag == null) return;
+			frmTextInput form = new frmTextInput();
+			form.Text = "MARC - Resource data";
+			form.Description = "Enter the new value:";
+			form.Value = lvwData.SelectedNode.Tag.ToString();
+			if (form.ShowDialog(this) != DialogResult.OK) return;
+			Object parent = lvwData.SelectedNode.Parent == null ? Value : lvwData.SelectedNode.Parent.Tag;
+			if (parent == null) return;
+			if (parent is IDictionary) {
+				foreach (DictionaryEntry entry in ((IDictionary)parent)) {
+					if (lvwData.SelectedNode.Tag == entry.Value) {
+						((IDictionary)parent)[entry.Key] = form.Value;
+						break;
+					}
+				}
+			} else if (parent is IList) {
+				for (int i = 0; i < ((IList)parent).Count; i++) {
+					if (((IList)parent)[i] == lvwData.SelectedNode.Tag) ((IList)parent)[i] = form.Value;
+				}
+			}
+			UpdateValueTree();
+		}
+
+		private void btnDataAddSring_Click(object sender, EventArgs e) {
+			Object parent = lvwData.SelectedNode == null ? Value : lvwData.SelectedNode.Tag;
+			if (!(parent is IDictionary || parent is IList)) return;
+			frmTextInput form = new frmTextInput();
+			form.Text = "MARC - Resource data";
+			String dkey = null;
+			if (parent is IDictionary) {
+				form.Description = "Enter the dictionary key:";
+				if (form.ShowDialog(this) != DialogResult.OK) return;
+				dkey = form.Value;
+			}
+			form.Value = String.Empty;
+			form.Description = "Enter the value:";
+			if (form.ShowDialog(this) != DialogResult.OK) return;
+			if (parent is IDictionary) {
+				((IDictionary)parent)[dkey]= form.Value;
+			} else if (parent is IList) {
+				((IList)parent).Add(form.Value);
+			}
+			UpdateValueTree();
+		}
+
+		private void btnDataAddCollection_Click(object sender, EventArgs e) {
+			Object parent = lvwData.SelectedNode == null ? Value : lvwData.SelectedNode.Tag;
+			if (parent is IDictionary) {
+				frmTextInput form = new frmTextInput();
+				form.Text = "MARC - Resource data";
+				form.Description = "Enter the dictionary key:";
+				if (form.ShowDialog(this) != DialogResult.OK) return;
+				((IDictionary)parent)[form.Value] = new ArrayList();
+			} else if (parent is IList) {
+				((IList)parent).Add(new ArrayList());
+			}
+			UpdateValueTree();
+		}
+
+		private void btnDataAddDictionary_Click(object sender, EventArgs e) {
+			Object parent = lvwData.SelectedNode == null ? Value : lvwData.SelectedNode.Tag;
+			if (parent is IDictionary) {
+				frmTextInput form = new frmTextInput();
+				form.Text = "MARC - Resource data";
+				form.Description = "Enter the dictionary key:";
+				if (form.ShowDialog(this) != DialogResult.OK) return;
+				((IDictionary)parent)[form.Value] = new Hashtable();
+			} else if (parent is IList) {
+				((IList)parent).Add(new Hashtable());
+			}
+			UpdateValueTree();
+		}
+
+		private void btnDataDelete_Click(object sender, EventArgs e) {
+			if (lvwData.SelectedNode == null || lvwData.SelectedNode.Tag == null) return;
+			Object parent = lvwData.SelectedNode.Parent == null ? Value : lvwData.SelectedNode.Parent.Tag;
+			if (parent == null) return;
+			if (parent is IDictionary) {
+				foreach (DictionaryEntry entry in ((IDictionary)parent)) {
+					if (lvwData.SelectedNode.Tag == entry.Value) {
+						((IDictionary)parent).Remove(entry.Key);
+						break;
+					}
+				}
+			} else if (parent is IList) {
+				((IList)parent).Remove(lvwData.SelectedNode.Tag);
+			}
+			UpdateValueTree();
+		}
+
+		private void btnDataDeleteAll_Click(object sender, EventArgs e) {
+			Value = null;
+			UpdateValueTree();
+		}
+
+		private void UpdateResourceStatus() {
+			MARCUpdate resource;
+			grpUpdateConflict.Visible = false;
+			grpUpdateExport.Visible = true;
+			txtUpdateLabel.Text = Functions.GetNameForLabel(Label);
+			UpdateSerial = checked((UInt32)MARCUpdate.DateTimeToUnix(DateTime.Now));
+			if (MainForm.Resources.TryGetValue(new MARCLabel(Label), out resource)) {
+				txtUpdateCurrentOwner.Text = Functions.bin2hex(resource.Key.Bytes);
+				txtUpdateCurrentTransfer.Text = resource.Transfer == null ? "None" : Functions.bin2hex(resource.Transfer.Value.Bytes);
+				txtUpdateCurrentSerial.Text = resource.Serial.ToString() + " (" + resource.UpdateTimestamp.ToShortDateString() + ")";
+				txtUpdateCurrentExpiration.Text = resource.Expiration == null ? "None" : resource.Expiration.Value.ToString() + " (" + resource.ExpirationTimestamp.ToShortDateString() + ")";
+				if (!resource.CanUpdate(MainForm.PublicKey)) {
+					txtUpdateCurrentStatus.Text = "Not available";
+					grpUpdateConflict.Visible = true;
+					grpUpdateExport.Visible = false;
+					return;
+				}
+				txtUpdateCurrentStatus.Text = "Registered";
+				if (UpdateSerial <= resource.Serial) UpdateSerial = resource.Serial + 1;
+				txtUpdateCurrentSize.Text = resource.UpdateMessage.Length.ToString();
+			} else {
+				txtUpdateCurrentOwner.Text = "None";
+				txtUpdateCurrentTransfer.Text = "None";
+				txtUpdateCurrentSerial.Text = String.Empty;
+				txtUpdateCurrentStatus.Text = "Free";
+				txtUpdateCurrentSize.Text = "N/A";
+			}
+			txtUpdateOwner.Text = MainForm.PublicKey.ToString();
+			dtpUpdateExpiration.Value = DateTime.Now.AddYears(1);
+			dtpUpdateExpiration.Checked = false;
+			chkUpdateTransferEnabled.Checked = false;
+		}
+
+		private void tabControl1_SelectedIndexChanged(object sender, EventArgs e) {
+			if (tabControl1.SelectedIndex == 0) {
+				if (Label != null && Label.Length > 0) {
+					switch (Label[0]) {
+						case 1: radTypeIPv4.Checked = true; break;
+						case 2: radTypeIPv6.Checked = true; break;
+						case 3: radTypeASNumber.Checked = true; break;
+						case 4: radTypeDomain.Checked = true; break;
+						default: radTypeOtherHex.Checked = true; break;
+					}
+				}
+				radType_CheckedChanged(sender, e);
+				txtLabelValue_TextChanged(sender, e);
+			} else if (Label == null || Label.Length == 0) {
+				MessageBox.Show("The selected label is not valid. Please correct the label and try again.", "MARC - Invalid label", MessageBoxButtons.OK, MessageBoxIcon.Error);
+				tabControl1.SelectedIndex = 0;
+			} else if (tabControl1.SelectedIndex == 1) {
+				UpdateValueTree();
+			} else if (tabControl1.SelectedIndex == 2) {
+				UpdateResourceStatus();
+			}
+		}
+
+		private void btnUpdateDelete_Click(object sender, EventArgs e) {
+			MARCLabel l = new MARCLabel(Label);
+			MainForm.ResourceHasChanged(null, MainForm.Resources[l]);
+			MainForm.Resources.Remove(l);
+			UpdateResourceStatus();
+		}
+
+		private void btnUpdateNow_Click(object sender, EventArgs e) {
+			UInt32? Expiration = null;
+			Byte[] Transfer = null;
+			if (dtpUpdateExpiration.Checked) {
+				DateTime epoch = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
+				Expiration = checked((UInt32)(dtpUpdateExpiration.Value.ToUniversalTime() - epoch).TotalSeconds);
+			}
+			if (chkUpdateTransferEnabled.Checked) {
+				Transfer = Functions.hex2bin(txtUpdateTransfer.Text);
+			}
+			MARCUpdate update = MARCUpdate.Create(MainForm.SecretKey, UpdateSerial, Label, Value, Expiration, Transfer);
+			txtUpdateCurrentSize.Text = update.UpdateMessage.Length.ToString() + " bytes";
+			MainForm.ReplaceOrAddResource(update);
+			MainForm.DatabaseSaved = false;
+			UpdateResourceStatus();
+		}
+	}
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ARClient/frmEditResource.resx	Sat Nov 08 22:43:51 2014 +0100
@@ -0,0 +1,123 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <data name="label9.Text" xml:space="preserve">
+    <value>You can not edit a resource that is owned by someone else and has not been released. You can delete the resource from the database, and then create a new one, but be aware that other nodes will probably not accept your update for this resource.</value>
+  </data>
+</root>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ARClient/frmSettings.Designer.cs	Sat Nov 08 22:43:51 2014 +0100
@@ -0,0 +1,719 @@
+namespace ARClient {
+	partial class frmSettings {
+		/// <summary>
+		/// Required designer variable.
+		/// </summary>
+		private System.ComponentModel.IContainer components = null;
+
+		/// <summary>
+		/// Clean up any resources being used.
+		/// </summary>
+		/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+		protected override void Dispose(bool disposing) {
+			if (disposing && (components != null)) {
+				components.Dispose();
+			}
+			base.Dispose(disposing);
+		}
+
+		#region Windows Form Designer generated code
+
+		/// <summary>
+		/// Required method for Designer support - do not modify
+		/// the contents of this method with the code editor.
+		/// </summary>
+		private void InitializeComponent() {
+			System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmSettings));
+			this.tabControl1 = new System.Windows.Forms.TabControl();
+			this.tabPage1 = new System.Windows.Forms.TabPage();
+			this.lstSyncPeers = new System.Windows.Forms.ListBox();
+			this.panel1 = new System.Windows.Forms.Panel();
+			this.btnPeerEdit = new System.Windows.Forms.Button();
+			this.btnPeerDelete = new System.Windows.Forms.Button();
+			this.btnPeerAdd = new System.Windows.Forms.Button();
+			this.tabPage2 = new System.Windows.Forms.TabPage();
+			this.label5 = new System.Windows.Forms.Label();
+			this.btnKeypairImport = new System.Windows.Forms.Button();
+			this.btnKeypairGenerate = new System.Windows.Forms.Button();
+			this.btnKeypairExport = new System.Windows.Forms.Button();
+			this.btnKeypairInput = new System.Windows.Forms.Button();
+			this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
+			this.txtSecretKey = new System.Windows.Forms.TextBox();
+			this.label2 = new System.Windows.Forms.Label();
+			this.label1 = new System.Windows.Forms.Label();
+			this.txtPublicKey = new System.Windows.Forms.TextBox();
+			this.tabPage3 = new System.Windows.Forms.TabPage();
+			this.label3 = new System.Windows.Forms.Label();
+			this.btnDatabaseCreate = new System.Windows.Forms.Button();
+			this.btnDatabaseSaveAs = new System.Windows.Forms.Button();
+			this.btnDatabaseOpen = new System.Windows.Forms.Button();
+			this.btnDatabaseSave = new System.Windows.Forms.Button();
+			this.btnDatabaseReload = new System.Windows.Forms.Button();
+			this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
+			this.label4 = new System.Windows.Forms.Label();
+			this.txtDatabase = new System.Windows.Forms.TextBox();
+			this.tabPage4 = new System.Windows.Forms.TabPage();
+			this.groupBox2 = new System.Windows.Forms.GroupBox();
+			this.lstFilterKey = new System.Windows.Forms.ListBox();
+			this.panel2 = new System.Windows.Forms.Panel();
+			this.btnFilterDeleteAllFiltered = new System.Windows.Forms.Button();
+			this.btnFilterKeyDelete = new System.Windows.Forms.Button();
+			this.btnFilterKeyAdd = new System.Windows.Forms.Button();
+			this.groupBox1 = new System.Windows.Forms.GroupBox();
+			this.chkFilterTypeKey = new System.Windows.Forms.CheckBox();
+			this.chkFilterTypeInvalid = new System.Windows.Forms.CheckBox();
+			this.chkFilterTypeOther = new System.Windows.Forms.CheckBox();
+			this.chkFilterTypeOtherDom = new System.Windows.Forms.CheckBox();
+			this.chkFilterTypeOtherIPv6 = new System.Windows.Forms.CheckBox();
+			this.chkFilterTypeOtherIPv4 = new System.Windows.Forms.CheckBox();
+			this.chkFilterTypeAnonetDom = new System.Windows.Forms.CheckBox();
+			this.chkFilterTypeASN = new System.Windows.Forms.CheckBox();
+			this.chkFilterTypeAnonetIPv6 = new System.Windows.Forms.CheckBox();
+			this.chkFilterTypeAnonetIPv4 = new System.Windows.Forms.CheckBox();
+			this.tabControl1.SuspendLayout();
+			this.tabPage1.SuspendLayout();
+			this.panel1.SuspendLayout();
+			this.tabPage2.SuspendLayout();
+			this.tableLayoutPanel1.SuspendLayout();
+			this.tabPage3.SuspendLayout();
+			this.tableLayoutPanel2.SuspendLayout();
+			this.tabPage4.SuspendLayout();
+			this.groupBox2.SuspendLayout();
+			this.panel2.SuspendLayout();
+			this.groupBox1.SuspendLayout();
+			this.SuspendLayout();
+			// 
+			// tabControl1
+			// 
+			this.tabControl1.Controls.Add(this.tabPage1);
+			this.tabControl1.Controls.Add(this.tabPage2);
+			this.tabControl1.Controls.Add(this.tabPage3);
+			this.tabControl1.Controls.Add(this.tabPage4);
+			this.tabControl1.Dock = System.Windows.Forms.DockStyle.Fill;
+			this.tabControl1.Location = new System.Drawing.Point(0, 0);
+			this.tabControl1.Name = "tabControl1";
+			this.tabControl1.SelectedIndex = 0;
+			this.tabControl1.Size = new System.Drawing.Size(551, 288);
+			this.tabControl1.TabIndex = 0;
+			// 
+			// tabPage1
+			// 
+			this.tabPage1.Controls.Add(this.lstSyncPeers);
+			this.tabPage1.Controls.Add(this.panel1);
+			this.tabPage1.Location = new System.Drawing.Point(4, 22);
+			this.tabPage1.Name = "tabPage1";
+			this.tabPage1.Padding = new System.Windows.Forms.Padding(3);
+			this.tabPage1.Size = new System.Drawing.Size(543, 262);
+			this.tabPage1.TabIndex = 0;
+			this.tabPage1.Text = "Synchronization";
+			this.tabPage1.UseVisualStyleBackColor = true;
+			// 
+			// lstSyncPeers
+			// 
+			this.lstSyncPeers.Dock = System.Windows.Forms.DockStyle.Fill;
+			this.lstSyncPeers.FormattingEnabled = true;
+			this.lstSyncPeers.Location = new System.Drawing.Point(3, 3);
+			this.lstSyncPeers.Name = "lstSyncPeers";
+			this.lstSyncPeers.Size = new System.Drawing.Size(537, 225);
+			this.lstSyncPeers.TabIndex = 0;
+			// 
+			// panel1
+			// 
+			this.panel1.AutoSize = true;
+			this.panel1.Controls.Add(this.btnPeerEdit);
+			this.panel1.Controls.Add(this.btnPeerDelete);
+			this.panel1.Controls.Add(this.btnPeerAdd);
+			this.panel1.Dock = System.Windows.Forms.DockStyle.Bottom;
+			this.panel1.Location = new System.Drawing.Point(3, 230);
+			this.panel1.Name = "panel1";
+			this.panel1.Size = new System.Drawing.Size(537, 29);
+			this.panel1.TabIndex = 1;
+			// 
+			// btnPeerEdit
+			// 
+			this.btnPeerEdit.Location = new System.Drawing.Point(165, 3);
+			this.btnPeerEdit.Name = "btnPeerEdit";
+			this.btnPeerEdit.Size = new System.Drawing.Size(75, 23);
+			this.btnPeerEdit.TabIndex = 2;
+			this.btnPeerEdit.Text = "Edit peer";
+			this.btnPeerEdit.UseVisualStyleBackColor = true;
+			this.btnPeerEdit.Click += new System.EventHandler(this.btnPeerEdit_Click);
+			// 
+			// btnPeerDelete
+			// 
+			this.btnPeerDelete.Location = new System.Drawing.Point(84, 3);
+			this.btnPeerDelete.Name = "btnPeerDelete";
+			this.btnPeerDelete.Size = new System.Drawing.Size(75, 23);
+			this.btnPeerDelete.TabIndex = 1;
+			this.btnPeerDelete.Text = "Delete peer";
+			this.btnPeerDelete.UseVisualStyleBackColor = true;
+			this.btnPeerDelete.Click += new System.EventHandler(this.btnPeerDelete_Click);
+			// 
+			// btnPeerAdd
+			// 
+			this.btnPeerAdd.Location = new System.Drawing.Point(3, 3);
+			this.btnPeerAdd.Name = "btnPeerAdd";
+			this.btnPeerAdd.Size = new System.Drawing.Size(75, 23);
+			this.btnPeerAdd.TabIndex = 0;
+			this.btnPeerAdd.Text = "Add peer";
+			this.btnPeerAdd.UseVisualStyleBackColor = true;
+			this.btnPeerAdd.Click += new System.EventHandler(this.btnPeerAdd_Click);
+			// 
+			// tabPage2
+			// 
+			this.tabPage2.Controls.Add(this.label5);
+			this.tabPage2.Controls.Add(this.btnKeypairImport);
+			this.tabPage2.Controls.Add(this.btnKeypairGenerate);
+			this.tabPage2.Controls.Add(this.btnKeypairExport);
+			this.tabPage2.Controls.Add(this.btnKeypairInput);
+			this.tabPage2.Controls.Add(this.tableLayoutPanel1);
+			this.tabPage2.Location = new System.Drawing.Point(4, 22);
+			this.tabPage2.Name = "tabPage2";
+			this.tabPage2.Padding = new System.Windows.Forms.Padding(3);
+			this.tabPage2.Size = new System.Drawing.Size(543, 262);
+			this.tabPage2.TabIndex = 1;
+			this.tabPage2.Text = "Key pair";
+			this.tabPage2.UseVisualStyleBackColor = true;
+			// 
+			// label5
+			// 
+			this.label5.Dock = System.Windows.Forms.DockStyle.Top;
+			this.label5.Location = new System.Drawing.Point(3, 147);
+			this.label5.Name = "label5";
+			this.label5.Size = new System.Drawing.Size(537, 66);
+			this.label5.TabIndex = 19;
+			this.label5.Text = "Note: Loss of your key pair will render you unable to update your resource claims" +
+				"! Make sure to backup at least your key file.";
+			// 
+			// btnKeypairImport
+			// 
+			this.btnKeypairImport.Dock = System.Windows.Forms.DockStyle.Top;
+			this.btnKeypairImport.Location = new System.Drawing.Point(3, 124);
+			this.btnKeypairImport.Name = "btnKeypairImport";
+			this.btnKeypairImport.Size = new System.Drawing.Size(537, 23);
+			this.btnKeypairImport.TabIndex = 11;
+			this.btnKeypairImport.Text = "Import key file";
+			this.btnKeypairImport.UseVisualStyleBackColor = true;
+			this.btnKeypairImport.Click += new System.EventHandler(this.btnKeypairImport_Click);
+			// 
+			// btnKeypairGenerate
+			// 
+			this.btnKeypairGenerate.Dock = System.Windows.Forms.DockStyle.Top;
+			this.btnKeypairGenerate.Location = new System.Drawing.Point(3, 101);
+			this.btnKeypairGenerate.Name = "btnKeypairGenerate";
+			this.btnKeypairGenerate.Size = new System.Drawing.Size(537, 23);
+			this.btnKeypairGenerate.TabIndex = 10;
+			this.btnKeypairGenerate.Text = "Generate key pair";
+			this.btnKeypairGenerate.UseVisualStyleBackColor = true;
+			this.btnKeypairGenerate.Click += new System.EventHandler(this.btnKeypairGenerate_Click);
+			// 
+			// btnKeypairExport
+			// 
+			this.btnKeypairExport.Dock = System.Windows.Forms.DockStyle.Top;
+			this.btnKeypairExport.Location = new System.Drawing.Point(3, 78);
+			this.btnKeypairExport.Name = "btnKeypairExport";
+			this.btnKeypairExport.Size = new System.Drawing.Size(537, 23);
+			this.btnKeypairExport.TabIndex = 9;
+			this.btnKeypairExport.Text = "Export key file";
+			this.btnKeypairExport.UseVisualStyleBackColor = true;
+			this.btnKeypairExport.Click += new System.EventHandler(this.btnKeypairExport_Click);
+			// 
+			// btnKeypairInput
+			// 
+			this.btnKeypairInput.Dock = System.Windows.Forms.DockStyle.Top;
+			this.btnKeypairInput.Location = new System.Drawing.Point(3, 55);
+			this.btnKeypairInput.Name = "btnKeypairInput";
+			this.btnKeypairInput.Size = new System.Drawing.Size(537, 23);
+			this.btnKeypairInput.TabIndex = 8;
+			this.btnKeypairInput.Text = "Input new key";
+			this.btnKeypairInput.UseVisualStyleBackColor = true;
+			this.btnKeypairInput.Click += new System.EventHandler(this.btnKeypairInput_Click);
+			// 
+			// tableLayoutPanel1
+			// 
+			this.tableLayoutPanel1.AutoSize = true;
+			this.tableLayoutPanel1.ColumnCount = 2;
+			this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 100F));
+			this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+			this.tableLayoutPanel1.Controls.Add(this.txtSecretKey, 1, 1);
+			this.tableLayoutPanel1.Controls.Add(this.label2, 0, 1);
+			this.tableLayoutPanel1.Controls.Add(this.label1, 0, 0);
+			this.tableLayoutPanel1.Controls.Add(this.txtPublicKey, 1, 0);
+			this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Top;
+			this.tableLayoutPanel1.Location = new System.Drawing.Point(3, 3);
+			this.tableLayoutPanel1.Name = "tableLayoutPanel1";
+			this.tableLayoutPanel1.RowCount = 2;
+			this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
+			this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
+			this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
+			this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
+			this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
+			this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
+			this.tableLayoutPanel1.Size = new System.Drawing.Size(537, 52);
+			this.tableLayoutPanel1.TabIndex = 0;
+			// 
+			// txtSecretKey
+			// 
+			this.txtSecretKey.Dock = System.Windows.Forms.DockStyle.Fill;
+			this.txtSecretKey.Location = new System.Drawing.Point(103, 29);
+			this.txtSecretKey.Name = "txtSecretKey";
+			this.txtSecretKey.ReadOnly = true;
+			this.txtSecretKey.Size = new System.Drawing.Size(431, 20);
+			this.txtSecretKey.TabIndex = 3;
+			// 
+			// label2
+			// 
+			this.label2.Anchor = System.Windows.Forms.AnchorStyles.Left;
+			this.label2.AutoSize = true;
+			this.label2.Location = new System.Drawing.Point(3, 32);
+			this.label2.Name = "label2";
+			this.label2.Size = new System.Drawing.Size(58, 13);
+			this.label2.TabIndex = 2;
+			this.label2.Text = "Secret key";
+			// 
+			// label1
+			// 
+			this.label1.Anchor = System.Windows.Forms.AnchorStyles.Left;
+			this.label1.AutoSize = true;
+			this.label1.Location = new System.Drawing.Point(3, 6);
+			this.label1.Name = "label1";
+			this.label1.Size = new System.Drawing.Size(56, 13);
+			this.label1.TabIndex = 0;
+			this.label1.Text = "Public key";
+			// 
+			// txtPublicKey
+			// 
+			this.txtPublicKey.Dock = System.Windows.Forms.DockStyle.Fill;
+			this.txtPublicKey.Location = new System.Drawing.Point(103, 3);
+			this.txtPublicKey.Name = "txtPublicKey";
+			this.txtPublicKey.ReadOnly = true;
+			this.txtPublicKey.Size = new System.Drawing.Size(431, 20);
+			this.txtPublicKey.TabIndex = 1;
+			// 
+			// tabPage3
+			// 
+			this.tabPage3.Controls.Add(this.label3);
+			this.tabPage3.Controls.Add(this.btnDatabaseCreate);
+			this.tabPage3.Controls.Add(this.btnDatabaseSaveAs);
+			this.tabPage3.Controls.Add(this.btnDatabaseOpen);
+			this.tabPage3.Controls.Add(this.btnDatabaseSave);
+			this.tabPage3.Controls.Add(this.btnDatabaseReload);
+			this.tabPage3.Controls.Add(this.tableLayoutPanel2);
+			this.tabPage3.Location = new System.Drawing.Point(4, 22);
+			this.tabPage3.Name = "tabPage3";
+			this.tabPage3.Size = new System.Drawing.Size(543, 262);
+			this.tabPage3.TabIndex = 2;
+			this.tabPage3.Text = "Local storage";
+			this.tabPage3.UseVisualStyleBackColor = true;
+			// 
+			// label3
+			// 
+			this.label3.Dock = System.Windows.Forms.DockStyle.Top;
+			this.label3.Location = new System.Drawing.Point(0, 141);
+			this.label3.Name = "label3";
+			this.label3.Size = new System.Drawing.Size(543, 66);
+			this.label3.TabIndex = 18;
+			this.label3.Text = resources.GetString("label3.Text");
+			// 
+			// btnDatabaseCreate
+			// 
+			this.btnDatabaseCreate.Dock = System.Windows.Forms.DockStyle.Top;
+			this.btnDatabaseCreate.Location = new System.Drawing.Point(0, 118);
+			this.btnDatabaseCreate.Name = "btnDatabaseCreate";
+			this.btnDatabaseCreate.Size = new System.Drawing.Size(543, 23);
+			this.btnDatabaseCreate.TabIndex = 17;
+			this.btnDatabaseCreate.Text = "Create new database";
+			this.btnDatabaseCreate.UseVisualStyleBackColor = true;
+			this.btnDatabaseCreate.Click += new System.EventHandler(this.btnDatabaseCreate_Click);
+			// 
+			// btnDatabaseSaveAs
+			// 
+			this.btnDatabaseSaveAs.Dock = System.Windows.Forms.DockStyle.Top;
+			this.btnDatabaseSaveAs.Location = new System.Drawing.Point(0, 95);
+			this.btnDatabaseSaveAs.Name = "btnDatabaseSaveAs";
+			this.btnDatabaseSaveAs.Size = new System.Drawing.Size(543, 23);
+			this.btnDatabaseSaveAs.TabIndex = 15;
+			this.btnDatabaseSaveAs.Text = "Save database as";
+			this.btnDatabaseSaveAs.UseVisualStyleBackColor = true;
+			this.btnDatabaseSaveAs.Click += new System.EventHandler(this.btnDatabaseSaveAs_Click);
+			// 
+			// btnDatabaseOpen
+			// 
+			this.btnDatabaseOpen.Dock = System.Windows.Forms.DockStyle.Top;
+			this.btnDatabaseOpen.Location = new System.Drawing.Point(0, 72);
+			this.btnDatabaseOpen.Name = "btnDatabaseOpen";
+			this.btnDatabaseOpen.Size = new System.Drawing.Size(543, 23);
+			this.btnDatabaseOpen.TabIndex = 14;
+			this.btnDatabaseOpen.Text = "Open different database";
+			this.btnDatabaseOpen.UseVisualStyleBackColor = true;
+			this.btnDatabaseOpen.Click += new System.EventHandler(this.btnDatabaseOpen_Click);
+			// 
+			// btnDatabaseSave
+			// 
+			this.btnDatabaseSave.Dock = System.Windows.Forms.DockStyle.Top;
+			this.btnDatabaseSave.Location = new System.Drawing.Point(0, 49);
+			this.btnDatabaseSave.Name = "btnDatabaseSave";
+			this.btnDatabaseSave.Size = new System.Drawing.Size(543, 23);
+			this.btnDatabaseSave.TabIndex = 13;
+			this.btnDatabaseSave.Text = "Save database";
+			this.btnDatabaseSave.UseVisualStyleBackColor = true;
+			this.btnDatabaseSave.Click += new System.EventHandler(this.btnDatabaseSave_Click);
+			// 
+			// btnDatabaseReload
+			// 
+			this.btnDatabaseReload.Dock = System.Windows.Forms.DockStyle.Top;
+			this.btnDatabaseReload.Location = new System.Drawing.Point(0, 26);
+			this.btnDatabaseReload.Name = "btnDatabaseReload";
+			this.btnDatabaseReload.Size = new System.Drawing.Size(543, 23);
+			this.btnDatabaseReload.TabIndex = 12;
+			this.btnDatabaseReload.Text = "Reload database";
+			this.btnDatabaseReload.UseVisualStyleBackColor = true;
+			this.btnDatabaseReload.Click += new System.EventHandler(this.btnDatabaseReload_Click);
+			// 
+			// tableLayoutPanel2
+			// 
+			this.tableLayoutPanel2.AutoSize = true;
+			this.tableLayoutPanel2.ColumnCount = 2;
+			this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 100F));
+			this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+			this.tableLayoutPanel2.Controls.Add(this.label4, 0, 0);
+			this.tableLayoutPanel2.Controls.Add(this.txtDatabase, 1, 0);
+			this.tableLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Top;
+			this.tableLayoutPanel2.Location = new System.Drawing.Point(0, 0);
+			this.tableLayoutPanel2.Name = "tableLayoutPanel2";
+			this.tableLayoutPanel2.RowCount = 1;
+			this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle());
+			this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 26F));
+			this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 26F));
+			this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 26F));
+			this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 26F));
+			this.tableLayoutPanel2.Size = new System.Drawing.Size(543, 26);
+			this.tableLayoutPanel2.TabIndex = 16;
+			// 
+			// label4
+			// 
+			this.label4.Anchor = System.Windows.Forms.AnchorStyles.Left;
+			this.label4.AutoSize = true;
+			this.label4.Location = new System.Drawing.Point(3, 6);
+			this.label4.Name = "label4";
+			this.label4.Size = new System.Drawing.Size(53, 13);
+			this.label4.TabIndex = 0;
+			this.label4.Text = "Database";
+			// 
+			// txtDatabase
+			// 
+			this.txtDatabase.Dock = System.Windows.Forms.DockStyle.Fill;
+			this.txtDatabase.Location = new System.Drawing.Point(103, 3);
+			this.txtDatabase.Name = "txtDatabase";
+			this.txtDatabase.ReadOnly = true;
+			this.txtDatabase.Size = new System.Drawing.Size(437, 20);
+			this.txtDatabase.TabIndex = 1;
+			// 
+			// tabPage4
+			// 
+			this.tabPage4.Controls.Add(this.groupBox2);
+			this.tabPage4.Controls.Add(this.groupBox1);
+			this.tabPage4.Location = new System.Drawing.Point(4, 22);
+			this.tabPage4.Name = "tabPage4";
+			this.tabPage4.Size = new System.Drawing.Size(543, 262);
+			this.tabPage4.TabIndex = 3;
+			this.tabPage4.Text = "Filters";
+			this.tabPage4.UseVisualStyleBackColor = true;
+			// 
+			// groupBox2
+			// 
+			this.groupBox2.Controls.Add(this.lstFilterKey);
+			this.groupBox2.Controls.Add(this.panel2);
+			this.groupBox2.Dock = System.Windows.Forms.DockStyle.Fill;
+			this.groupBox2.Location = new System.Drawing.Point(0, 64);
+			this.groupBox2.Name = "groupBox2";
+			this.groupBox2.Size = new System.Drawing.Size(543, 198);
+			this.groupBox2.TabIndex = 1;
+			this.groupBox2.TabStop = false;
+			this.groupBox2.Text = "Blocked keys";
+			// 
+			// lstFilterKey
+			// 
+			this.lstFilterKey.Dock = System.Windows.Forms.DockStyle.Fill;
+			this.lstFilterKey.FormattingEnabled = true;
+			this.lstFilterKey.Location = new System.Drawing.Point(3, 16);
+			this.lstFilterKey.Name = "lstFilterKey";
+			this.lstFilterKey.Size = new System.Drawing.Size(537, 147);
+			this.lstFilterKey.TabIndex = 2;
+			// 
+			// panel2
+			// 
+			this.panel2.AutoSize = true;
+			this.panel2.Controls.Add(this.btnFilterDeleteAllFiltered);
+			this.panel2.Controls.Add(this.btnFilterKeyDelete);
+			this.panel2.Controls.Add(this.btnFilterKeyAdd);
+			this.panel2.Dock = System.Windows.Forms.DockStyle.Bottom;
+			this.panel2.Location = new System.Drawing.Point(3, 166);
+			this.panel2.Name = "panel2";
+			this.panel2.Size = new System.Drawing.Size(537, 29);
+			this.panel2.TabIndex = 3;
+			// 
+			// btnFilterDeleteAllFiltered
+			// 
+			this.btnFilterDeleteAllFiltered.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
+			this.btnFilterDeleteAllFiltered.Location = new System.Drawing.Point(364, 3);
+			this.btnFilterDeleteAllFiltered.Name = "btnFilterDeleteAllFiltered";
+			this.btnFilterDeleteAllFiltered.Size = new System.Drawing.Size(170, 23);
+			this.btnFilterDeleteAllFiltered.TabIndex = 2;
+			this.btnFilterDeleteAllFiltered.Text = "Delete all filtered resources";
+			this.btnFilterDeleteAllFiltered.UseVisualStyleBackColor = true;
+			this.btnFilterDeleteAllFiltered.Click += new System.EventHandler(this.btnFilterDeleteAllFiltered_Click);
+			// 
+			// btnFilterKeyDelete
+			// 
+			this.btnFilterKeyDelete.Location = new System.Drawing.Point(84, 3);
+			this.btnFilterKeyDelete.Name = "btnFilterKeyDelete";
+			this.btnFilterKeyDelete.Size = new System.Drawing.Size(75, 23);
+			this.btnFilterKeyDelete.TabIndex = 1;
+			this.btnFilterKeyDelete.Text = "Delete key";
+			this.btnFilterKeyDelete.UseVisualStyleBackColor = true;
+			this.btnFilterKeyDelete.Click += new System.EventHandler(this.btnFilterKeyDelete_Click);
+			// 
+			// btnFilterKeyAdd
+			// 
+			this.btnFilterKeyAdd.Enabled = false;
+			this.btnFilterKeyAdd.Location = new System.Drawing.Point(3, 3);
+			this.btnFilterKeyAdd.Name = "btnFilterKeyAdd";
+			this.btnFilterKeyAdd.Size = new System.Drawing.Size(75, 23);
+			this.btnFilterKeyAdd.TabIndex = 0;
+			this.btnFilterKeyAdd.Text = "Add key";
+			this.btnFilterKeyAdd.UseVisualStyleBackColor = true;
+			// 
+			// groupBox1
+			// 
+			this.groupBox1.Controls.Add(this.chkFilterTypeKey);
+			this.groupBox1.Controls.Add(this.chkFilterTypeInvalid);
+			this.groupBox1.Controls.Add(this.chkFilterTypeOther);
+			this.groupBox1.Controls.Add(this.chkFilterTypeOtherDom);
+			this.groupBox1.Controls.Add(this.chkFilterTypeOtherIPv6);
+			this.groupBox1.Controls.Add(this.chkFilterTypeOtherIPv4);
+			this.groupBox1.Controls.Add(this.chkFilterTypeAnonetDom);
+			this.groupBox1.Controls.Add(this.chkFilterTypeASN);
+			this.groupBox1.Controls.Add(this.chkFilterTypeAnonetIPv6);
+			this.groupBox1.Controls.Add(this.chkFilterTypeAnonetIPv4);
+			this.groupBox1.Dock = System.Windows.Forms.DockStyle.Top;
+			this.groupBox1.Location = new System.Drawing.Point(0, 0);
+			this.groupBox1.Name = "groupBox1";
+			this.groupBox1.Size = new System.Drawing.Size(543, 64);
+			this.groupBox1.TabIndex = 0;
+			this.groupBox1.TabStop = false;
+			this.groupBox1.Text = "Resource types";
+			// 
+			// chkFilterTypeKey
+			// 
+			this.chkFilterTypeKey.AutoSize = true;
+			this.chkFilterTypeKey.Checked = true;
+			this.chkFilterTypeKey.CheckState = System.Windows.Forms.CheckState.Checked;
+			this.chkFilterTypeKey.Location = new System.Drawing.Point(188, 19);
+			this.chkFilterTypeKey.Name = "chkFilterTypeKey";
+			this.chkFilterTypeKey.Size = new System.Drawing.Size(64, 17);
+			this.chkFilterTypeKey.TabIndex = 9;
+			this.chkFilterTypeKey.Text = "Key info";
+			this.chkFilterTypeKey.UseVisualStyleBackColor = true;
+			// 
+			// chkFilterTypeInvalid
+			// 
+			this.chkFilterTypeInvalid.AutoSize = true;
+			this.chkFilterTypeInvalid.Checked = true;
+			this.chkFilterTypeInvalid.CheckState = System.Windows.Forms.CheckState.Checked;
+			this.chkFilterTypeInvalid.Location = new System.Drawing.Point(414, 19);
+			this.chkFilterTypeInvalid.Name = "chkFilterTypeInvalid";
+			this.chkFilterTypeInvalid.Size = new System.Drawing.Size(106, 17);
+			this.chkFilterTypeInvalid.TabIndex = 8;
+			this.chkFilterTypeInvalid.Text = "Invalid resources";
+			this.chkFilterTypeInvalid.UseVisualStyleBackColor = true;
+			this.chkFilterTypeInvalid.CheckedChanged += new System.EventHandler(this.chkFilterType_CheckedChanged);
+			// 
+			// chkFilterTypeOther
+			// 
+			this.chkFilterTypeOther.AutoSize = true;
+			this.chkFilterTypeOther.Checked = true;
+			this.chkFilterTypeOther.CheckState = System.Windows.Forms.CheckState.Checked;
+			this.chkFilterTypeOther.Location = new System.Drawing.Point(414, 42);
+			this.chkFilterTypeOther.Name = "chkFilterTypeOther";
+			this.chkFilterTypeOther.Size = new System.Drawing.Size(101, 17);
+			this.chkFilterTypeOther.TabIndex = 7;
+			this.chkFilterTypeOther.Text = "Other resources";
+			this.chkFilterTypeOther.UseVisualStyleBackColor = true;
+			this.chkFilterTypeOther.CheckedChanged += new System.EventHandler(this.chkFilterType_CheckedChanged);
+			// 
+			// chkFilterTypeOtherDom
+			// 
+			this.chkFilterTypeOtherDom.AutoSize = true;
+			this.chkFilterTypeOtherDom.Checked = true;
+			this.chkFilterTypeOtherDom.CheckState = System.Windows.Forms.CheckState.Checked;
+			this.chkFilterTypeOtherDom.Location = new System.Drawing.Point(277, 42);
+			this.chkFilterTypeOtherDom.Name = "chkFilterTypeOtherDom";
+			this.chkFilterTypeOtherDom.Size = new System.Drawing.Size(123, 17);
+			this.chkFilterTypeOtherDom.TabIndex = 6;
+			this.chkFilterTypeOtherDom.Text = "Other domain names";
+			this.chkFilterTypeOtherDom.UseVisualStyleBackColor = true;
+			this.chkFilterTypeOtherDom.CheckedChanged += new System.EventHandler(this.chkFilterType_CheckedChanged);
+			// 
+			// chkFilterTypeOtherIPv6
+			// 
+			this.chkFilterTypeOtherIPv6.AutoSize = true;
+			this.chkFilterTypeOtherIPv6.Checked = true;
+			this.chkFilterTypeOtherIPv6.CheckState = System.Windows.Forms.CheckState.Checked;
+			this.chkFilterTypeOtherIPv6.Location = new System.Drawing.Point(97, 42);
+			this.chkFilterTypeOtherIPv6.Name = "chkFilterTypeOtherIPv6";
+			this.chkFilterTypeOtherIPv6.Size = new System.Drawing.Size(77, 17);
+			this.chkFilterTypeOtherIPv6.TabIndex = 5;
+			this.chkFilterTypeOtherIPv6.Text = "Other IPv6";
+			this.chkFilterTypeOtherIPv6.UseVisualStyleBackColor = true;
+			this.chkFilterTypeOtherIPv6.CheckedChanged += new System.EventHandler(this.chkFilterType_CheckedChanged);
+			// 
+			// chkFilterTypeOtherIPv4
+			// 
+			this.chkFilterTypeOtherIPv4.AutoSize = true;
+			this.chkFilterTypeOtherIPv4.Checked = true;
+			this.chkFilterTypeOtherIPv4.CheckState = System.Windows.Forms.CheckState.Checked;
+			this.chkFilterTypeOtherIPv4.Location = new System.Drawing.Point(6, 42);
+			this.chkFilterTypeOtherIPv4.Name = "chkFilterTypeOtherIPv4";
+			this.chkFilterTypeOtherIPv4.Size = new System.Drawing.Size(77, 17);
+			this.chkFilterTypeOtherIPv4.TabIndex = 4;
+			this.chkFilterTypeOtherIPv4.Text = "Other IPv4";
+			this.chkFilterTypeOtherIPv4.UseVisualStyleBackColor = true;
+			this.chkFilterTypeOtherIPv4.CheckedChanged += new System.EventHandler(this.chkFilterType_CheckedChanged);
+			// 
+			// chkFilterTypeAnonetDom
+			// 
+			this.chkFilterTypeAnonetDom.AutoSize = true;
+			this.chkFilterTypeAnonetDom.Checked = true;
+			this.chkFilterTypeAnonetDom.CheckState = System.Windows.Forms.CheckState.Checked;
+			this.chkFilterTypeAnonetDom.Location = new System.Drawing.Point(277, 19);
+			this.chkFilterTypeAnonetDom.Name = "chkFilterTypeAnonetDom";
+			this.chkFilterTypeAnonetDom.Size = new System.Drawing.Size(131, 17);
+			this.chkFilterTypeAnonetDom.TabIndex = 3;
+			this.chkFilterTypeAnonetDom.Text = "Anonet domain names";
+			this.chkFilterTypeAnonetDom.UseVisualStyleBackColor = true;
+			this.chkFilterTypeAnonetDom.CheckedChanged += new System.EventHandler(this.chkFilterType_CheckedChanged);
+			// 
+			// chkFilterTypeASN
+			// 
+			this.chkFilterTypeASN.AutoSize = true;
+			this.chkFilterTypeASN.Checked = true;
+			this.chkFilterTypeASN.CheckState = System.Windows.Forms.CheckState.Checked;
+			this.chkFilterTypeASN.Location = new System.Drawing.Point(188, 42);
+			this.chkFilterTypeASN.Name = "chkFilterTypeASN";
+			this.chkFilterTypeASN.Size = new System.Drawing.Size(83, 17);
+			this.chkFilterTypeASN.TabIndex = 2;
+			this.chkFilterTypeASN.Text = "AS numbers";
+			this.chkFilterTypeASN.UseVisualStyleBackColor = true;
+			this.chkFilterTypeASN.CheckedChanged += new System.EventHandler(this.chkFilterType_CheckedChanged);
+			// 
+			// chkFilterTypeAnonetIPv6
+			// 
+			this.chkFilterTypeAnonetIPv6.AutoSize = true;
+			this.chkFilterTypeAnonetIPv6.Checked = true;
+			this.chkFilterTypeAnonetIPv6.CheckState = System.Windows.Forms.CheckState.Checked;
+			this.chkFilterTypeAnonetIPv6.Location = new System.Drawing.Point(97, 19);
+			this.chkFilterTypeAnonetIPv6.Name = "chkFilterTypeAnonetIPv6";
+			this.chkFilterTypeAnonetIPv6.Size = new System.Drawing.Size(85, 17);
+			this.chkFilterTypeAnonetIPv6.TabIndex = 1;
+			this.chkFilterTypeAnonetIPv6.Text = "Anonet IPv6";
+			this.chkFilterTypeAnonetIPv6.UseVisualStyleBackColor = true;
+			this.chkFilterTypeAnonetIPv6.CheckedChanged += new System.EventHandler(this.chkFilterType_CheckedChanged);
+			// 
+			// chkFilterTypeAnonetIPv4
+			// 
+			this.chkFilterTypeAnonetIPv4.AutoSize = true;
+			this.chkFilterTypeAnonetIPv4.Checked = true;
+			this.chkFilterTypeAnonetIPv4.CheckState = System.Windows.Forms.CheckState.Checked;
+			this.chkFilterTypeAnonetIPv4.Location = new System.Drawing.Point(6, 19);
+			this.chkFilterTypeAnonetIPv4.Name = "chkFilterTypeAnonetIPv4";
+			this.chkFilterTypeAnonetIPv4.Size = new System.Drawing.Size(85, 17);
+			this.chkFilterTypeAnonetIPv4.TabIndex = 0;
+			this.chkFilterTypeAnonetIPv4.Text = "Anonet IPv4";
+			this.chkFilterTypeAnonetIPv4.UseVisualStyleBackColor = true;
+			this.chkFilterTypeAnonetIPv4.CheckedChanged += new System.EventHandler(this.chkFilterType_CheckedChanged);
+			// 
+			// frmSettings
+			// 
+			this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+			this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+			this.ClientSize = new System.Drawing.Size(551, 288);
+			this.Controls.Add(this.tabControl1);
+			this.Name = "frmSettings";
+			this.ShowInTaskbar = false;
+			this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
+			this.Text = "MARC Resource Manager settings";
+			this.Load += new System.EventHandler(this.frmSettings_Load);
+			this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.frmSettings_FormClosed);
+			this.tabControl1.ResumeLayout(false);
+			this.tabPage1.ResumeLayout(false);
+			this.tabPage1.PerformLayout();
+			this.panel1.ResumeLayout(false);
+			this.tabPage2.ResumeLayout(false);
+			this.tabPage2.PerformLayout();
+			this.tableLayoutPanel1.ResumeLayout(false);
+			this.tableLayoutPanel1.PerformLayout();
+			this.tabPage3.ResumeLayout(false);
+			this.tabPage3.PerformLayout();
+			this.tableLayoutPanel2.ResumeLayout(false);
+			this.tableLayoutPanel2.PerformLayout();
+			this.tabPage4.ResumeLayout(false);
+			this.groupBox2.ResumeLayout(false);
+			this.groupBox2.PerformLayout();
+			this.panel2.ResumeLayout(false);
+			this.groupBox1.ResumeLayout(false);
+			this.groupBox1.PerformLayout();
+			this.ResumeLayout(false);
+
+		}
+
+		#endregion
+
+		private System.Windows.Forms.TabControl tabControl1;
+		private System.Windows.Forms.TabPage tabPage1;
+		private System.Windows.Forms.ListBox lstSyncPeers;
+		private System.Windows.Forms.Panel panel1;
+		private System.Windows.Forms.Button btnPeerEdit;
+		private System.Windows.Forms.Button btnPeerDelete;
+		private System.Windows.Forms.Button btnPeerAdd;
+		private System.Windows.Forms.TabPage tabPage2;
+		private System.Windows.Forms.TabPage tabPage3;
+		private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
+		private System.Windows.Forms.TextBox txtSecretKey;
+		private System.Windows.Forms.Label label2;
+		private System.Windows.Forms.Label label1;
+		private System.Windows.Forms.TextBox txtPublicKey;
+		private System.Windows.Forms.Button btnKeypairImport;
+		private System.Windows.Forms.Button btnKeypairGenerate;
+		private System.Windows.Forms.Button btnKeypairExport;
+		private System.Windows.Forms.Button btnKeypairInput;
+		private System.Windows.Forms.Button btnDatabaseCreate;
+		private System.Windows.Forms.Button btnDatabaseSaveAs;
+		private System.Windows.Forms.Button btnDatabaseOpen;
+		private System.Windows.Forms.Button btnDatabaseSave;
+		private System.Windows.Forms.Button btnDatabaseReload;
+		private System.Windows.Forms.TableLayoutPanel tableLayoutPanel2;
+		private System.Windows.Forms.Label label4;
+		private System.Windows.Forms.TextBox txtDatabase;
+		private System.Windows.Forms.Label label3;
+		private System.Windows.Forms.Label label5;
+		private System.Windows.Forms.TabPage tabPage4;
+		private System.Windows.Forms.GroupBox groupBox1;
+		private System.Windows.Forms.CheckBox chkFilterTypeOther;
+		private System.Windows.Forms.CheckBox chkFilterTypeOtherDom;
+		private System.Windows.Forms.CheckBox chkFilterTypeOtherIPv6;
+		private System.Windows.Forms.CheckBox chkFilterTypeOtherIPv4;
+		private System.Windows.Forms.CheckBox chkFilterTypeAnonetDom;
+		private System.Windows.Forms.CheckBox chkFilterTypeASN;
+		private System.Windows.Forms.CheckBox chkFilterTypeAnonetIPv6;
+		private System.Windows.Forms.CheckBox chkFilterTypeAnonetIPv4;
+		private System.Windows.Forms.GroupBox groupBox2;
+		private System.Windows.Forms.ListBox lstFilterKey;
+		private System.Windows.Forms.Panel panel2;
+		private System.Windows.Forms.Button btnFilterKeyDelete;
+		private System.Windows.Forms.Button btnFilterKeyAdd;
+		private System.Windows.Forms.Button btnFilterDeleteAllFiltered;
+		private System.Windows.Forms.CheckBox chkFilterTypeInvalid;
+		private System.Windows.Forms.CheckBox chkFilterTypeKey;
+	}
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ARClient/frmSettings.cs	Sat Nov 08 22:43:51 2014 +0100
@@ -0,0 +1,210 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Windows.Forms;
+
+namespace ARClient {
+	partial class frmSettings : Form {
+		public Form1 MainForm { get; set; }
+		Boolean Loading = false;
+		public frmSettings() {
+			InitializeComponent();
+		}
+
+		private void frmSettings_Load(object sender, EventArgs e) {
+			Import();
+		}
+		private void Import() {
+			Loading = true;
+			txtPublicKey.Text = MainForm.PublicKey.ToString();
+			txtSecretKey.Text = Functions.bin2hex(MainForm.SecretKey.SecretKey);
+			txtDatabase.Text = MainForm.Database;
+			lstSyncPeers.Items.Clear();
+			foreach (String peer in MainForm.Peers) lstSyncPeers.Items.Add(peer);
+			foreach (MARCKey peer in MainForm.BlockedKeys) lstFilterKey.Items.Add(peer);
+			chkFilterTypeAnonetDom.Checked = 0 != (MainForm.FilterFlags & Form1.ResourceTypeFilter.AnonetDomain);
+			chkFilterTypeAnonetIPv4.Checked = 0 != (MainForm.FilterFlags & Form1.ResourceTypeFilter.AnonetIPv4);
+			chkFilterTypeAnonetIPv6.Checked = 0 != (MainForm.FilterFlags & Form1.ResourceTypeFilter.AnonetIPv6);
+			chkFilterTypeASN.Checked = 0 != (MainForm.FilterFlags & Form1.ResourceTypeFilter.ASNumber);
+			chkFilterTypeInvalid.Checked = 0 != (MainForm.FilterFlags & Form1.ResourceTypeFilter.Invalid);
+			chkFilterTypeOther.Checked = 0 != (MainForm.FilterFlags & Form1.ResourceTypeFilter.Other);
+			chkFilterTypeOtherDom.Checked = 0 != (MainForm.FilterFlags & Form1.ResourceTypeFilter.OtherDomain);
+			chkFilterTypeOtherIPv4.Checked = 0 != (MainForm.FilterFlags & Form1.ResourceTypeFilter.OtherIPv4);
+			chkFilterTypeOtherIPv6.Checked = 0 != (MainForm.FilterFlags & Form1.ResourceTypeFilter.OtherIPv6);
+			chkFilterTypeKey.Checked = 0 != (MainForm.FilterFlags & Form1.ResourceTypeFilter.Key);
+			Loading = false;
+		}
+
+		private void btnDatabaseReload_Click(object sender, EventArgs e) {
+			MainForm.reloadDatabaseToolStripMenuItem_Click(sender, e);
+			Import();
+		}
+		private void btnDatabaseSave_Click(object sender, EventArgs e) {
+			MainForm.saveDatabaseToolStripMenuItem_Click(sender, e);
+			Import();
+		}
+		private void btnDatabaseOpen_Click(object sender, EventArgs e) {
+			MainForm.openDatabaseToolStripMenuItem_Click(sender, e);
+			Import();
+		}
+		private void btnDatabaseSaveAs_Click(object sender, EventArgs e) {
+			MainForm.saveDatabaseAsToolStripMenuItem_Click(sender, e);
+			Import();
+		}
+		private void btnDatabaseCreate_Click(object sender, EventArgs e) {
+			MainForm.newDatabaseToolStripMenuItem_Click(sender, e);
+			Import();
+		}
+
+		private void btnPeerAdd_Click(object sender, EventArgs e) {
+			frmTextInput input = new frmTextInput();
+			input.Text = "MARC - Synchronization peer";
+			input.Description = "Enter the HTTP address of the peer, including the protocol (http/https):";
+			input.Value = "http://";
+			if (input.ShowDialog(this) == DialogResult.Cancel) return;
+			MainForm.Peers.Add(input.Value);
+			lstSyncPeers.Items.Add(input.Value);
+			MainForm.DatabaseSaved = false;
+			MainForm.UpdatePeersList();
+		}
+		private void btnPeerDelete_Click(object sender, EventArgs e) {
+			if (lstSyncPeers.SelectedItem == null) return;
+			if (MainForm.Peers.Remove(lstSyncPeers.SelectedItem.ToString())) lstSyncPeers.Items.Remove(lstSyncPeers.SelectedItem);
+			MainForm.DatabaseSaved = false;
+			MainForm.UpdatePeersList();
+		}
+		private void btnPeerEdit_Click(object sender, EventArgs e) {
+			if (lstSyncPeers.SelectedItem == null) return;
+			frmTextInput input = new frmTextInput();
+			input.Text = "MARC - Synchronization peer";
+			input.Description = "Enter the HTTP address of the peer, including the protocol (http/https):";
+			input.Value = lstSyncPeers.SelectedItem.ToString();
+			if (input.ShowDialog(this) == DialogResult.Cancel) return;
+			if (MainForm.Peers.Remove(lstSyncPeers.SelectedItem.ToString())) lstSyncPeers.Items.Remove(lstSyncPeers.SelectedItem);
+			MainForm.Peers.Add(input.Value);
+			lstSyncPeers.Items.Add(input.Value);
+			MainForm.DatabaseSaved = false;
+			MainForm.UpdatePeersList();
+		}
+
+		private void btnKeypairGenerate_Click(object sender, EventArgs e) {
+			MainForm.GenerateKeyPair();
+			Import();
+		}
+
+		private void btnFilterKeyDelete_Click(object sender, EventArgs e) {
+			if (lstFilterKey.SelectedItem == null) return;
+			if (MainForm.BlockedKeys.Remove((MARCKey)lstFilterKey.SelectedItem)) lstFilterKey.Items.Remove(lstFilterKey.SelectedItem);
+			MainForm.DatabaseSaved = false;
+		}
+
+		private void chkFilterType_CheckedChanged(object sender, EventArgs e) {
+			if (Loading) return;
+			MainForm.FilterFlags =
+				(chkFilterTypeAnonetDom.Checked ? Form1.ResourceTypeFilter.AnonetDomain : 0) |
+				(chkFilterTypeAnonetIPv4.Checked ? Form1.ResourceTypeFilter.AnonetIPv4 : 0) |
+				(chkFilterTypeAnonetIPv6.Checked ? Form1.ResourceTypeFilter.AnonetIPv6 : 0) |
+				(chkFilterTypeASN.Checked ? Form1.ResourceTypeFilter.ASNumber : 0) |
+				(chkFilterTypeInvalid.Checked ? Form1.ResourceTypeFilter.Invalid : 0) |
+				(chkFilterTypeOther.Checked ? Form1.ResourceTypeFilter.Other : 0) |
+				(chkFilterTypeOtherDom.Checked ? Form1.ResourceTypeFilter.OtherDomain : 0) |
+				(chkFilterTypeOtherIPv4.Checked ? Form1.ResourceTypeFilter.OtherIPv4 : 0) |
+				(chkFilterTypeOtherIPv6.Checked ? Form1.ResourceTypeFilter.OtherIPv6 : 0) |
+				(chkFilterTypeKey.Checked ? Form1.ResourceTypeFilter.Key : 0) |
+				0;
+			MainForm.DatabaseSaved = false;
+		}
+
+		private void btnKeypairExport_Click(object sender, EventArgs e) {
+			SaveFileDialog dialog = new SaveFileDialog();
+			dialog.OverwritePrompt = true;
+			dialog.Title = "MARC - Save key pair";
+			dialog.AddExtension = true;
+			dialog.CheckPathExists = true;
+			dialog.DefaultExt = "mkp";
+			dialog.DereferenceLinks = true;
+			dialog.Filter = "Keypair files (*.mkp)|*.mkp|All files (*.*)|*.*";
+			dialog.InitialDirectory = MainForm.Database == null ? Environment.CurrentDirectory : Path.GetDirectoryName(MainForm.Database);
+			dialog.SupportMultiDottedExtensions = true;
+			dialog.ValidateNames = true;
+			if (dialog.ShowDialog(this) != DialogResult.OK) return;
+			using (Stream stream = dialog.OpenFile()) {
+				stream.SetLength(0);
+				stream.Write(MainForm.SecretKey.ExpandedKey, 0, 64);
+			}
+		}
+
+		private void btnKeypairImport_Click(object sender, EventArgs e) {
+			OpenFileDialog dialog = new OpenFileDialog();
+			dialog.CheckFileExists = true;
+			dialog.Title = "MARC - Load key pair";
+			dialog.AddExtension = true;
+			dialog.CheckPathExists = true;
+			dialog.DefaultExt = "mkp";
+			dialog.DereferenceLinks = true;
+			dialog.Filter = "Keypair files (*.mkp)|*.mkp|All files (*.*)|*.*";
+			dialog.InitialDirectory = MainForm.Database == null ? Environment.CurrentDirectory : Path.GetDirectoryName(MainForm.Database);
+			dialog.SupportMultiDottedExtensions = true;
+			dialog.ValidateNames = true;
+			if (dialog.ShowDialog(this) != DialogResult.OK) return;
+			if (DialogResult.Yes != MessageBox.Show(this, "Importing a new key pair will erase your old key pair from the local database. If you lose your key you will no longer be able to update your resource claims. Please make sure that you either have a backup of your key, or have no claims! Do you want to continue?", "MARC - Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation)) {
+				return;
+			}
+			if (DialogResult.Yes != MessageBox.Show(this, "Are you really sure you want to overwrite your key? There is no way back! Did you make a backup?", "MARC - Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation)) {
+				return;
+			}
+			using (Stream stream = dialog.OpenFile()) {
+				Byte[] sk = new Byte[32];
+				if (stream.Read(sk, 0, sk.Length) != sk.Length) return;
+				MainForm.SecretKey = new UCIS.NaCl.v2.ed25519keypair(sk);
+				MainForm.PublicKey = new MARCKey(MainForm.SecretKey.PublicKey);
+				MainForm.DatabaseSaved = false;
+				Import();
+			}
+		}
+
+		private void frmSettings_FormClosed(object sender, FormClosedEventArgs e) {
+			MainForm.RefreshResourceList();
+		}
+
+		private void btnKeypairInput_Click(object sender, EventArgs e) {
+			frmTextInput form = new frmTextInput();
+			form.Text = "MARC - Key pair input";
+			form.Description = "Input your new secret key:";
+			form.Value = Functions.bin2hex(MainForm.SecretKey.SecretKey);
+			if (form.ShowDialog(this) != DialogResult.OK) return;
+			Byte[] sk = Functions.hex2bin(form.Value);
+			if (sk.Length != 32 && sk.Length != 64) return;
+			if (DialogResult.Yes != MessageBox.Show(this, "Importing a new key pair will erase your old key pair from the local database. If you lose your key you will no longer be able to update your resource claims. Please make sure that you either have a backup of your key, or have no claims! Do you want to continue?", "MARC - Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation)) {
+				return;
+			}
+			if (DialogResult.Yes != MessageBox.Show(this, "Are you really sure you want to overwrite your key? There is no way back! Did you make a backup?", "MARC - Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation)) {
+				return;
+			}
+			MainForm.SecretKey = new UCIS.NaCl.v2.ed25519keypair(sk);
+			MainForm.PublicKey = new MARCKey(MainForm.SecretKey.PublicKey);
+			MainForm.DatabaseSaved = false;
+			Import();
+		}
+
+		private void btnFilterDeleteAllFiltered_Click(object sender, EventArgs e) {
+			List<MARCUpdate> ToDelete = new List<MARCUpdate>();
+			foreach (MARCUpdate update in MainForm.Resources.Values) {
+				if (MainForm.IsResourceFiltered(update)) ToDelete.Add(update);
+			}
+			if (ToDelete.Count == 0) return;
+			if (DialogResult.Yes != MessageBox.Show(this, "Are you really sure you want to delete " + ToDelete.Count.ToString() + " filtred resources?", "MARC - Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation)) {
+				return;
+			}
+			MainForm.lstResources.BeginUpdate();
+			MainForm.lstResources.Sorted = false;
+			foreach (MARCUpdate item in ToDelete) {
+				MainForm.Resources.Remove(item.Label);
+				MainForm.ResourceHasChanged(null, item);
+			}
+			MainForm.lstResources.Sorted = true;
+			MainForm.lstResources.EndUpdate();
+			MainForm.DatabaseSaved = false;
+		}
+	}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ARClient/frmSettings.resx	Sat Nov 08 22:43:51 2014 +0100
@@ -0,0 +1,123 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <data name="label3.Text" xml:space="preserve">
+    <value>Note: the database contains your key pair, synchronization settings and resource database. Removing or overwriting it will result in loss of your key pair and will render you unable to update your resource claims! Make sure to backup at least your key file.</value>
+  </data>
+</root>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ARClient/frmSync.Designer.cs	Sat Nov 08 22:43:51 2014 +0100
@@ -0,0 +1,107 @@
+namespace ARClient {
+	partial class frmSync {
+		/// <summary>
+		/// Required designer variable.
+		/// </summary>
+		private System.ComponentModel.IContainer components = null;
+
+		/// <summary>
+		/// Clean up any resources being used.
+		/// </summary>
+		/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+		protected override void Dispose(bool disposing) {
+			if (disposing && (components != null)) {
+				components.Dispose();
+			}
+			base.Dispose(disposing);
+		}
+
+		#region Windows Form Designer generated code
+
+		/// <summary>
+		/// Required method for Designer support - do not modify
+		/// the contents of this method with the code editor.
+		/// </summary>
+		private void InitializeComponent() {
+			this.lblActivity = new System.Windows.Forms.Label();
+			this.backgroundWorker1 = new System.ComponentModel.BackgroundWorker();
+			this.button1 = new System.Windows.Forms.Button();
+			this.lblAddress = new System.Windows.Forms.Label();
+			this.lblTotal = new System.Windows.Forms.Label();
+			this.SuspendLayout();
+			// 
+			// lblActivity
+			// 
+			this.lblActivity.AutoSize = true;
+			this.lblActivity.Location = new System.Drawing.Point(12, 22);
+			this.lblActivity.Name = "lblActivity";
+			this.lblActivity.Size = new System.Drawing.Size(39, 13);
+			this.lblActivity.TabIndex = 0;
+			this.lblActivity.Text = "Busy...";
+			// 
+			// backgroundWorker1
+			// 
+			this.backgroundWorker1.WorkerReportsProgress = true;
+			this.backgroundWorker1.WorkerSupportsCancellation = true;
+			this.backgroundWorker1.DoWork += new System.ComponentModel.DoWorkEventHandler(this.backgroundWorker1_DoWork);
+			this.backgroundWorker1.RunWorkerCompleted += new System.ComponentModel.RunWorkerCompletedEventHandler(this.backgroundWorker1_RunWorkerCompleted);
+			this.backgroundWorker1.ProgressChanged += new System.ComponentModel.ProgressChangedEventHandler(this.backgroundWorker1_ProgressChanged);
+			// 
+			// button1
+			// 
+			this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
+			this.button1.Location = new System.Drawing.Point(342, 59);
+			this.button1.Name = "button1";
+			this.button1.Size = new System.Drawing.Size(75, 23);
+			this.button1.TabIndex = 1;
+			this.button1.Text = "Cancel";
+			this.button1.UseVisualStyleBackColor = true;
+			this.button1.Click += new System.EventHandler(this.button1_Click);
+			// 
+			// lblAddress
+			// 
+			this.lblAddress.AutoSize = true;
+			this.lblAddress.Location = new System.Drawing.Point(12, 9);
+			this.lblAddress.Name = "lblAddress";
+			this.lblAddress.Size = new System.Drawing.Size(45, 13);
+			this.lblAddress.TabIndex = 2;
+			this.lblAddress.Text = "Address";
+			// 
+			// lblTotal
+			// 
+			this.lblTotal.AutoSize = true;
+			this.lblTotal.Location = new System.Drawing.Point(12, 35);
+			this.lblTotal.Name = "lblTotal";
+			this.lblTotal.Size = new System.Drawing.Size(31, 13);
+			this.lblTotal.TabIndex = 3;
+			this.lblTotal.Text = "Total";
+			// 
+			// frmSync
+			// 
+			this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+			this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+			this.ClientSize = new System.Drawing.Size(429, 94);
+			this.Controls.Add(this.lblTotal);
+			this.Controls.Add(this.lblAddress);
+			this.Controls.Add(this.button1);
+			this.Controls.Add(this.lblActivity);
+			this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
+			this.Name = "frmSync";
+			this.Text = "MARC Resource Manager synchronization";
+			this.Load += new System.EventHandler(this.frmSync_Load);
+			this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.frmSync_FormClosed);
+			this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.frmSync_FormClosing);
+			this.ResumeLayout(false);
+			this.PerformLayout();
+
+		}
+
+		#endregion
+
+		private System.Windows.Forms.Label lblActivity;
+		private System.ComponentModel.BackgroundWorker backgroundWorker1;
+		private System.Windows.Forms.Button button1;
+		private System.Windows.Forms.Label lblAddress;
+		private System.Windows.Forms.Label lblTotal;
+	}
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ARClient/frmSync.cs	Sat Nov 08 22:43:51 2014 +0100
@@ -0,0 +1,168 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.IO;
+using System.Net;
+using System.Net.Cache;
+using System.Windows.Forms;
+
+namespace ARClient {
+	partial class frmSync : Form {
+		public Form1 MainForm { get; set; }
+		public IEnumerable<String> Hosts { get; set; }
+		private int Received = 0, Imported = 0, Exported = 0;
+		private int TotalReceived = 0, TotalImported = 0, TotalExported = 0;
+		private int BytesReceived = 0, BytesSent = 0;
+		private int TotalBytesReceived = 0, TotalBytesSent = 0;
+
+		public frmSync() {
+			InitializeComponent();
+		}
+
+		private Byte[] RealRead(Stream from, int count, Boolean throweof) {
+			Byte[] ret = new Byte[count];
+			int offset = 0;
+			while (count > 0) {
+				int got = from.Read(ret, offset, count);
+				if (backgroundWorker1.CancellationPending) break;
+				if (got == 0 && offset == 0) {
+					if (throweof) throw new EndOfStreamException();
+					return null;
+				} else if (got <= 0) {
+					throw new EndOfStreamException();
+				}
+				count -= got;
+				offset += got;
+			}
+			return ret;
+		}
+
+		private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e) {
+			foreach (String Host in Hosts) {
+				Received = Imported = Exported = BytesSent = BytesReceived = 0;
+				if (backgroundWorker1.CancellationPending) break;
+				String url = Host;
+				int method = 3;
+				if (Host.StartsWith("get:", StringComparison.InvariantCultureIgnoreCase)) {
+					url = Host.Substring(4);
+					method = 1;
+				} else if (Host.StartsWith("post:", StringComparison.InvariantCultureIgnoreCase)) {
+					url = Host.Substring(5);
+					method = 2;
+				} else if (Host.StartsWith("put:", StringComparison.InvariantCultureIgnoreCase)) {
+					url = Host.Substring(3);
+					method = 3;
+				}
+				try {
+					backgroundWorker1.ReportProgress(0, "Preparing...");
+					backgroundWorker1.ReportProgress(1, Host);
+					if (method != 1 && method != 3) throw new NotImplementedException("The requested method is not implemented");
+					String args = String.Format("version={0}&random={1}&get={2}", 3, (new Random()).Next(), 0);
+					url += (url.Contains("?") ? "&" : "?") + args;
+					WebRequest request = WebRequest.Create(url);
+					try { request.CachePolicy = new RequestCachePolicy(RequestCacheLevel.BypassCache); } catch { }
+					if (method == 3) {
+						request.Method = "PUT";
+					} else {
+						request.Method = "GET";
+					}
+					request.Timeout = 30000;
+					backgroundWorker1.ReportProgress(0, "Preparing data...");
+					if (method == 3) {
+						using (Stream stream = request.GetRequestStream()) {
+							foreach (MARCUpdate update in MainForm.Resources.Values) {
+								if (update.UpdateMessage == null) continue;
+								stream.Write(Functions.EncodeInt32BigEndian((UInt32)update.UpdateMessage.Length), 0, 4);
+								stream.Write(update.UpdateMessage, 0, update.UpdateMessage.Length);
+								BytesSent += 4 + update.UpdateMessage.Length; TotalBytesSent += 4 + update.UpdateMessage.Length;
+								Exported++; TotalExported++;
+							}
+						}
+					}
+					backgroundWorker1.ReportProgress(0, "Exchanging data...");
+					using (WebResponse response = request.GetResponse()) {
+						backgroundWorker1.ReportProgress(0, "Receiving response...");
+						using (Stream stream = response.GetResponseStream()) {
+							Byte version = (Byte)stream.ReadByte();
+							if (version != 3) throw new Exception("Unsupported server version " + version.ToString());
+							BytesReceived++; TotalBytesReceived++;
+							for (int numext = stream.ReadByte(); numext > 0; numext--) {
+								Byte[] buffer = RealRead(stream, 3, true);
+								Byte extid = buffer[0];
+								UInt16 extlen = Functions.DecodeInt16BigEndian(buffer, 1);
+								RealRead(stream, extlen, false);
+								BytesReceived += 3 + extlen; TotalBytesReceived += 3 + extlen;
+							}
+							while (!backgroundWorker1.CancellationPending) {
+								Byte[] buffer = RealRead(stream, 4, false);
+								if (buffer == null) break;
+								if (backgroundWorker1.CancellationPending) break;
+								int len = (int)Functions.DecodeInt32BigEndian(buffer, 0);
+								buffer = RealRead(stream, len, true);
+								if (backgroundWorker1.CancellationPending) break;
+								BytesReceived += len + 4; TotalBytesReceived += len + 4;
+								Received++; TotalReceived++;
+								try {
+									if (MainForm.ImportUpdate(buffer, false)) { Imported++; TotalImported++; }
+								} catch (Exception ex) {
+									Console.Error.WriteLine(ex.ToString());
+								}
+								backgroundWorker1.ReportProgress(0, null);
+							}
+						}
+					}
+				} catch (Exception ex) {
+					Console.Error.WriteLine(ex.ToString());
+					backgroundWorker1.ReportProgress(0, ex);
+				}
+			}
+		}
+
+		private void button1_Click(object sender, EventArgs e) {
+			if (backgroundWorker1.IsBusy) {
+				lblActivity.Text = "Aborting...";
+				backgroundWorker1.CancelAsync();
+			} else {
+				Close();
+			}
+		}
+
+		private void frmSync_FormClosing(object sender, FormClosingEventArgs e) {
+			if (backgroundWorker1.IsBusy) {
+				e.Cancel = true;
+				lblActivity.Text = "Aborting...";
+				backgroundWorker1.CancelAsync();
+			}
+		}
+
+		private void frmSync_FormClosed(object sender, FormClosedEventArgs e) {
+			MainForm.lstResources.Sorted = true;
+			MainForm.lstResources.EndUpdate();
+		}
+
+		private void backgroundWorker1_ProgressChanged(object sender, ProgressChangedEventArgs e) {
+			if (e.ProgressPercentage == 1) {
+				lblAddress.Text = (String)e.UserState;
+			} else if (e.UserState is Exception) {
+				MessageBox.Show(this, "Error: " + ((Exception)e.UserState).Message, "MARC - Synchronization error", MessageBoxButtons.OK, MessageBoxIcon.Error);
+			} else if (e.UserState is String) {
+				lblActivity.Text = (String)e.UserState;
+			} else {
+				lblActivity.Text = String.Format("Busy, exported {0}, received {1}, imported {2}, sent {3} kB, received {4} kB...", Exported, Received, Imported, BytesSent / 1000, BytesReceived / 1000);
+				lblTotal.Text = String.Format("Total exported {0}, received {1}, imported {2}, sent {3} kB, received {4} kB...", TotalExported, TotalReceived, TotalImported, TotalBytesSent / 1000, TotalBytesReceived / 1000);
+			}
+		}
+
+		private void backgroundWorker1_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) {
+			lblActivity.Text = "Finished.";
+			Close();
+		}
+
+		private void frmSync_Load(object sender, EventArgs e) {
+			lblActivity.Text = "Starting...";
+			MainForm.lstResources.BeginUpdate();
+			MainForm.lstResources.Sorted = false;
+			backgroundWorker1.RunWorkerAsync();
+		}
+	}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ARClient/frmSync.resx	Sat Nov 08 22:43:51 2014 +0100
@@ -0,0 +1,123 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <metadata name="backgroundWorker1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>17, 17</value>
+  </metadata>
+</root>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ARClient/frmTextInput.Designer.cs	Sat Nov 08 22:43:51 2014 +0100
@@ -0,0 +1,98 @@
+namespace ARClient {
+	partial class frmTextInput {
+		/// <summary>
+		/// Required designer variable.
+		/// </summary>
+		private System.ComponentModel.IContainer components = null;
+
+		/// <summary>
+		/// Clean up any resources being used.
+		/// </summary>
+		/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+		protected override void Dispose(bool disposing) {
+			if (disposing && (components != null)) {
+				components.Dispose();
+			}
+			base.Dispose(disposing);
+		}
+
+		#region Windows Form Designer generated code
+
+		/// <summary>
+		/// Required method for Designer support - do not modify
+		/// the contents of this method with the code editor.
+		/// </summary>
+		private void InitializeComponent() {
+			this.lblDescription = new System.Windows.Forms.Label();
+			this.textBox1 = new System.Windows.Forms.TextBox();
+			this.btnOk = new System.Windows.Forms.Button();
+			this.btnCancel = new System.Windows.Forms.Button();
+			this.SuspendLayout();
+			// 
+			// lblDescription
+			// 
+			this.lblDescription.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
+						| System.Windows.Forms.AnchorStyles.Left)
+						| System.Windows.Forms.AnchorStyles.Right)));
+			this.lblDescription.Location = new System.Drawing.Point(12, 9);
+			this.lblDescription.Name = "lblDescription";
+			this.lblDescription.Size = new System.Drawing.Size(507, 38);
+			this.lblDescription.TabIndex = 0;
+			this.lblDescription.Text = "label1";
+			// 
+			// textBox1
+			// 
+			this.textBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
+						| System.Windows.Forms.AnchorStyles.Right)));
+			this.textBox1.Location = new System.Drawing.Point(12, 51);
+			this.textBox1.Name = "textBox1";
+			this.textBox1.Size = new System.Drawing.Size(507, 20);
+			this.textBox1.TabIndex = 1;
+			this.textBox1.KeyUp += new System.Windows.Forms.KeyEventHandler(this.textBox1_KeyUp);
+			// 
+			// btnOk
+			// 
+			this.btnOk.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
+			this.btnOk.Location = new System.Drawing.Point(342, 77);
+			this.btnOk.Name = "btnOk";
+			this.btnOk.Size = new System.Drawing.Size(85, 25);
+			this.btnOk.TabIndex = 2;
+			this.btnOk.Text = "OK";
+			this.btnOk.UseVisualStyleBackColor = true;
+			this.btnOk.Click += new System.EventHandler(this.btnOk_Click);
+			// 
+			// btnCancel
+			// 
+			this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
+			this.btnCancel.Location = new System.Drawing.Point(433, 77);
+			this.btnCancel.Name = "btnCancel";
+			this.btnCancel.Size = new System.Drawing.Size(85, 25);
+			this.btnCancel.TabIndex = 3;
+			this.btnCancel.Text = "Cancel";
+			this.btnCancel.UseVisualStyleBackColor = true;
+			this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
+			// 
+			// frmTextInput
+			// 
+			this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+			this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+			this.ClientSize = new System.Drawing.Size(531, 114);
+			this.Controls.Add(this.btnCancel);
+			this.Controls.Add(this.btnOk);
+			this.Controls.Add(this.textBox1);
+			this.Controls.Add(this.lblDescription);
+			this.Name = "frmTextInput";
+			this.Text = "frmTextInput";
+			this.ResumeLayout(false);
+			this.PerformLayout();
+
+		}
+
+		#endregion
+
+		private System.Windows.Forms.Label lblDescription;
+		private System.Windows.Forms.TextBox textBox1;
+		private System.Windows.Forms.Button btnOk;
+		private System.Windows.Forms.Button btnCancel;
+	}
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ARClient/frmTextInput.cs	Sat Nov 08 22:43:51 2014 +0100
@@ -0,0 +1,32 @@
+using System;
+using System.Windows.Forms;
+
+namespace ARClient {
+	public partial class frmTextInput : Form {
+		public frmTextInput() {
+			InitializeComponent();
+		}
+		public String Description { get { return lblDescription.Text; } set { lblDescription.Text = value; } }
+		public String Value { get { return textBox1.Text; } set { textBox1.Text = value; } }
+
+		private void btnOk_Click(object sender, EventArgs e) {
+			DialogResult = DialogResult.OK;
+			Close();
+		}
+
+		private void btnCancel_Click(object sender, EventArgs e) {
+			DialogResult = DialogResult.Cancel;
+			Close();
+		}
+
+		private void textBox1_KeyUp(object sender, KeyEventArgs e) {
+			if (e.KeyCode == Keys.Enter) {
+				e.Handled = true;
+				btnOk_Click(sender, e);
+			} else if (e.KeyCode == Keys.Escape) {
+				DialogResult = DialogResult.Cancel;
+				Close();
+			}
+		}
+	}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ARClient/frmTextInput.resx	Sat Nov 08 22:43:51 2014 +0100
@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+</root>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MARC.sln	Sat Nov 08 22:43:51 2014 +0100
@@ -0,0 +1,26 @@
+
+Microsoft Visual Studio Solution File, Format Version 10.00
+# Visual Studio 2008
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ARClient", "ARClient\ARClient.csproj", "{84FCD326-D7C1-4D03-845B-433CA0A4E696}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UCIS.Core", "UCIS.Core\UCIS.Core.csproj", "{3200885C-E36B-400B-BE21-6209B47832E6}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|Any CPU = Debug|Any CPU
+		Release|Any CPU = Release|Any CPU
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{84FCD326-D7C1-4D03-845B-433CA0A4E696}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{84FCD326-D7C1-4D03-845B-433CA0A4E696}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{84FCD326-D7C1-4D03-845B-433CA0A4E696}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{84FCD326-D7C1-4D03-845B-433CA0A4E696}.Release|Any CPU.Build.0 = Release|Any CPU
+		{3200885C-E36B-400B-BE21-6209B47832E6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{3200885C-E36B-400B-BE21-6209B47832E6}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{3200885C-E36B-400B-BE21-6209B47832E6}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{3200885C-E36B-400B-BE21-6209B47832E6}.Release|Any CPU.Build.0 = Release|Any CPU
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal