Commits

Kamyar Inanloo committed de2c1b2

JsonRPC added.

  • Participants
  • Parent commits 56813ce

Comments (0)

Files changed (13)

 
 ; Define your application name
 !define APPNAME "Trac Visual Studio Plugin"
-!define APPNAMEANDVERSION "Trac Visual Studio Plugin 0.5.0"
+!define APPNAMEANDVERSION "Trac Visual Studio Plugin 1.0.0"
 
 ; Main Install settings
 Name "${APPNAMEANDVERSION}"

File TracVS/Connect.cs

Binary file modified.

File TracVS/EditTicket.cs

             cmbPriority.Text = ticket.Priority;
             txtOwner.Text = ticket.Owner;
             cmbResolution.Text = ticket.Resolution;
+
+            this.Ticket = ticket;
         }
 
         private void btnOk_Click(object sender, EventArgs e)
 
         private void cmbPriority_SelectedIndexChanged(object sender, EventArgs e)
         {
-            this.cmbPriority.BackColor = Constants.Colors[cmbPriority.SelectedIndex];
+            if (cmbPriority.SelectedIndex != -1)
+            {
+                this.cmbPriority.BackColor = Constants.Colors[cmbPriority.SelectedIndex];
+            }
         }
 
         private void cmbSeverity_SelectedIndexChanged(object sender, EventArgs e)
         {
-            this.cmbSeverity.BackColor = Constants.Colors[cmbSeverity.SelectedIndex];
+            if (cmbSeverity.SelectedIndex != -1)
+            {
+                this.cmbSeverity.BackColor = Constants.Colors[cmbSeverity.SelectedIndex];
+            }
         }
 
 

File TracVS/ITrac.cs

