diff --git a/DocumentDBStudio/DocumentDBStudio.csproj b/DocumentDBStudio/DocumentDBStudio.csproj index abca2ef..50447de 100644 --- a/DocumentDBStudio/DocumentDBStudio.csproj +++ b/DocumentDBStudio/DocumentDBStudio.csproj @@ -96,14 +96,14 @@ false - + False - ..\packages\Microsoft.Azure.DocumentDB.1.0.0\lib\net40\Microsoft.Azure.Documents.Client.dll + ..\packages\Microsoft.Azure.DocumentDB.1.2.0\lib\net40\Microsoft.Azure.Documents.Client.dll - + False - ..\packages\Newtonsoft.Json.4.5.11\lib\net40\Newtonsoft.Json.dll + ..\packages\Newtonsoft.Json.5.0.7\lib\net40\Newtonsoft.Json.dll @@ -134,11 +134,17 @@ ExcludedPathForm.cs - + Form - - IndexingPathForm.cs + + IncludedPathForm.cs + + + Form + + + IndexSpecsForm.cs Form @@ -164,8 +170,11 @@ ExcludedPathForm.cs - - IndexingPathForm.cs + + IncludedPathForm.cs + + + IndexSpecsForm.cs Designer diff --git a/DocumentDBStudio/Helper.cs b/DocumentDBStudio/Helper.cs index 72daf09..e93e72f 100644 --- a/DocumentDBStudio/Helper.cs +++ b/DocumentDBStudio/Helper.cs @@ -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"; /// diff --git a/DocumentDBStudio/IncludedPathForm.Designer.cs b/DocumentDBStudio/IncludedPathForm.Designer.cs new file mode 100644 index 0000000..992df1c --- /dev/null +++ b/DocumentDBStudio/IncludedPathForm.Designer.cs @@ -0,0 +1,149 @@ +namespace Microsoft.Azure.DocumentDBStudio +{ + partial class IncludedPathForm + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.tbIncludedPathPath = new System.Windows.Forms.TextBox(); + this.label1 = new System.Windows.Forms.Label(); + this.lbIndexes = new System.Windows.Forms.ListBox(); + this.label2 = new System.Windows.Forms.Label(); + this.btnAddIndexSpec = new System.Windows.Forms.Button(); + this.btnRemoveIndexSpec = new System.Windows.Forms.Button(); + this.btnEditIndexSpec = new System.Windows.Forms.Button(); + this.btnSave = new System.Windows.Forms.Button(); + this.SuspendLayout(); + // + // tbIncludedPathPath + // + this.tbIncludedPathPath.Location = new System.Drawing.Point(58, 25); + this.tbIncludedPathPath.Name = "tbIncludedPathPath"; + this.tbIncludedPathPath.Size = new System.Drawing.Size(425, 20); + this.tbIncludedPathPath.TabIndex = 0; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(13, 28); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(29, 13); + this.label1.TabIndex = 1; + this.label1.Text = "Path"; + // + // lbIndexes + // + this.lbIndexes.FormattingEnabled = true; + this.lbIndexes.Location = new System.Drawing.Point(58, 66); + this.lbIndexes.Name = "lbIndexes"; + this.lbIndexes.ScrollAlwaysVisible = true; + this.lbIndexes.Size = new System.Drawing.Size(425, 95); + this.lbIndexes.TabIndex = 2; + this.lbIndexes.SelectedIndexChanged += new System.EventHandler(this.lbIndexes_SelectedIndexChanged); + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(13, 66); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(44, 13); + this.label2.TabIndex = 3; + this.label2.Text = "Indexes"; + // + // btnAddIndexSpec + // + this.btnAddIndexSpec.Location = new System.Drawing.Point(58, 167); + this.btnAddIndexSpec.Name = "btnAddIndexSpec"; + this.btnAddIndexSpec.Size = new System.Drawing.Size(75, 23); + this.btnAddIndexSpec.TabIndex = 4; + this.btnAddIndexSpec.Text = "Add"; + this.btnAddIndexSpec.UseVisualStyleBackColor = true; + this.btnAddIndexSpec.Click += new System.EventHandler(this.btnAddIndexSpec_Click); + // + // btnRemoveIndexSpec + // + this.btnRemoveIndexSpec.Enabled = false; + this.btnRemoveIndexSpec.Location = new System.Drawing.Point(139, 167); + this.btnRemoveIndexSpec.Name = "btnRemoveIndexSpec"; + this.btnRemoveIndexSpec.Size = new System.Drawing.Size(75, 23); + this.btnRemoveIndexSpec.TabIndex = 5; + this.btnRemoveIndexSpec.Text = "Remove"; + this.btnRemoveIndexSpec.UseVisualStyleBackColor = true; + this.btnRemoveIndexSpec.Click += new System.EventHandler(this.btnRemoveIndexSpec_Click); + // + // btnEditIndexSpec + // + this.btnEditIndexSpec.Enabled = false; + this.btnEditIndexSpec.Location = new System.Drawing.Point(220, 167); + this.btnEditIndexSpec.Name = "btnEditIndexSpec"; + this.btnEditIndexSpec.Size = new System.Drawing.Size(75, 23); + this.btnEditIndexSpec.TabIndex = 6; + this.btnEditIndexSpec.Text = "Edit"; + this.btnEditIndexSpec.UseVisualStyleBackColor = true; + this.btnEditIndexSpec.Click += new System.EventHandler(this.btnEditIndexSpec_Click); + // + // btnSave + // + this.btnSave.Location = new System.Drawing.Point(408, 211); + this.btnSave.Name = "btnSave"; + this.btnSave.Size = new System.Drawing.Size(75, 23); + this.btnSave.TabIndex = 7; + this.btnSave.Text = "Save"; + this.btnSave.UseVisualStyleBackColor = true; + this.btnSave.Click += new System.EventHandler(this.btnSave_Click); + // + // IncludedPathForm + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(542, 246); + this.Controls.Add(this.btnSave); + this.Controls.Add(this.btnEditIndexSpec); + this.Controls.Add(this.btnRemoveIndexSpec); + this.Controls.Add(this.btnAddIndexSpec); + this.Controls.Add(this.label2); + this.Controls.Add(this.lbIndexes); + this.Controls.Add(this.label1); + this.Controls.Add(this.tbIncludedPathPath); + this.Name = "IncludedPathForm"; + this.Text = "Included Path"; + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.TextBox tbIncludedPathPath; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.ListBox lbIndexes; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.Button btnAddIndexSpec; + private System.Windows.Forms.Button btnRemoveIndexSpec; + private System.Windows.Forms.Button btnEditIndexSpec; + private System.Windows.Forms.Button btnSave; + } +} \ No newline at end of file diff --git a/DocumentDBStudio/IncludedPathForm.cs b/DocumentDBStudio/IncludedPathForm.cs new file mode 100644 index 0000000..b9e7b4f --- /dev/null +++ b/DocumentDBStudio/IncludedPathForm.cs @@ -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; + } + } + } +} \ No newline at end of file diff --git a/DocumentDBStudio/IncludedPathForm.resx b/DocumentDBStudio/IncludedPathForm.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/DocumentDBStudio/IncludedPathForm.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/DocumentDBStudio/IndexSpecsForm.Designer.cs b/DocumentDBStudio/IndexSpecsForm.Designer.cs new file mode 100644 index 0000000..3f78aff --- /dev/null +++ b/DocumentDBStudio/IndexSpecsForm.Designer.cs @@ -0,0 +1,170 @@ +namespace Microsoft.Azure.DocumentDBStudio +{ + partial class IndexSpecsForm + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.rbHash = new System.Windows.Forms.RadioButton(); + this.rbRange = new System.Windows.Forms.RadioButton(); + this.groupBox2 = new System.Windows.Forms.GroupBox(); + this.rbString = new System.Windows.Forms.RadioButton(); + this.rbNumber = new System.Windows.Forms.RadioButton(); + this.label1 = new System.Windows.Forms.Label(); + this.tbPrecision = new System.Windows.Forms.TextBox(); + this.btnSave = new System.Windows.Forms.Button(); + this.groupBox1.SuspendLayout(); + this.groupBox2.SuspendLayout(); + this.SuspendLayout(); + // + // groupBox1 + // + this.groupBox1.Controls.Add(this.rbRange); + this.groupBox1.Controls.Add(this.rbHash); + this.groupBox1.Location = new System.Drawing.Point(12, 12); + this.groupBox1.Name = "groupBox1"; + this.groupBox1.Size = new System.Drawing.Size(92, 87); + this.groupBox1.TabIndex = 0; + this.groupBox1.TabStop = false; + this.groupBox1.Text = "Index Kind"; + // + // rbHash + // + this.rbHash.AutoSize = true; + this.rbHash.Location = new System.Drawing.Point(18, 19); + this.rbHash.Name = "rbHash"; + this.rbHash.Size = new System.Drawing.Size(50, 17); + this.rbHash.TabIndex = 1; + this.rbHash.TabStop = true; + this.rbHash.Text = "Hash"; + this.rbHash.UseVisualStyleBackColor = true; + // + // rbRange + // + this.rbRange.AutoSize = true; + this.rbRange.Location = new System.Drawing.Point(18, 54); + this.rbRange.Name = "rbRange"; + this.rbRange.Size = new System.Drawing.Size(57, 17); + this.rbRange.TabIndex = 2; + this.rbRange.TabStop = true; + this.rbRange.Text = "Range"; + this.rbRange.UseVisualStyleBackColor = true; + // + // groupBox2 + // + this.groupBox2.Controls.Add(this.rbString); + this.groupBox2.Controls.Add(this.rbNumber); + this.groupBox2.Location = new System.Drawing.Point(129, 12); + this.groupBox2.Name = "groupBox2"; + this.groupBox2.Size = new System.Drawing.Size(92, 87); + this.groupBox2.TabIndex = 1; + this.groupBox2.TabStop = false; + this.groupBox2.Text = "Data Type"; + // + // rbString + // + this.rbString.AutoSize = true; + this.rbString.Location = new System.Drawing.Point(18, 54); + this.rbString.Name = "rbString"; + this.rbString.Size = new System.Drawing.Size(52, 17); + this.rbString.TabIndex = 2; + this.rbString.TabStop = true; + this.rbString.Text = "String"; + this.rbString.UseVisualStyleBackColor = true; + // + // rbNumber + // + this.rbNumber.AutoSize = true; + this.rbNumber.Checked = true; + this.rbNumber.Location = new System.Drawing.Point(18, 19); + this.rbNumber.Name = "rbNumber"; + this.rbNumber.Size = new System.Drawing.Size(62, 17); + this.rbNumber.TabIndex = 1; + this.rbNumber.TabStop = true; + this.rbNumber.Text = "Number"; + this.rbNumber.UseVisualStyleBackColor = true; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(27, 122); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(50, 13); + this.label1.TabIndex = 2; + this.label1.Text = "Precision"; + // + // tbPrecision + // + this.tbPrecision.Location = new System.Drawing.Point(83, 119); + this.tbPrecision.Name = "tbPrecision"; + this.tbPrecision.Size = new System.Drawing.Size(100, 20); + this.tbPrecision.TabIndex = 3; + // + // btnSave + // + this.btnSave.Location = new System.Drawing.Point(83, 156); + this.btnSave.Name = "btnSave"; + this.btnSave.Size = new System.Drawing.Size(75, 23); + this.btnSave.TabIndex = 4; + this.btnSave.Text = "Save"; + this.btnSave.UseVisualStyleBackColor = true; + this.btnSave.Click += new System.EventHandler(this.btnSave_Click); + // + // IndexSpecsForm + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(238, 191); + this.Controls.Add(this.btnSave); + this.Controls.Add(this.tbPrecision); + this.Controls.Add(this.label1); + this.Controls.Add(this.groupBox2); + this.Controls.Add(this.groupBox1); + this.Name = "IndexSpecsForm"; + this.Text = "Index Specs"; + this.groupBox1.ResumeLayout(false); + this.groupBox1.PerformLayout(); + this.groupBox2.ResumeLayout(false); + this.groupBox2.PerformLayout(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.GroupBox groupBox1; + private System.Windows.Forms.RadioButton rbRange; + private System.Windows.Forms.RadioButton rbHash; + private System.Windows.Forms.GroupBox groupBox2; + private System.Windows.Forms.RadioButton rbString; + private System.Windows.Forms.RadioButton rbNumber; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.TextBox tbPrecision; + private System.Windows.Forms.Button btnSave; + } +} \ No newline at end of file diff --git a/DocumentDBStudio/IndexSpecsForm.cs b/DocumentDBStudio/IndexSpecsForm.cs new file mode 100644 index 0000000..f3b71e3 --- /dev/null +++ b/DocumentDBStudio/IndexSpecsForm.cs @@ -0,0 +1,94 @@ +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; +using System.Globalization; + +namespace Microsoft.Azure.DocumentDBStudio +{ + public partial class IndexSpecsForm : Form + { + private Index index = null; + + public IndexSpecsForm() + { + InitializeComponent(); + } + + public void SetIndex(Index index) + { + this.index = index; + + if (index.Kind == IndexKind.Hash) + { + this.rbHash.Checked = true; + if (((HashIndex)index).DataType == DataType.Number) + { + this.rbNumber.Checked = true; + } + else + { + this.rbString.Checked = true; + } + + this.tbPrecision.Text = ((HashIndex)index).Precision.HasValue ? ((HashIndex)index).Precision.Value.ToString(CultureInfo.InvariantCulture) : string.Empty; + } + else + { + this.rbRange.Checked = true; + if (((RangeIndex)index).DataType == DataType.Number) + { + this.rbNumber.Checked = true; + } + else + { + this.rbString.Checked = true; + } + + this.tbPrecision.Text = ((RangeIndex)index).Precision.HasValue ? ((RangeIndex)index).Precision.Value.ToString(CultureInfo.InvariantCulture) : string.Empty; + } + } + + public Index Index + { + get { return this.index; } + } + + private void btnSave_Click(object sender, EventArgs e) + { + short? precision = null; + if (!string.IsNullOrEmpty(this.tbPrecision.Text)) + { + short precisionValue; + if (short.TryParse(this.tbPrecision.Text, out precisionValue)) + { + precision = precisionValue; + } + else + { + MessageBox.Show("Please enter a valid precision value."); + this.DialogResult = DialogResult.None; + return; + } + } + + if (this.rbHash.Checked) + { + this.index = new HashIndex(this.rbNumber.Checked ? DataType.Number : DataType.String) { Precision = precision }; + } + else + { + this.index = new RangeIndex(this.rbNumber.Checked ? DataType.Number : DataType.String) { Precision = precision }; + } + + this.DialogResult = DialogResult.OK; + return; + } + } +} diff --git a/DocumentDBStudio/IndexSpecsForm.resx b/DocumentDBStudio/IndexSpecsForm.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/DocumentDBStudio/IndexSpecsForm.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/DocumentDBStudio/MainForm.cs b/DocumentDBStudio/MainForm.cs index 8eeca74..e5aea8d 100644 --- a/DocumentDBStudio/MainForm.cs +++ b/DocumentDBStudio/MainForm.cs @@ -129,7 +129,7 @@ private void MainForm_Load(object sender, EventArgs e) ToolStripControlHost host = new ToolStripControlHost(cbEnableScan); feedToolStrip.Items.Insert(1, host); - lbIncludedPath.Items.Add(new IndexingPath() { Path = "/", IndexType = IndexType.Hash }); + lbIncludedPath.Items.Add(new IncludedPath() { Path = "/" }); } @@ -606,7 +606,7 @@ public void CheckCurrentRelease() if (string.Compare(Constants.ProductVersion.ToString(), latestReleaseString, StringComparison.OrdinalIgnoreCase) < 0) { - this.Invoke(new MessageBoxDelegate(ShowMessage), + this.Invoke(new MessageBoxDelegate(ShowMessage), string.Format(CultureInfo.InvariantCulture, "Please update the DocumentDB studio to the latest version {0} at https://github.com/mingaliu/DocumentDBStudio/releases", latestReleaseString), Constants.ApplicationName, MessageBoxButtons.OK, MessageBoxIcon.Information); } @@ -800,15 +800,15 @@ private void toolStripBtnExecute_Click(object sender, EventArgs e) this.collectionToCreate.IndexingPolicy.IncludedPaths.Clear(); foreach (object item in lbIncludedPath.Items) { - IndexingPath path = item as IndexingPath; - this.collectionToCreate.IndexingPolicy.IncludedPaths.Add(path); + IncludedPath includedPath = item as IncludedPath; + this.collectionToCreate.IndexingPolicy.IncludedPaths.Add(includedPath); } this.collectionToCreate.IndexingPolicy.ExcludedPaths.Clear(); foreach (object item in lbExcludedPath.Items) { - String path = item as String; - this.collectionToCreate.IndexingPolicy.ExcludedPaths.Add(path); + String excludedPath = item as String; + this.collectionToCreate.IndexingPolicy.ExcludedPaths.Add(new ExcludedPath() { Path = excludedPath }); } this.collectionToCreate.Id = tbCollectionId.Text; @@ -1095,11 +1095,12 @@ private void rbConsistencyEventual_CheckedChanged(object sender, EventArgs e) private void btnAddIncludePath_Click(object sender, EventArgs e) { - IndexingPathForm dlg = new IndexingPathForm(); + IncludedPathForm dlg = new IncludedPathForm(); + dlg.StartPosition = FormStartPosition.CenterParent; DialogResult dr = dlg.ShowDialog(this); if (dr == DialogResult.OK) { - this.lbIncludedPath.Items.Add(dlg.IndexingPath); + this.lbIncludedPath.Items.Add(dlg.IncludedPath); } } @@ -1124,16 +1125,17 @@ private void lbIncludedPath_SelectedIndexChanged(object sender, EventArgs e) private void btnEdit_Click(object sender, EventArgs e) { - IndexingPath path = this.lbIncludedPath.SelectedItem as IndexingPath; + IncludedPath includedPath = this.lbIncludedPath.SelectedItem as IncludedPath; - IndexingPathForm dlg = new IndexingPathForm(); + IncludedPathForm dlg = new IncludedPathForm(); + dlg.StartPosition = FormStartPosition.CenterParent; - dlg.SetIndexingPath(path); + dlg.SetIncludedPath(includedPath); DialogResult dr = dlg.ShowDialog(this); if (dr == DialogResult.OK) { - this.lbIncludedPath.Items[this.lbIncludedPath.SelectedIndex] = path; + this.lbIncludedPath.Items[this.lbIncludedPath.SelectedIndex] = dlg.IncludedPath; } } diff --git a/DocumentDBStudio/TreeNodes.cs b/DocumentDBStudio/TreeNodes.cs index 07d34fd..8690003 100644 --- a/DocumentDBStudio/TreeNodes.cs +++ b/DocumentDBStudio/TreeNodes.cs @@ -687,6 +687,10 @@ void myMenuItemQueryDocument_Click(object sender, EventArgs e) { this.currentQueryCommandContext = new CommandContext(); this.currentQueryCommandContext.IsFeed = true; + + // reset continuation token + this.currentContinuation = null; + Program.GetMain().SetCrudContext(this, string.Format(CultureInfo.InvariantCulture, "Query Documents from Collection {0}", (this.Tag as Documents.DocumentCollection).Id), false, "select * from c", this.QueryDocuments, this.currentQueryCommandContext); diff --git a/DocumentDBStudio/packages.config b/DocumentDBStudio/packages.config index 966bfaa..591c653 100644 --- a/DocumentDBStudio/packages.config +++ b/DocumentDBStudio/packages.config @@ -1,9 +1,9 @@  - + - + \ No newline at end of file