Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added gui client

  • Loading branch information...
commit dec2198d4cf5229cc1c8210e6bd99c6ed348cb24 1 parent d47c841
@majimenezp authored
View
6 DbHidrator.sln
@@ -5,6 +5,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DbHidrator", "DbHidrator\Db
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Unit test", "Unit test\Unit test.csproj", "{DDED78ED-0447-430C-A369-1D5DFFAEF5DB}"
EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DbHidratorClient", "DbHidratorClient\DbHidratorClient.csproj", "{B38BF86E-DB97-4256-893A-63CC7879B28A}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -19,6 +21,10 @@ Global
{DDED78ED-0447-430C-A369-1D5DFFAEF5DB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DDED78ED-0447-430C-A369-1D5DFFAEF5DB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DDED78ED-0447-430C-A369-1D5DFFAEF5DB}.Release|Any CPU.Build.0 = Release|Any CPU
+ {B38BF86E-DB97-4256-893A-63CC7879B28A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {B38BF86E-DB97-4256-893A-63CC7879B28A}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {B38BF86E-DB97-4256-893A-63CC7879B28A}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {B38BF86E-DB97-4256-893A-63CC7879B28A}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
View
108 DbHidrator/DbHidratorClient.cs
@@ -7,6 +7,8 @@
using System.Data.Common;
using System.Linq;
using System.Text;
+using System.Threading;
+using System.Threading.Tasks;
namespace DbHidrator
{
@@ -18,11 +20,13 @@ public class DbHidratorClient
private DbProviderFactory factory;
private DbConnection conn;
private static Random random = new Random((int)DateTime.Now.Ticks);
+ private static object insertLock = new object();
public DbHidratorClient(string connectionString, string providerName)
{
this.connStr = connectionString;
this.provName = providerName;
this.tables = new List<Table>();
+
}
public void GenerateSchema()
@@ -39,8 +43,6 @@ public void GenerateSchema()
}
}
-
-
private void CreateColumns(DataTable dtColumns)
{
int rowCount = dtColumns.Rows.Count;
@@ -87,6 +89,7 @@ private void CreateTables(DataTable dtTables)
private void GetSchema(out DataTable dtTables, out DataTable dtColumns)
{
+ //var factories=DbProviderFactories.GetFactoryClasses();
this.factory = DbProviderFactories.GetFactory(provName);
conn = factory.CreateConnection();
conn.ConnectionString = connStr;
@@ -96,33 +99,12 @@ private void GetSchema(out DataTable dtTables, out DataTable dtColumns)
conn.Close();
}
- public void GenerateNRows(int rows, string[] tables)
- {
- var filteredTables = this.tables.Where(x => tables.Contains(x.Name, StringComparer.InvariantCultureIgnoreCase)).ToList();
- foreach (var table in filteredTables)
- {
- CreateQueries(table);
- }
-
- foreach (var table in filteredTables)
- {
- var list = CreateListType(table);
- for (int i = 0; i < rows; i++)
- {
- var reg = CreateRow(table);
- list.Add(reg);
- }
- InsertRows(table, conn, list);
- }
-
- }
-
private void InsertRows(Table table, DbConnection conn, IList list)
{
int i = 0;
var command = table.InsertCommand;
- var columns=table.Columns.OrderBy(x=>x.Id).ToList();
- int cantColumns=columns.Count;
+ var columns = table.Columns.OrderBy(x => x.Id).ToList();
+ int cantColumns = columns.Count;
conn.Open();
using (var trans = conn.BeginTransaction())
{
@@ -236,5 +218,81 @@ private IList CreateListType(Table table)
}
return elements;
}
+
+ public string[] GetTablesNames()
+ {
+ return tables.Select(x => x.Name).ToArray();
+ }
+
+ public void GenerateRowsInRandomTimes(int rows, string[] tablesNames)
+ {
+ Dictionary<string, IList> dataGenerated = new Dictionary<string, IList>();
+ var filteredTables = this.tables.Where(x => tablesNames.Contains(x.Name, StringComparer.InvariantCultureIgnoreCase)).ToList();
+ foreach (var table in filteredTables)
+ {
+ CreateQueries(table);
+ }
+
+ foreach (var table in filteredTables)
+ {
+ var list = CreateListType(table);
+ for (int i = 0; i < rows; i++)
+ {
+ var reg = CreateRow(table);
+ list.Add(reg);
+ }
+ dataGenerated.Add(table.Name, list);
+ }
+ conn.Open();
+ Parallel.ForEach(dataGenerated, data =>
+ {
+ var table1 = filteredTables.FirstOrDefault(x => x.Name == data.Key);
+ Parallel.ForEach(data.Value.Cast<object>(), reg =>
+ {
+ Thread.Sleep(random.Next(100, 3000));
+ InsertRow(table1, conn, reg);
+ });
+ });
+
+ conn.Close();
+ }
+
+ private void InsertRow(Table table, DbConnection conn, object reg)
+ {
+ int i = 0;
+ var command = table.InsertCommand;
+ var columns = table.Columns.OrderBy(x => x.Id).ToList();
+ int cantColumns = columns.Count;
+ lock (insertLock)
+ {
+ for (i = 0; i < cantColumns; i++)
+ {
+ command.Parameters[i].Value = columns[i].ClassProperty.GetValue(reg, null);
+ }
+ command.ExecuteNonQuery();
+ }
+
+ }
+
+ public void GenerateNRows(int rows, string[] tables)
+ {
+ var filteredTables = this.tables.Where(x => tables.Contains(x.Name, StringComparer.InvariantCultureIgnoreCase)).ToList();
+ foreach (var table in filteredTables)
+ {
+ CreateQueries(table);
+ }
+
+ foreach (var table in filteredTables)
+ {
+ var list = CreateListType(table);
+ for (int i = 0; i < rows; i++)
+ {
+ var reg = CreateRow(table);
+ list.Add(reg);
+ }
+ InsertRows(table, conn, list);
+ }
+
+ }
}
}
View
111 DbHidratorClient/DbHidratorClient.csproj
@@ -0,0 +1,111 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProjectGuid>{B38BF86E-DB97-4256-893A-63CC7879B28A}</ProjectGuid>
+ <OutputType>WinExe</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>Client</RootNamespace>
+ <AssemblyName>DbHidratorClient</AssemblyName>
+ <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
+ <FileAlignment>512</FileAlignment>
+ <TargetFrameworkProfile />
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <PlatformTarget>AnyCPU</PlatformTarget>
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\Debug\</OutputPath>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <Prefer32Bit>false</Prefer32Bit>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <PlatformTarget>AnyCPU</PlatformTarget>
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>bin\Release\</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <Prefer32Bit>false</Prefer32Bit>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="System" />
+ <Reference Include="System.Core" />
+ <Reference Include="System.Data.SQLite">
+ <HintPath>..\packages\System.Data.SQLite.1.0.88.0\lib\net40\System.Data.SQLite.dll</HintPath>
+ </Reference>
+ <Reference Include="System.Data.SQLite.Linq">
+ <HintPath>..\packages\System.Data.SQLite.1.0.88.0\lib\net40\System.Data.SQLite.Linq.dll</HintPath>
+ </Reference>
+ <Reference Include="System.Xml.Linq" />
+ <Reference Include="System.Data.DataSetExtensions" />
+ <Reference Include="Microsoft.CSharp" />
+ <Reference Include="System.Data" />
+ <Reference Include="System.Deployment" />
+ <Reference Include="System.Drawing" />
+ <Reference Include="System.Windows.Forms" />
+ <Reference Include="System.Xml" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="Form1.cs">
+ <SubType>Form</SubType>
+ </Compile>
+ <Compile Include="Form1.Designer.cs">
+ <DependentUpon>Form1.cs</DependentUpon>
+ </Compile>
+ <Compile Include="Program.cs" />
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ <EmbeddedResource Include="Form1.resx">
+ <DependentUpon>Form1.cs</DependentUpon>
+ </EmbeddedResource>
+ <EmbeddedResource Include="Properties\Resources.resx">
+ <Generator>ResXFileCodeGenerator</Generator>
+ <LastGenOutput>Resources.Designer.cs</LastGenOutput>
+ <SubType>Designer</SubType>
+ </EmbeddedResource>
+ <Compile Include="Properties\Resources.Designer.cs">
+ <AutoGen>True</AutoGen>
+ <DependentUpon>Resources.resx</DependentUpon>
+ <DesignTime>True</DesignTime>
+ </Compile>
+ <None Include="app.config" />
+ <None Include="packages.config" />
+ <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>
+ <Content Include="x64\SQLite.Interop.dll">
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ </Content>
+ <Content Include="x86\SQLite.Interop.dll">
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ </Content>
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\DbHidrator\DbHidrator.csproj">
+ <Project>{c69b8287-0bf6-4d4b-8283-5c230de24ce9}</Project>
+ <Name>DbHidrator</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+</Project>
View
222 DbHidratorClient/Form1.Designer.cs
@@ -0,0 +1,222 @@
+namespace Client
+{
+ partial class MainForm
+ {
+ /// <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.label1 = new System.Windows.Forms.Label();
+ this.txtConnStr = new System.Windows.Forms.TextBox();
+ this.label2 = new System.Windows.Forms.Label();
+ this.cmbDbProvider = new System.Windows.Forms.ComboBox();
+ this.lstchkTables = new System.Windows.Forms.CheckedListBox();
+ this.label3 = new System.Windows.Forms.Label();
+ this.btnGetTables = new System.Windows.Forms.Button();
+ this.label4 = new System.Windows.Forms.Label();
+ this.numRows = new System.Windows.Forms.NumericUpDown();
+ this.progress = new System.Windows.Forms.ProgressBar();
+ this.rdbtnAll = new System.Windows.Forms.RadioButton();
+ this.rdbtnSimul = new System.Windows.Forms.RadioButton();
+ this.btnStart = new System.Windows.Forms.Button();
+ ((System.ComponentModel.ISupportInitialize)(this.numRows)).BeginInit();
+ this.SuspendLayout();
+ //
+ // label1
+ //
+ this.label1.AutoSize = true;
+ this.label1.Location = new System.Drawing.Point(12, 9);
+ this.label1.Name = "label1";
+ this.label1.Size = new System.Drawing.Size(91, 13);
+ this.label1.TabIndex = 0;
+ this.label1.Text = "ConnectionString:";
+ //
+ // txtConnStr
+ //
+ this.txtConnStr.Location = new System.Drawing.Point(109, 6);
+ this.txtConnStr.Multiline = true;
+ this.txtConnStr.Name = "txtConnStr";
+ this.txtConnStr.Size = new System.Drawing.Size(300, 40);
+ this.txtConnStr.TabIndex = 1;
+ this.txtConnStr.Text = "data source=127.0.0.1;user id=testapp;password=testapp;initial catalog=testapp;Mu" +
+ "ltipleActiveResultSets=true;";
+ //
+ // label2
+ //
+ this.label2.AutoSize = true;
+ this.label2.Location = new System.Drawing.Point(12, 55);
+ this.label2.Name = "label2";
+ this.label2.Size = new System.Drawing.Size(65, 13);
+ this.label2.TabIndex = 2;
+ this.label2.Text = "Db provider:";
+ //
+ // cmbDbProvider
+ //
+ this.cmbDbProvider.FormattingEnabled = true;
+ this.cmbDbProvider.Items.AddRange(new object[] {
+ "System.Data.SqlClient",
+ "System.Data.SQLite",
+ "System.Data.Odbc",
+ "System.Data.OleDb",
+ "System.Data.OracleClient",
+ "System.Data.SqlServerCe.4.0",
+ "System.Data.SqlServerCe.3.5"});
+ this.cmbDbProvider.Location = new System.Drawing.Point(109, 52);
+ this.cmbDbProvider.Name = "cmbDbProvider";
+ this.cmbDbProvider.Size = new System.Drawing.Size(300, 21);
+ this.cmbDbProvider.TabIndex = 3;
+ this.cmbDbProvider.Text = "System.Data.SqlClient";
+ //
+ // lstchkTables
+ //
+ this.lstchkTables.FormattingEnabled = true;
+ this.lstchkTables.Location = new System.Drawing.Point(12, 121);
+ this.lstchkTables.Name = "lstchkTables";
+ this.lstchkTables.Size = new System.Drawing.Size(397, 259);
+ this.lstchkTables.TabIndex = 4;
+ //
+ // label3
+ //
+ this.label3.AutoSize = true;
+ this.label3.Location = new System.Drawing.Point(12, 105);
+ this.label3.Name = "label3";
+ this.label3.Size = new System.Drawing.Size(42, 13);
+ this.label3.TabIndex = 5;
+ this.label3.Text = "Tables:";
+ //
+ // btnGetTables
+ //
+ this.btnGetTables.Location = new System.Drawing.Point(109, 80);
+ this.btnGetTables.Name = "btnGetTables";
+ this.btnGetTables.Size = new System.Drawing.Size(75, 23);
+ this.btnGetTables.TabIndex = 6;
+ this.btnGetTables.Text = "Get tables";
+ this.btnGetTables.UseVisualStyleBackColor = true;
+ this.btnGetTables.Click += new System.EventHandler(this.btnGetTables_Click);
+ //
+ // label4
+ //
+ this.label4.AutoSize = true;
+ this.label4.Location = new System.Drawing.Point(12, 387);
+ this.label4.Name = "label4";
+ this.label4.Size = new System.Drawing.Size(135, 13);
+ this.label4.TabIndex = 7;
+ this.label4.Text = "How many rows per table?:";
+ //
+ // numRows
+ //
+ this.numRows.Location = new System.Drawing.Point(147, 386);
+ this.numRows.Name = "numRows";
+ this.numRows.Size = new System.Drawing.Size(120, 20);
+ this.numRows.TabIndex = 8;
+ this.numRows.Value = new decimal(new int[] {
+ 10,
+ 0,
+ 0,
+ 0});
+ //
+ // progress
+ //
+ this.progress.Location = new System.Drawing.Point(12, 501);
+ this.progress.Name = "progress";
+ this.progress.Size = new System.Drawing.Size(460, 23);
+ this.progress.TabIndex = 9;
+ //
+ // rdbtnAll
+ //
+ this.rdbtnAll.AutoSize = true;
+ this.rdbtnAll.Checked = true;
+ this.rdbtnAll.Location = new System.Drawing.Point(15, 427);
+ this.rdbtnAll.Name = "rdbtnAll";
+ this.rdbtnAll.Size = new System.Drawing.Size(113, 17);
+ this.rdbtnAll.TabIndex = 10;
+ this.rdbtnAll.TabStop = true;
+ this.rdbtnAll.Text = "Insert all in one trip";
+ this.rdbtnAll.UseVisualStyleBackColor = true;
+ //
+ // rdbtnSimul
+ //
+ this.rdbtnSimul.AutoSize = true;
+ this.rdbtnSimul.Location = new System.Drawing.Point(147, 427);
+ this.rdbtnSimul.Name = "rdbtnSimul";
+ this.rdbtnSimul.Size = new System.Drawing.Size(136, 17);
+ this.rdbtnSimul.TabIndex = 11;
+ this.rdbtnSimul.Text = "Simulate random inserts";
+ this.rdbtnSimul.UseVisualStyleBackColor = true;
+ //
+ // btnStart
+ //
+ this.btnStart.Location = new System.Drawing.Point(15, 460);
+ this.btnStart.Name = "btnStart";
+ this.btnStart.Size = new System.Drawing.Size(75, 23);
+ this.btnStart.TabIndex = 12;
+ this.btnStart.Text = "Start";
+ this.btnStart.UseVisualStyleBackColor = true;
+ this.btnStart.Click += new System.EventHandler(this.btnStart_Click);
+ //
+ // MainForm
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(484, 536);
+ this.Controls.Add(this.btnStart);
+ this.Controls.Add(this.rdbtnSimul);
+ this.Controls.Add(this.rdbtnAll);
+ this.Controls.Add(this.progress);
+ this.Controls.Add(this.numRows);
+ this.Controls.Add(this.label4);
+ this.Controls.Add(this.btnGetTables);
+ this.Controls.Add(this.label3);
+ this.Controls.Add(this.lstchkTables);
+ this.Controls.Add(this.cmbDbProvider);
+ this.Controls.Add(this.label2);
+ this.Controls.Add(this.txtConnStr);
+ this.Controls.Add(this.label1);
+ this.Name = "MainForm";
+ this.Text = "DbHidrator";
+ ((System.ComponentModel.ISupportInitialize)(this.numRows)).EndInit();
+ this.ResumeLayout(false);
+ this.PerformLayout();
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.Label label1;
+ private System.Windows.Forms.TextBox txtConnStr;
+ private System.Windows.Forms.Label label2;
+ private System.Windows.Forms.ComboBox cmbDbProvider;
+ private System.Windows.Forms.CheckedListBox lstchkTables;
+ private System.Windows.Forms.Label label3;
+ private System.Windows.Forms.Button btnGetTables;
+ private System.Windows.Forms.Label label4;
+ private System.Windows.Forms.NumericUpDown numRows;
+ private System.Windows.Forms.ProgressBar progress;
+ private System.Windows.Forms.RadioButton rdbtnAll;
+ private System.Windows.Forms.RadioButton rdbtnSimul;
+ private System.Windows.Forms.Button btnStart;
+ }
+}
+
View
89 DbHidratorClient/Form1.cs
@@ -0,0 +1,89 @@
+using DbHidrator;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Threading;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+namespace Client
+{
+ public partial class MainForm : Form
+ {
+ DbHidratorClient client;
+ SynchronizationContext syncContext;
+ public MainForm()
+ {
+ InitializeComponent();
+ syncContext = SynchronizationContext.Current;
+ cmbDbProvider.SelectedIndex = 0;
+ }
+
+ private async void btnGetTables_Click(object sender, EventArgs e)
+ {
+ var conn = txtConnStr.Text;
+ var provider = cmbDbProvider.SelectedItem.ToString();
+ string[] tablesList = await GetTablesList(conn, provider);
+ lstchkTables.Items.AddRange(tablesList);
+ }
+
+ private Task<string[]> GetTablesList(string connStr, string providerStr)
+ {
+ return Task<string[]>.Run(() =>
+ {
+ client = new DbHidratorClient(connStr, providerStr);
+ client.GenerateSchema();
+ var tablesList = client.GetTablesNames();
+ return tablesList;
+ });
+ }
+
+ private async void btnStart_Click(object sender, EventArgs e)
+ {
+ var conn = txtConnStr.Text;
+ var provider = cmbDbProvider.SelectedItem.ToString();
+ var info = lstchkTables.CheckedItems.Cast<String>().ToArray();
+ if (rdbtnAll.Checked)
+ {
+ await GenerateNRows(conn, provider, (int)numRows.Value, info);
+ }
+ else
+ {
+ await SimulateRandomInserts(conn, provider,(int)numRows.Value, info);
+ }
+ }
+
+ private Task SimulateRandomInserts(string conn, string provider,int numberOfRows, string[] tables)
+ {
+ return Task.Run(() =>
+ {
+ client.GenerateRowsInRandomTimes(numberOfRows,tables);
+ Report(new Tuple<int, int>(100, 100));
+ });
+ }
+
+ private Task<bool> GenerateNRows(string connStr, string providerStr,int numberOfRows,string[] tables)
+ {
+ return Task<bool>.Run(() =>
+ {
+ client.GenerateNRows(numberOfRows, tables);
+ Report(new Tuple<int, int>(100, 100));
+ return true;
+ });
+ }
+
+ public void Report(Tuple<int, int> value)
+ {
+ syncContext.Post((data) => {
+ Tuple<int, int> rangeProgress =(Tuple<int,int>) data;
+ progress.Maximum = rangeProgress.Item1;
+ progress.Value = rangeProgress.Item2;
+ }, value);
+
+ }
+ }
+}
View
120 DbHidratorClient/Form1.resx
@@ -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=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <resheader name="writer">
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+</root>
View
21 DbHidratorClient/Program.cs
@@ -0,0 +1,21 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Windows.Forms;
+
+namespace Client
+{
+ static class Program
+ {
+ /// <summary>
+ /// The main entry point for the application.
+ /// </summary>
+ [STAThread]
+ static void Main()
+ {
+ Application.EnableVisualStyles();
+ Application.SetCompatibleTextRenderingDefault(false);
+ Application.Run(new MainForm());
+ }
+ }
+}
View
36 DbHidratorClient/Properties/AssemblyInfo.cs
@@ -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("DbHidratorClient")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("DbHidratorClient")]
+[assembly: AssemblyCopyright("Copyright © 2013")]
+[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("a957e349-4eff-4033-87d8-f422d21efbf5")]
+
+// 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("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
View
63 DbHidratorClient/Properties/Resources.Designer.cs
@@ -0,0 +1,63 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.17929
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace Client.Properties {
+ using System;
+
+
+ /// <summary>
+ /// A strongly-typed resource class, for looking up localized strings, etc.
+ /// </summary>
+ // This class was auto-generated by the StronglyTypedResourceBuilder
+ // class via a tool like ResGen or Visual Studio.
+ // To add or remove a member, edit your .ResX file then rerun ResGen
+ // with the /str option, or rebuild your VS project.
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ internal class Resources {
+
+ private static global::System.Resources.ResourceManager resourceMan;
+
+ private static global::System.Globalization.CultureInfo resourceCulture;
+
+ [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+ internal Resources() {
+ }
+
+ /// <summary>
+ /// Returns the cached ResourceManager instance used by this class.
+ /// </summary>
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Resources.ResourceManager ResourceManager {
+ get {
+ if (object.ReferenceEquals(resourceMan, null)) {
+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Client.Properties.Resources", typeof(Resources).Assembly);
+ resourceMan = temp;
+ }
+ return resourceMan;
+ }
+ }
+
+ /// <summary>
+ /// Overrides the current thread's CurrentUICulture property for all
+ /// resource lookups using this strongly typed resource class.
+ /// </summary>
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Globalization.CultureInfo Culture {
+ get {
+ return resourceCulture;
+ }
+ set {
+ resourceCulture = value;
+ }
+ }
+ }
+}
View
117 DbHidratorClient/Properties/Resources.resx
@@ -0,0 +1,117 @@
+<?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.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: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" type="xsd:string" />
+ <xsd:attribute name="type" type="xsd:string" />
+ <xsd:attribute name="mimetype" type="xsd:string" />
+ </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" msdata:Ordinal="1" />
+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+ </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>
View
26 DbHidratorClient/Properties/Settings.Designer.cs
@@ -0,0 +1,26 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.17929
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace Client.Properties {
+
+
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.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;
+ }
+ }
+ }
+}
View
7 DbHidratorClient/Properties/Settings.settings
@@ -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>
View
3  DbHidratorClient/app.config
@@ -0,0 +1,3 @@
+<?xml version="1.0"?>
+<configuration>
+<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/></startup></configuration>
View
4 DbHidratorClient/packages.config
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<packages>
+ <package id="System.Data.SQLite" version="1.0.88.0" targetFramework="net40" />
+</packages>
View
BIN  DbHidratorClient/x86/SQLite.Interop.dll
Binary file not shown
View
1  Unit test/UnitTest1.cs
@@ -19,6 +19,7 @@ public void TestMethod1()
var tables=conn.GetSchema("Tables");
var columns = conn.GetSchema("Columns");
conn.Close();
+
}
[TestMethod]
Please sign in to comment.
Something went wrong with that request. Please try again.