-#region GPL Licence
-/**********************************************************************
- TracExplorer - Trac Integration for Visual Studio and TortoiseSvn
- Copyright (C) 2008 Mladen Mihajlovic
- http://tracexplorer.devjavu.com/
- 
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
- 
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- GNU General Public License for more details.
- 
- You should have received a copy of the GNU General Public License
- along with this program.  If not, see <http://www.gnu.org/licenses/>.
- 
-**********************************************************************
- XML-RPC.NET Copyright (c) 2006 Charles Cook
-**********************************************************************/
-#endregion
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using CookComputing.XmlRpc;
-
-namespace TracVS
-{
-    #region MulticallItem
-    public struct MulticallItem
-    {
-        public string methodName;
-        public string[] @params;
-
-        public MulticallItem(string methodName, string[] @params)
-        {
-            this.methodName = methodName;
-            this.@params = @params;
-        }
-    }
-
-    #endregion
-
-    #region PageInfo
-    public struct PageInfo
-    {
-        public DateTime lastModified;
-        public int version;
-        public string name;
-        public string author;
-    }
-    #endregion
-
-    #region ComponentInfo
-    public struct ComponentInfo
-    {
-        public string owner;
-        public string name;
-        public string description;
-    }
-    #endregion
-
-    /// <summary>
-    /// XMLRPC Trac proxy for ver 0.2
-    /// </summary>
-    public interface ITrac : IXmlRpcProxy
-    {
-        #region Wiki
-        [XmlRpcMethod("wiki.getRecentChanges")] //TODO:Check what struct when the api starts working
-        object getRecentChanges(DateTime since);
-
-        [XmlRpcMethod("wiki.getRPCVersionSupported")]
-        int getRPCVersionSupported();
-
-        [XmlRpcMethod("wiki.getPage")]
-        string getPage(string pagename, int version);
-
-        [XmlRpcMethod("wiki.getPage")]
-        string getPage(string pagename);
-
-        [XmlRpcMethod("wiki.getPageVersion")]
-        string getPageVersion(string pagename, int version);
-
-        [XmlRpcMethod("wiki.getPageVersion")]
-        string getPageVersion(string pagename);
-
-        [XmlRpcMethod("wiki.getPageHTML")]
-        string getPageHTML(string pagename, int version);
-
-        [XmlRpcMethod("wiki.getPageHTML")]
-        string getPageHTML(string pagename);
-
-        [XmlRpcMethod("wiki.getAllPages")]
-        string[] getAllPages();
-
-        [XmlRpcMethod("wiki.getPageInfo")]
-        PageInfo getPageInfo(string pagename, int version);
-
-        [XmlRpcMethod("wiki.getPageInfo")]
-        PageInfo getPageInfo(string pagename);
-
-        [XmlRpcMethod("wiki.getPageInfoVersion")]
-        PageInfo getPageInfoVersion(string pagename, int version);
-
-        [XmlRpcMethod("wiki.getPageInfoVersion")]
-        PageInfo getPageInfoVersion(string pagename);
-
-        //[XmlRpcMethod("wiki.putPage")]
-        //bool wiki.putPage(string pagename, string content, struct attributes);
-
-        [XmlRpcMethod("wiki.listAttachments")]
-        string[] listAttachments(string pagename);
-
-        [XmlRpcMethod("wiki.getAttachment")]
-        Byte[] getAttachment(string path);
-
-        [XmlRpcMethod("wiki.putAttachment")]
-        bool putAttachment(string path, byte[] data);
-
-        [XmlRpcMethod("wiki.putAttachmentEx")]
-        bool putAttachmentEx(string pagename, string filename, string description, byte[] data, bool replace);
-
-        [XmlRpcMethod("wiki.putAttachmentEx")]
-        bool putAttachmentEx(string pagename, string filename, string description, byte[] data); // replace = true
-
-        [XmlRpcMethod("wiki.listLinks")]
-        string[] listLinks(string pagename);
-
-        [XmlRpcMethod("wiki.wikiToHtml")]
-        string wikiToHtml(string text);
-        #endregion
-
-        #region Search
-        [XmlRpcMethod("search.getSearchFilters")]
-        object[] getSearchFilters();
-
-        [XmlRpcMethod("search.performSearch")] // results: array(array(href, title, date, author, excerpt))
-        object[] performSearch(string query, string[] filters);
-
-        [XmlRpcMethod("search.performSearch")]
-        object[] performSearch(string query);
-        #endregion
-
-        #region Ticket Milestones
-        [XmlRpcMethod("ticket.milestone.getAll")]
-        string[] getAllMilestones();
-
-        [XmlRpcMethod("ticket.milestone.get")]
-        object getMilestone(string name);
-        #endregion
-
-        #region Ticket Severity
-        [XmlRpcMethod("ticket.severity.getAll")]
-        string[] getAllSeverities();
-
-        [XmlRpcMethod("ticket.severity.get")]
-        string getSeverity(string name);
-        #endregion
-
-        #region Ticket Type
-        [XmlRpcMethod("ticket.type.getAll")]
-        string[] getAllTicketTypes();
-
-        [XmlRpcMethod("ticket.type.get")]
-        string getTicketType(string name);
-        #endregion
-
-        #region Ticket Resolution
-        [XmlRpcMethod("ticket.resolution.getAll")]
-        string[] getAllResolutions();
-
-        [XmlRpcMethod("ticket.resolution.get")]
-        string getTicketResolution(string name);
-        #endregion
-
-        #region Ticket Priority
-        [XmlRpcMethod("ticket.priority.getAll")]
-        string[] getAllPriorities();
-
-        [XmlRpcMethod("ticket.priority.get")]
-        string getPriority(string name);
-        #endregion
-
-        #region Ticket Component
-        [XmlRpcMethod("ticket.component.getAll")]
-        string[] getAllComponents();
-
-        [XmlRpcMethod("ticket.component.get")]
-        ComponentInfo getComponent(string name);
-        #endregion
-
-        #region Ticket Version
-        [XmlRpcMethod("ticket.version.getAll")]
-        string[] getAllVersions();
-
-        [XmlRpcMethod("ticket.version.get")]
-        ComponentInfo getVersion(string name);
-        #endregion
-
-        #region Tickets
-        [XmlRpcMethod("ticket.query")]//array ticket.query(string qstr="status!=closed")
-        int[] queryTickets(string queryString);
-
-        [XmlRpcMethod("ticket.get")]
-        object[] getTicket(int id);
-
-        [XmlRpcMethod("ticket.create")]
-        int createTicket(string summary, string description, XmlRpcStruct attributes);
-
-        [XmlRpcMethod("ticket.update")]
-        object[] updateTicket(int id, string comment, XmlRpcStruct attributes);
-
-        #endregion
-
-        #region System
-        [XmlRpcMethod("system.multicall")]
-        object[] multicall(MulticallItem[] signatures);
-
-        [XmlRpcMethod("system.listMethods")]
-        string[] listMethods();
-
-        [XmlRpcMethod("system.methodHelp")]
-        string methodHelp(string method);
-
-        [XmlRpcMethod("system.methodSignature")]
-        object[] methodSignature(string method);
-
-        [XmlRpcMethod("system.getAPIVersion")]
-        object[] getAPIVersion();
-        #endregion
-
-        #region Async
-        [XmlRpcBegin("system.getAPIVersion")]
-        IAsyncResult BeginGetAPIVersion();
-
-        [XmlRpcEnd]
-        object[] EndGetAPIVersion(IAsyncResult iasr);
-        #endregion
-    }
-}

