Skip to content

Commit

Permalink
Prepare for 0.31 release.
Browse files Browse the repository at this point in the history
  • Loading branch information
mingaliu committed Jan 30, 2015
1 parent 846a44e commit d5891e0
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 11 deletions.
2 changes: 1 addition & 1 deletion DocumentDBSudio/Helper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ namespace Microsoft.Azure.DocumentDBStudio
{
static class Constants
{
public readonly static string ProductVersion = "0.30";
public readonly static string ProductVersion = "0.31";
public readonly static string ApplicationName = "Azure DocumentDB Studio";

/// <summary>
Expand Down
14 changes: 8 additions & 6 deletions DocumentDBSudio/Resources/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,14 @@ <h2>Azure DocumentDB Studio </h2>
<p>Version &VERSION&. Build on: &BUILDTIME&.</p>
<h4> Features:</h4>
This tool allows you to perform CRUD operation on Azure DocumentDB. <br />
It supports: <br />1. Browse DocumentDB resources and learn DocumentDB resource model.
<br />2. Issue Insert, Replace, Delete, Read (CRUD) operations on every DocumentDB resource and resource feed.
<br />3. Issue SQL/UDF query. Execute storedprocedure.
<br />4. Inspect heads (quota, usage, RG charge) for every operation.
<br />
<br />
It supports:
<br />1. Easily browse DocumentDB resources and learn DocumentDB resource model.
<br />2. Support Create, Read, Update, Delete (CRUD) and Query operations for every DocumentDB resources and resource feed.
<br />3. Support SQL/UDF query. Execute Javascript storedprocedure. Execute Trigger.
<br />4. Inspect headers (for quota, usage, RG charge etc) for every request operation. Support three connection mode: TCP, HTTPDirect and Gateway.
<br />5. Support RequestOptions(for pre/post trigger, sessionToken, consistency model etc), FeedOptions(for paging, enableScanforQuery etc), IndexingPolicy (for indexingMode, indexingType, indexingPath etc).
<br />6. PrettyPrint the output JSON.
<br />7. Bulk import the JSON files.
Features requests? comments? bugs?
<a href="https://github.com/mingaliu/DocumentDBStudio">Please comment on or contribute here.</a><br />
<h4> To start:</h4>
Expand Down
37 changes: 33 additions & 4 deletions DocumentDBSudio/TreeNodes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,19 @@ namespace Microsoft.Azure.DocumentDBStudio
{
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Microsoft.Azure.Documents;
using Microsoft.Azure.DocumentDBStudio.Properties;
using Microsoft.Azure.Documents.Client;
using Microsoft.Azure.Documents.Linq;
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;
using System.Text;
using Microsoft.Azure.Documents;

internal class AccountSettings
{
Expand Down Expand Up @@ -290,6 +291,10 @@ public DatabaseNode(DocumentClient localclient, Documents.Database db)
myMenuItem.Click += new EventHandler(myMenuItemDeleteDatabase_Click);
this.contextMenu.MenuItems.Add(myMenuItem);

MenuItem myMenuItem3 = new MenuItem("Read Database");
myMenuItem3.Click += new EventHandler(myMenuItemReadDatabase_Click);
this.contextMenu.MenuItems.Add(myMenuItem3);

this.contextMenu.MenuItems.Add("-");

MenuItem myMenuItem2 = new MenuItem("Add DocumentCollection");
Expand All @@ -305,6 +310,28 @@ public DocumentClient DocumentClient
get { return this.client; }
}

async void myMenuItemReadDatabase_Click(object sender, EventArgs eArgs)
{
try
{
ResourceResponse<Documents.Database> database = await this.client.ReadDatabaseAsync(((Database)this.Tag).SelfLink, Program.GetMain().GetRequestOptions());

// set the result window
string json = JsonConvert.SerializeObject(database.Resource, Newtonsoft.Json.Formatting.Indented);

Program.GetMain().SetResultInBrowser(json, null, false, database.ResponseHeaders);

}
catch (AggregateException e)
{
Program.GetMain().SetResultInBrowser(null, e.InnerException.ToString(), true);
}
catch (Exception e)
{
Program.GetMain().SetResultInBrowser(null, e.ToString(), true);
}
}

void myMenuItemDeleteDatabase_Click(object sender, EventArgs e)
{
string x = this.Tag.ToString();
Expand Down Expand Up @@ -631,7 +658,9 @@ async void QueryDocuments(string queryText, object optional)

q = this.client.CreateDocumentQuery((this.Tag as Documents.DocumentCollection).SelfLink, queryText, feedOptions).AsDocumentQuery();

Stopwatch sw = Stopwatch.StartNew();
FeedResponse<dynamic> r = await q.ExecuteNextAsync();
sw.Stop();
this.currentContinuation = r.ResponseContinuation;
this.currentQueryCommandContext.HasContinuation = !string.IsNullOrEmpty(this.currentContinuation);
this.currentQueryCommandContext.QueryStarted = true;
Expand All @@ -640,11 +669,11 @@ async void QueryDocuments(string queryText, object optional)
string text = null;
if (r.Count > 1)
{
text = string.Format("Returned {0} documents", r.Count);
text = string.Format("Returned {0} documents in {1} ms", r.Count, sw.ElapsedMilliseconds);
}
else
{
text = string.Format("Returned {0} document", r.Count);
text = string.Format("Returned {0} document in {1} ms", r.Count, sw.ElapsedMilliseconds);
}

string jsonarray = "[";
Expand Down

0 comments on commit d5891e0

Please sign in to comment.