Skip to content

Commit

Permalink
Update DocumentSDK to 1.2.0, misc fix and update.
Browse files Browse the repository at this point in the history
  • Loading branch information
mingaliu committed Jul 11, 2015
1 parent 33d272a commit 8ca2400
Show file tree
Hide file tree
Showing 11 changed files with 803 additions and 24 deletions.
27 changes: 18 additions & 9 deletions DocumentDBStudio/DocumentDBStudio.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,14 @@
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.Azure.Documents.Client, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<Reference Include="Microsoft.Azure.Documents.Client, Version=1.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Microsoft.Azure.DocumentDB.1.0.0\lib\net40\Microsoft.Azure.Documents.Client.dll</HintPath>
<HintPath>..\packages\Microsoft.Azure.DocumentDB.1.2.0\lib\net40\Microsoft.Azure.Documents.Client.dll</HintPath>
</Reference>
<Reference Include="Microsoft.CSharp" />
<Reference Include="Newtonsoft.Json, Version=4.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<Reference Include="Newtonsoft.Json, Version=5.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Newtonsoft.Json.4.5.11\lib\net40\Newtonsoft.Json.dll</HintPath>
<HintPath>..\packages\Newtonsoft.Json.5.0.7\lib\net40\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.configuration" />
Expand Down Expand Up @@ -134,11 +134,17 @@
<Compile Include="ExcludedPathForm.Designer.cs">
<DependentUpon>ExcludedPathForm.cs</DependentUpon>
</Compile>
<Compile Include="IndexingPathForm.cs">
<Compile Include="IncludedPathForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="IndexingPathForm.Designer.cs">
<DependentUpon>IndexingPathForm.cs</DependentUpon>
<Compile Include="IncludedPathForm.Designer.cs">
<DependentUpon>IncludedPathForm.cs</DependentUpon>
</Compile>
<Compile Include="IndexSpecsForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="IndexSpecsForm.Designer.cs">
<DependentUpon>IndexSpecsForm.cs</DependentUpon>
</Compile>
<Compile Include="MainForm.cs">
<SubType>Form</SubType>
Expand All @@ -164,8 +170,11 @@
<EmbeddedResource Include="ExcludedPathForm.resx">
<DependentUpon>ExcludedPathForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="IndexingPathForm.resx">
<DependentUpon>IndexingPathForm.cs</DependentUpon>
<EmbeddedResource Include="IncludedPathForm.resx">
<DependentUpon>IncludedPathForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="IndexSpecsForm.resx">
<DependentUpon>IndexSpecsForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="MainForm.resx">
<SubType>Designer</SubType>
Expand Down
2 changes: 1 addition & 1 deletion DocumentDBStudio/Helper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ namespace Microsoft.Azure.DocumentDBStudio
{
static class Constants
{
public readonly static string ProductVersion = "0.50";
public readonly static string ProductVersion = "0.60";
public readonly static string ApplicationName = "Azure DocumentDB Studio";

/// <summary>
Expand Down
149 changes: 149 additions & 0 deletions DocumentDBStudio/IncludedPathForm.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

111 changes: 111 additions & 0 deletions DocumentDBStudio/IncludedPathForm.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Microsoft.Azure.Documents;

namespace Microsoft.Azure.DocumentDBStudio
{
public partial class IncludedPathForm : Form
{
private IncludedPath includedPath = null;

public IncludedPathForm()
{
InitializeComponent();
}

public void SetIncludedPath(IncludedPath includedPath)
{
this.includedPath = includedPath;

// init the path
tbIncludedPathPath.Text = includedPath.Path;
this.lbIndexes.Items.Clear();

foreach (Index index in includedPath.Indexes)
{
this.lbIndexes.Items.Add(index);
}
}

public IncludedPath IncludedPath
{
get { return this.includedPath; }
}

private void btnSave_Click(object sender, EventArgs e)
{
if (string.IsNullOrEmpty(tbIncludedPathPath.Text))
{
MessageBox.Show("Please input the valid path");
this.DialogResult = DialogResult.None;
return;
}

this.includedPath = new IncludedPath();

includedPath.Path = tbIncludedPathPath.Text;

foreach (object item in this.lbIndexes.Items)
{
Index index = item as Index;
this.includedPath.Indexes.Add(index);
}

this.DialogResult = DialogResult.OK;
return;
}

private void btnAddIndexSpec_Click(object sender, EventArgs e)
{
IndexSpecsForm dlg = new IndexSpecsForm();
dlg.StartPosition = FormStartPosition.CenterParent;
DialogResult dr = dlg.ShowDialog(this);
if (dr == DialogResult.OK)
{
this.lbIndexes.Items.Add(dlg.Index);
}
}

private void btnRemoveIndexSpec_Click(object sender, EventArgs e)
{
this.lbIndexes.Items.RemoveAt(this.lbIndexes.SelectedIndex);
}

private void btnEditIndexSpec_Click(object sender, EventArgs e)
{
Index index = this.lbIndexes.SelectedItem as Index;

IndexSpecsForm dlg = new IndexSpecsForm();
dlg.StartPosition = FormStartPosition.CenterParent;

dlg.SetIndex(index);

DialogResult dr = dlg.ShowDialog(this);
if (dr == DialogResult.OK)
{
this.lbIndexes.Items[this.lbIndexes.SelectedIndex] = dlg.Index;
}
}

private void lbIndexes_SelectedIndexChanged(object sender, EventArgs e)
{
if (this.lbIndexes.SelectedItem != null)
{
this.btnEditIndexSpec.Enabled = true;
this.btnRemoveIndexSpec.Enabled = true;
}
else
{
this.btnEditIndexSpec.Enabled = false;
this.btnRemoveIndexSpec.Enabled = false;
}
}
}
}
Loading

0 comments on commit 8ca2400

Please sign in to comment.