File TracVS/ITracAPI.cs

+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Collections;
+
+namespace TracVS
+{
+    public interface ITracAPI
+    {
+        #region Tickets
+
+        int[] queryTickets(string queryString);
+        object[] getTicket(int id);
+        int createTicket(string summary, string description, IDictionary attributes);
+        object[] updateTicket(int id, string comment, IDictionary attributes);
+
+        #region Ticket Version
+        string[] getAllVersions();
+        #endregion
+
+        #region Ticket Type
+        string[] getAllTicketTypes();
+        #endregion
+
+        #region Component
+        string[] getAllComponents();
+        #endregion
+
+        #region Severity
+        string[] getAllSeverities();
+        #endregion
+
+        #region Priority
+        string[] getAllPriorities();
+        #endregion
+
+        #region Resolution
+        string[] getAllResolutions();
+        #endregion
+
+        #endregion
+
+    }
+}

File TracVS/ITracXML.cs

+#region GPL Licence
+/**********************************************************************
+ TracExplorer - Trac Integration for Visual Studio and TortoiseSvn
+ Copyright (C) 2008 Mladen Mihajlovic
+ http://tracexplorer.devjavu.com/
+ 
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+ 
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ GNU General Public License for more details.
+ 
+ You should have received a copy of the GNU General Public License
+ along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ 
+**********************************************************************
+ XML-RPC.NET Copyright (c) 2006 Charles Cook
+**********************************************************************/
+#endregion
+
+using System;
+using System.Collections.Generic;
+using System.Text;
+using CookComputing.XmlRpc;
+using System.Collections;
+
+namespace TracVS
+{
+    #region MulticallItem
+    public struct MulticallItem
+    {
+        public string methodName;
+        public string[] @params;
+
+        public MulticallItem(string methodName, string[] @params)
+        {
+            this.methodName = methodName;
+            this.@params = @params;
+        }
+    }
+
+    #endregion
+
+    #region PageInfo
+    public struct PageInfo
+    {
+        public DateTime lastModified;
+        public int version;
+        public string name;
+        public string author;
+    }
+    #endregion
+
+    #region ComponentInfo
+    public struct ComponentInfo
+    {
+        public string owner;
+        public string name;
+        public string description;
+    }
+    #endregion
+
+    /// <summary>
+    /// XMLRPC Trac proxy for ver 0.2
+    /// </summary>
+    public interface ITracXML : ITracAPI, IXmlRpcProxy
+    {
+        #region Wiki
+        [XmlRpcMethod("wiki.getRecentChanges")] //TODO:Check what struct when the api starts working
+        object getRecentChanges(DateTime since);
+
+        [XmlRpcMethod("wiki.getRPCVersionSupported")]
+        int getRPCVersionSupported();
+
+        [XmlRpcMethod("wiki.getPage")]
+        string getPage(string pagename, int version);
+
+        [XmlRpcMethod("wiki.getPage")]
+        string getPage(string pagename);
+
+        [XmlRpcMethod("wiki.getPageVersion")]
+        string getPageVersion(string pagename, int version);
+
+        [XmlRpcMethod("wiki.getPageVersion")]
+        string getPageVersion(string pagename);
+
+        [XmlRpcMethod("wiki.getPageHTML")]
+        string getPageHTML(string pagename, int version);
+
+        [XmlRpcMethod("wiki.getPageHTML")]
+        string getPageHTML(string pagename);
+
+        [XmlRpcMethod("wiki.getAllPages")]
+        string[] getAllPages();
+
+        [XmlRpcMethod("wiki.getPageInfo")]
+        PageInfo getPageInfo(string pagename, int version);
+
+        [XmlRpcMethod("wiki.getPageInfo")]
+        PageInfo getPageInfo(string pagename);
+
+        [XmlRpcMethod("wiki.getPageInfoVersion")]
+        PageInfo getPageInfoVersion(string pagename, int version);
+
+        [XmlRpcMethod("wiki.getPageInfoVersion")]
+        PageInfo getPageInfoVersion(string pagename);
+
+        //[XmlRpcMethod("wiki.putPage")]
+        //bool wiki.putPage(string pagename, string content, struct attributes);
+
+        [XmlRpcMethod("wiki.listAttachments")]
+        string[] listAttachments(string pagename);
+
+        [XmlRpcMethod("wiki.getAttachment")]
+        Byte[] getAttachment(string path);
+
+        [XmlRpcMethod("wiki.putAttachment")]
+        bool putAttachment(string path, byte[] data);
+
+        [XmlRpcMethod("wiki.putAttachmentEx")]
+        bool putAttachmentEx(string pagename, string filename, string description, byte[] data, bool replace);
+
+        [XmlRpcMethod("wiki.putAttachmentEx")]
+        bool putAttachmentEx(string pagename, string filename, string description, byte[] data); // replace = true
+
+        [XmlRpcMethod("wiki.listLinks")]
+        string[] listLinks(string pagename);
+
+        [XmlRpcMethod("wiki.wikiToHtml")]
+        string wikiToHtml(string text);
+        #endregion
+
+        #region Search
+        [XmlRpcMethod("search.getSearchFilters")]
+        object[] getSearchFilters();
+
+        [XmlRpcMethod("search.performSearch")] // results: array(array(href, title, date, author, excerpt))
+        object[] performSearch(string query, string[] filters);
+
+        [XmlRpcMethod("search.performSearch")]
+        object[] performSearch(string query);
+        #endregion
+
+        #region Ticket Milestones
+        [XmlRpcMethod("ticket.milestone.getAll")]
+        string[] getAllMilestones();
+
+        [XmlRpcMethod("ticket.milestone.get")]
+        object getMilestone(string name);
+        #endregion
+
+        #region Ticket Severity
+        [XmlRpcMethod("ticket.severity.getAll")]
+        string[] getAllSeverities();
+
+        [XmlRpcMethod("ticket.severity.get")]
+        string getSeverity(string name);
+        #endregion
+
+        #region Ticket Type
+        [XmlRpcMethod("ticket.type.getAll")]
+        string[] getAllTicketTypes();
+
+        [XmlRpcMethod("ticket.type.get")]
+        string getTicketType(string name);
+        #endregion
+
+        #region Ticket Resolution
+        [XmlRpcMethod("ticket.resolution.getAll")]
+        string[] getAllResolutions();
+
+        [XmlRpcMethod("ticket.resolution.get")]
+        string getTicketResolution(string name);
+        #endregion
+
+        #region Ticket Priority
+        [XmlRpcMethod("ticket.priority.getAll")]
+        string[] getAllPriorities();
+
+        [XmlRpcMethod("ticket.priority.get")]
+        string getPriority(string name);
+        #endregion
+
+        #region Ticket Component
+        [XmlRpcMethod("ticket.component.getAll")]
+        string[] getAllComponents();
+
+        [XmlRpcMethod("ticket.component.get")]
+        ComponentInfo getComponent(string name);
+        #endregion
+
+        #region Ticket Version
+        [XmlRpcMethod("ticket.version.getAll")]
+        string[] getAllVersions();
+
+        [XmlRpcMethod("ticket.version.get")]
+        ComponentInfo getVersion(string name);
+        #endregion
+
+        #region Tickets
+        [XmlRpcMethod("ticket.query")]//array ticket.query(string qstr="status!=closed")
+        int[] queryTickets(string queryString);
+
+        [XmlRpcMethod("ticket.get")]
+        object[] getTicket(int id);
+
+        [XmlRpcMethod("ticket.create")]
+        int createTicket(string summary, string description, IDictionary attributes);
+
+        [XmlRpcMethod("ticket.update")]
+        object[] updateTicket(int id, string comment, IDictionary attributes);
+
+        #endregion
+
+        #region System
+        [XmlRpcMethod("system.multicall")]
+        object[] multicall(MulticallItem[] signatures);
+
+        [XmlRpcMethod("system.listMethods")]
+        string[] listMethods();
+
+        [XmlRpcMethod("system.methodHelp")]
+        string methodHelp(string method);
+
+        [XmlRpcMethod("system.methodSignature")]
+        object[] methodSignature(string method);
+
+        [XmlRpcMethod("system.getAPIVersion")]
+        object[] getAPIVersion();
+        #endregion
+
+        #region Async
+        [XmlRpcBegin("system.getAPIVersion")]
+        IAsyncResult BeginGetAPIVersion();
+
+        [XmlRpcEnd]
+        object[] EndGetAPIVersion(IAsyncResult iasr);
+        #endregion
+    }
+}

File TracVS/Logon.Designer.cs

             this.btnOk = new System.Windows.Forms.Button();
             this.btnCancel = new System.Windows.Forms.Button();
             this.chkSave = new System.Windows.Forms.CheckBox();
+            this.rdoXML = new System.Windows.Forms.RadioButton();
+            this.rdoJSON = new System.Windows.Forms.RadioButton();
+            this.gbRPC = new System.Windows.Forms.GroupBox();
+            this.gbAuth = new System.Windows.Forms.GroupBox();
+            this.gbUri = new System.Windows.Forms.GroupBox();
+            this.gbRPC.SuspendLayout();
+            this.gbAuth.SuspendLayout();
+            this.gbUri.SuspendLayout();
             this.SuspendLayout();
             // 
             // lbUsername
             // 
             this.lbUsername.AutoSize = true;
-            this.lbUsername.Location = new System.Drawing.Point(44, 102);
+            this.lbUsername.Location = new System.Drawing.Point(19, 31);
             this.lbUsername.Name = "lbUsername";
             this.lbUsername.Size = new System.Drawing.Size(61, 13);
             this.lbUsername.TabIndex = 0;
             // 
             // txtUsername
             // 
-            this.txtUsername.Location = new System.Drawing.Point(111, 99);
+            this.txtUsername.Location = new System.Drawing.Point(86, 28);
             this.txtUsername.Name = "txtUsername";
             this.txtUsername.Size = new System.Drawing.Size(100, 20);
             this.txtUsername.TabIndex = 3;
             // lbUri
             // 
             this.lbUri.AutoSize = true;
-            this.lbUri.Location = new System.Drawing.Point(44, 49);
+            this.lbUri.Location = new System.Drawing.Point(17, 26);
             this.lbUri.Name = "lbUri";
             this.lbUri.Size = new System.Drawing.Size(26, 13);
             this.lbUri.TabIndex = 0;
             // 
             // txtUri
             // 
-            this.txtUri.Location = new System.Drawing.Point(111, 46);
+            this.txtUri.Location = new System.Drawing.Point(84, 23);
             this.txtUri.Name = "txtUri";
-            this.txtUri.Size = new System.Drawing.Size(226, 20);
+            this.txtUri.Size = new System.Drawing.Size(328, 20);
             this.txtUri.TabIndex = 1;
             // 
             // lbPassword
             // 
             this.lbPassword.AutoSize = true;
-            this.lbPassword.Location = new System.Drawing.Point(44, 128);
+            this.lbPassword.Location = new System.Drawing.Point(19, 57);
             this.lbPassword.Name = "lbPassword";
             this.lbPassword.Size = new System.Drawing.Size(59, 13);
             this.lbPassword.TabIndex = 0;
             // 
             // txtPassword
             // 
-            this.txtPassword.Location = new System.Drawing.Point(111, 125);
+            this.txtPassword.Location = new System.Drawing.Point(86, 54);
             this.txtPassword.Name = "txtPassword";
             this.txtPassword.PasswordChar = '*';
             this.txtPassword.Size = new System.Drawing.Size(100, 20);
             this.chkAuthentication.AutoSize = true;
             this.chkAuthentication.Checked = true;
             this.chkAuthentication.CheckState = System.Windows.Forms.CheckState.Checked;
-            this.chkAuthentication.Location = new System.Drawing.Point(47, 72);
+            this.chkAuthentication.Location = new System.Drawing.Point(20, 49);
             this.chkAuthentication.Name = "chkAuthentication";
             this.chkAuthentication.Size = new System.Drawing.Size(128, 17);
             this.chkAuthentication.TabIndex = 2;
             // 
             // btnOk
             // 
-            this.btnOk.Location = new System.Drawing.Point(78, 159);
+            this.btnOk.Location = new System.Drawing.Point(100, 246);
             this.btnOk.Name = "btnOk";
             this.btnOk.Size = new System.Drawing.Size(75, 23);
             this.btnOk.TabIndex = 5;
             // btnCancel
             // 
             this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
-            this.btnCancel.Location = new System.Drawing.Point(216, 159);
+            this.btnCancel.Location = new System.Drawing.Point(262, 246);
             this.btnCancel.Name = "btnCancel";
             this.btnCancel.Size = new System.Drawing.Size(75, 23);
             this.btnCancel.TabIndex = 6;
             this.chkSave.AutoSize = true;
             this.chkSave.Checked = true;
             this.chkSave.CheckState = System.Windows.Forms.CheckState.Checked;
-            this.chkSave.Location = new System.Drawing.Point(181, 72);
+            this.chkSave.Location = new System.Drawing.Point(154, 49);
             this.chkSave.Name = "chkSave";
             this.chkSave.Size = new System.Drawing.Size(81, 17);
             this.chkSave.TabIndex = 7;
             this.chkSave.Text = "Persist data";
             this.chkSave.UseVisualStyleBackColor = true;
             // 
+            // rdoXML
+            // 
+            this.rdoXML.AutoSize = true;
+            this.rdoXML.Location = new System.Drawing.Point(29, 29);
+            this.rdoXML.Name = "rdoXML";
+            this.rdoXML.Size = new System.Drawing.Size(72, 17);
+            this.rdoXML.TabIndex = 8;
+            this.rdoXML.TabStop = true;
+            this.rdoXML.Text = "XML-RPC";
+            this.rdoXML.UseVisualStyleBackColor = true;
+            // 
+            // rdoJSON
+            // 
+            this.rdoJSON.AutoSize = true;
+            this.rdoJSON.Checked = true;
+            this.rdoJSON.Location = new System.Drawing.Point(29, 55);
+            this.rdoJSON.Name = "rdoJSON";
+            this.rdoJSON.Size = new System.Drawing.Size(78, 17);
+            this.rdoJSON.TabIndex = 9;
+            this.rdoJSON.TabStop = true;
+            this.rdoJSON.Text = "JSON-RPC";
+            this.rdoJSON.UseVisualStyleBackColor = true;
+            // 
+            // gbRPC
+            // 
+            this.gbRPC.Controls.Add(this.rdoXML);
+            this.gbRPC.Controls.Add(this.rdoJSON);
+            this.gbRPC.Location = new System.Drawing.Point(230, 111);
+            this.gbRPC.Name = "gbRPC";
+            this.gbRPC.Size = new System.Drawing.Size(200, 100);
+            this.gbRPC.TabIndex = 10;
+            this.gbRPC.TabStop = false;
+            this.gbRPC.Text = "Connect via:";
+            // 
+            // gbAuth
+            // 
+            this.gbAuth.Controls.Add(this.lbUsername);
+            this.gbAuth.Controls.Add(this.txtUsername);
+            this.gbAuth.Controls.Add(this.lbPassword);
+            this.gbAuth.Controls.Add(this.txtPassword);
+            this.gbAuth.Location = new System.Drawing.Point(12, 111);
+            this.gbAuth.Name = "gbAuth";
+            this.gbAuth.Size = new System.Drawing.Size(209, 95);
+            this.gbAuth.TabIndex = 10;
+            this.gbAuth.TabStop = false;
+            // 
+            // gbUri
+            // 
+            this.gbUri.Controls.Add(this.lbUri);
+            this.gbUri.Controls.Add(this.txtUri);
+            this.gbUri.Controls.Add(this.chkAuthentication);
+            this.gbUri.Controls.Add(this.chkSave);
+            this.gbUri.Location = new System.Drawing.Point(12, 12);
+            this.gbUri.Name = "gbUri";
+            this.gbUri.Size = new System.Drawing.Size(418, 100);
+            this.gbUri.TabIndex = 11;
+            this.gbUri.TabStop = false;
+            // 
             // Logon
             // 
             this.AcceptButton = this.btnOk;
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.CancelButton = this.btnCancel;
-            this.ClientSize = new System.Drawing.Size(410, 194);
-            this.Controls.Add(this.chkSave);
+            this.ClientSize = new System.Drawing.Size(443, 281);
+            this.Controls.Add(this.gbUri);
+            this.Controls.Add(this.gbAuth);
+            this.Controls.Add(this.gbRPC);
             this.Controls.Add(this.btnCancel);
             this.Controls.Add(this.btnOk);
-            this.Controls.Add(this.chkAuthentication);
-            this.Controls.Add(this.txtPassword);
-            this.Controls.Add(this.lbPassword);
-            this.Controls.Add(this.txtUri);
-            this.Controls.Add(this.lbUri);
-            this.Controls.Add(this.txtUsername);
-            this.Controls.Add(this.lbUsername);
             this.Name = "Logon";
             this.Text = "Logon";
+            this.gbRPC.ResumeLayout(false);
+            this.gbRPC.PerformLayout();
+            this.gbAuth.ResumeLayout(false);
+            this.gbAuth.PerformLayout();
+            this.gbUri.ResumeLayout(false);
+            this.gbUri.PerformLayout();
             this.ResumeLayout(false);
-            this.PerformLayout();
 
         }
 
         private System.Windows.Forms.Button btnOk;
         private System.Windows.Forms.Button btnCancel;
         private System.Windows.Forms.CheckBox chkSave;
+        private System.Windows.Forms.RadioButton rdoXML;
+        private System.Windows.Forms.RadioButton rdoJSON;
+        private System.Windows.Forms.GroupBox gbRPC;
+        private System.Windows.Forms.GroupBox gbAuth;
+        private System.Windows.Forms.GroupBox gbUri;
     }
 }

File TracVS/Logon.cs

                 return chkSave.Checked;
             }
         }
+
+        public bool useJson
+        {
+            get
+            {
+                return rdoJSON.Checked;
+            }
+        }
         
         public Logon(string uri, string username = null, string password = null)
         {
         }
 
         private void btnOk_Click(object sender, EventArgs e)
-        {            
+        {
             if (chkAuthentication.Checked)
             {
                 this.Credential = new NetworkCredential(txtUsername.Text, txtPassword.Text);
             }
             this.Uri = txtUri.Text;
             this.DialogResult = DialogResult.OK;
-            //this.Close();
+            this.Close();
         }
 
         private void btnCancel_Click(object sender, EventArgs e)

File TracVS/NewTicket.cs

 
         private void cmbPriority_SelectedIndexChanged(object sender, EventArgs e)
         {
-            this.cmbPriority.BackColor = Constants.Colors[cmbPriority.SelectedIndex];
+            if (cmbPriority.SelectedIndex != -1)
+            {
+                this.cmbPriority.BackColor = Constants.Colors[cmbPriority.SelectedIndex];
+            }
         }
 
         private void cmbSeverity_SelectedIndexChanged(object sender, EventArgs e)
         {
-            this.cmbSeverity.BackColor = Constants.Colors[cmbSeverity.SelectedIndex];
+            if (cmbSeverity.SelectedIndex != -1)
+            {
+                this.cmbSeverity.BackColor = Constants.Colors[cmbSeverity.SelectedIndex];
+            }
         }
 
 

File TracVS/TracJSON.cs

+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Net;
+using LitJson;
+using System.Collections;
+
+namespace TracVS
+{
+    class TracJSON : ITracAPI
+    {
+
+        private WebClient client;
+
+        public string Uri
+        {
+            get;
+            set;
+        }
+
+        public ICredentials Credentials
+        {
+            get;
+            set;
+        }
+
+        public TracJSON()
+        {
+        }
+
+        public TracJSON(string uri) : this()
+        {
+            this.Uri = uri;
+        }
+
+        public TracJSON(string uri, string username, string password) : this(uri)
+        {
+            this.Credentials = new NetworkCredential(username, password);
+        }
+
+        private JsonData DoRequest(string name, params object[] args)
+        {
+            using (this.client = new WebClient())
+            {
+                client.Headers[HttpRequestHeader.ContentType] = "application/json";
+                client.Encoding = Encoding.UTF8;
+
+                this.client.Credentials = this.Credentials;
+
+                var data = new Dictionary<string, object>();
+                data["method"] = name;
+                data["params"] = args;
+                var json = JsonMapper.ToObject(this.client.UploadString(this.Uri, JsonMapper.ToJson(data)));
+                if (json["error"] == null)
+                {
+
+                    return json["result"];
+                }
+                else
+                {
+                    throw new ApplicationException(string.Format("Json RPC error from Trac Server: {0}", json["error"]));
+                }
+            }            
+        }
+
+        
+
+        #region Tickets
+
+        public int[] queryTickets(string queryString)
+        {
+            return this.DoRequest("ticket.query", queryString).Cast<JsonData>().Select(o => (int)o).ToArray();
+        }
+
+        public object[] getTicket(int id)
+        {
+            return this.DoRequest("ticket.get", id).Cast<JsonData>().ToArray();
+        }        
+
+        public int createTicket(string summary, string description, IDictionary attributes)
+        {
+            return (int)(this.DoRequest("ticket.create", summary, description, attributes) as JsonData);
+        }
+
+        public object[] updateTicket(int id, string comment, IDictionary attributes)
+        {
+            return this.DoRequest("ticket.update", id, comment, attributes).Cast<JsonData>().ToArray();
+        }
+
+        #endregion
+
+
+        public string[] getAllVersions()
+        {
+            return this.DoRequest("ticket.version.getAll").Cast<JsonData>().Select(o => (string)o).ToArray();
+        }
+
+        public string[] getAllTicketTypes()
+        {
+            return this.DoRequest("ticket.type.getAll").Cast<JsonData>().Select(o => (string)o).ToArray();
+        }
+
+        public string[] getAllComponents()
+        {
+            return this.DoRequest("ticket.component.getAll").Cast<JsonData>().Select(o => (string)o).ToArray();
+        }
+
+        public string[] getAllSeverities()
+        {
+            return this.DoRequest("ticket.severity.getAll").Cast<JsonData>().Select(o => (string)o).ToArray();
+        }
+
+        public string[] getAllPriorities()
+        {
+            return this.DoRequest("ticket.priority.getAll").Cast<JsonData>().Select(o => (string)o).ToArray();
+        }
+
+        public string[] getAllResolutions()
+        {
+            return this.DoRequest("ticket.resolution.getAll").Cast<JsonData>().Select(o => (string)o).ToArray();
+        }
+    }
+}

File TracVS/TracVS.csproj

     <Reference Include="Extensibility, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
       <EmbedInteropTypes>False</EmbedInteropTypes>
     </Reference>
+    <Reference Include="LitJson">
+      <HintPath>..\..\Sama90\Reference\LitJson.dll</HintPath>
+    </Reference>
     <Reference Include="System" />
     <Reference Include="System.Core" />
     <Reference Include="System.Data" />
     <Compile Include="EditTicket.Designer.cs">
       <DependentUpon>EditTicket.cs</DependentUpon>
     </Compile>
-    <Compile Include="ITrac.cs" />
+    <Compile Include="ITracXML.cs" />
+    <Compile Include="ITracAPI.cs" />
     <Compile Include="Logon.cs">
       <SubType>Form</SubType>
     </Compile>
     <Compile Include="TicketsView.Designer.cs">
       <DependentUpon>TicketsView.cs</DependentUpon>
     </Compile>
+    <Compile Include="TracJSON.cs" />
   </ItemGroup>
   <ItemGroup>
     <COMReference Include="EnvDTE">

File TracVS/TracVS.xml

             the contents of this method with the code editor.
             </summary>
         </member>
-        <member name="T:TracVS.ITrac">
+        <member name="F:TracVS.EditTicket.components">
+            <summary>
+            Required designer variable.
+            </summary>
+        </member>
+        <member name="M:TracVS.EditTicket.Dispose(System.Boolean)">
+            <summary>
+            Clean up any resources being used.
+            </summary>
+            <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+        </member>
+        <member name="M:TracVS.EditTicket.InitializeComponent">
+            <summary>
+            Required method for Designer support - do not modify
+            the contents of this method with the code editor.
+            </summary>
+        </member>
+        <member name="T:TracVS.ITracXML">
             <summary>
             XMLRPC Trac proxy for ver 0.2
             </summary>
         </member>
+        <member name="F:TracVS.TicketFixing.components">
+            <summary>
+            Required designer variable.
+            </summary>
+        </member>
+        <member name="M:TracVS.TicketFixing.Dispose(System.Boolean)">
+            <summary>
+            Clean up any resources being used.
+            </summary>
+            <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+        </member>
+        <member name="M:TracVS.TicketFixing.InitializeComponent">
+            <summary>
+            Required method for Designer support - do not modify
+            the contents of this method with the code editor.
+            </summary>
+        </member>
         <member name="T:TracVS.Connect">
             <summary>The object for implementing an Add-in.</summary>
             <seealso class='IDTExtensibility2' />
             <param term='handled'>Informs the caller if the command was handled or not.</param>
             <seealso class='Exec' />
         </member>
-        <member name="F:TracVS.EditTicket.components">
-            <summary>
-            Required designer variable.
-            </summary>
-        </member>
-        <member name="M:TracVS.EditTicket.Dispose(System.Boolean)">
-            <summary>
-            Clean up any resources being used.
-            </summary>
-            <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
-        </member>
-        <member name="M:TracVS.EditTicket.InitializeComponent">
-            <summary>
-            Required method for Designer support - do not modify
-            the contents of this method with the code editor.
-            </summary>
-        </member>
-        <member name="F:TracVS.TicketFixing.components">
-            <summary>
-            Required designer variable.
-            </summary>
-        </member>
-        <member name="M:TracVS.TicketFixing.Dispose(System.Boolean)">
-            <summary>
-            Clean up any resources being used.
-            </summary>
-            <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
-        </member>
-        <member name="M:TracVS.TicketFixing.InitializeComponent">
-            <summary>
-            Required method for Designer support - do not modify
-            the contents of this method with the code editor.
-            </summary>
-        </member>
     </members>
 </doc>

File TracVSSetup.exe

Binary file modified.