[svn] r7151: vs-plugin/trunk/Nemerle.VsIntegration: CtcComponents/PkgCmd.ctc CtcComponents/PkgCmdID.h GUI/...

VladD2 svnadmin at nemerle.org
Tue Dec 26 02:12:39 CET 2006


Log:
Add AstToolWindow (for debugging purpose).

Author: VladD2
Date: Tue Dec 26 02:12:35 2006
New Revision: 7151

Added:
   vs-plugin/trunk/Nemerle.VsIntegration/GUI/AstToolControl.Designer.cs
   vs-plugin/trunk/Nemerle.VsIntegration/GUI/AstToolControl.cs
   vs-plugin/trunk/Nemerle.VsIntegration/GUI/AstToolControl.resx
   vs-plugin/trunk/Nemerle.VsIntegration/GUI/AstToolWindow.cs
Modified:
   vs-plugin/trunk/Nemerle.VsIntegration/CtcComponents/PkgCmd.ctc
   vs-plugin/trunk/Nemerle.VsIntegration/CtcComponents/PkgCmdID.h
   vs-plugin/trunk/Nemerle.VsIntegration/LanguageService/NemerleViewFilter.cs
   vs-plugin/trunk/Nemerle.VsIntegration/Nemerle.VisualStudio.csproj
   vs-plugin/trunk/Nemerle.VsIntegration/NemerlePackage.cs
   vs-plugin/trunk/Nemerle.VsIntegration/Project/NemerleFileNode.cs
   vs-plugin/trunk/Nemerle.VsIntegration/Project/NemerleMenus.cs

Modified: vs-plugin/trunk/Nemerle.VsIntegration/CtcComponents/PkgCmd.ctc
==============================================================================
--- vs-plugin/trunk/Nemerle.VsIntegration/CtcComponents/PkgCmd.ctc	(original)
+++ vs-plugin/trunk/Nemerle.VsIntegration/CtcComponents/PkgCmd.ctc	Tue Dec 26 02:12:35 2006
@@ -116,6 +116,8 @@
 
     guidNemerleProjectCmdSet:cmdIdOptions,         guidNemerleProjectCmdSet:NemerleGroup,    0x100,   guidOfficeIcon:msotcidNoIcon, BUTTON,                ,                      "&Options...";
 
+    guidNemerleProjectCmdSet:cmdIdAstToolWindow,   guidSHLMainMenu:IDG_VS_WNDO_OTRWNDWS1,    0x100,   guidOfficeIcon:msotcidNoIcon, BUTTON,                ,                      "&Ast Tool Window";
+
   BUTTONS_END
 
   // The bitmaps section is used to define the bitmaps that are used for the commands.

Modified: vs-plugin/trunk/Nemerle.VsIntegration/CtcComponents/PkgCmdID.h
==============================================================================
--- vs-plugin/trunk/Nemerle.VsIntegration/CtcComponents/PkgCmdID.h	(original)
+++ vs-plugin/trunk/Nemerle.VsIntegration/CtcComponents/PkgCmdID.h	Tue Dec 26 02:12:35 2006
@@ -45,6 +45,8 @@
 
 #define cmdIdOptions         0x3105
 
+#define cmdIdAstToolWindow   0x3106
+
 /////////////////////////////////////////////////////////////////////
 // Bitmaps
 //

Added: vs-plugin/trunk/Nemerle.VsIntegration/GUI/AstToolControl.Designer.cs
==============================================================================
--- (empty file)
+++ vs-plugin/trunk/Nemerle.VsIntegration/GUI/AstToolControl.Designer.cs	Tue Dec 26 02:12:35 2006
@@ -0,0 +1,102 @@
+namespace Nemerle.VisualStudio.GUI
+{
+	partial class AstToolControl
+	{
+		/// <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 Component 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.panel1 = new System.Windows.Forms.Panel();
+			this.dataGridView1 = new System.Windows.Forms.DataGridView();
+			this._autoUpdateCheckBox = new System.Windows.Forms.CheckBox();
+			this._astColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
+			this.panel1.SuspendLayout();
+			((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
+			this.SuspendLayout();
+			// 
+			// panel1
+			// 
+			this.panel1.Controls.Add(this._autoUpdateCheckBox);
+			this.panel1.Dock = System.Windows.Forms.DockStyle.Top;
+			this.panel1.Location = new System.Drawing.Point(0, 0);
+			this.panel1.Name = "panel1";
+			this.panel1.Size = new System.Drawing.Size(245, 28);
+			this.panel1.TabIndex = 0;
+			// 
+			// dataGridView1
+			// 
+			this.dataGridView1.AllowUserToAddRows = false;
+			this.dataGridView1.AllowUserToDeleteRows = false;
+			this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
+			this.dataGridView1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
+            this._astColumn});
+			this.dataGridView1.Dock = System.Windows.Forms.DockStyle.Fill;
+			this.dataGridView1.Location = new System.Drawing.Point(0, 28);
+			this.dataGridView1.Name = "dataGridView1";
+			this.dataGridView1.ReadOnly = true;
+			this.dataGridView1.Size = new System.Drawing.Size(245, 287);
+			this.dataGridView1.TabIndex = 1;
+			// 
+			// _autoUpdateCheckBox
+			// 
+			this._autoUpdateCheckBox.AutoSize = true;
+			this._autoUpdateCheckBox.Location = new System.Drawing.Point(16, 9);
+			this._autoUpdateCheckBox.Name = "_autoUpdateCheckBox";
+			this._autoUpdateCheckBox.Size = new System.Drawing.Size(84, 17);
+			this._autoUpdateCheckBox.TabIndex = 0;
+			this._autoUpdateCheckBox.Text = "Auto update";
+			this._autoUpdateCheckBox.UseVisualStyleBackColor = true;
+			// 
+			// _astColumn
+			// 
+			this._astColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
+			this._astColumn.HeaderText = "AST";
+			this._astColumn.Name = "_astColumn";
+			this._astColumn.ReadOnly = true;
+			this._astColumn.Width = 53;
+			// 
+			// AstToolControl
+			// 
+			this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+			this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+			this.Controls.Add(this.dataGridView1);
+			this.Controls.Add(this.panel1);
+			this.Name = "AstToolControl";
+			this.Size = new System.Drawing.Size(245, 315);
+			this.panel1.ResumeLayout(false);
+			this.panel1.PerformLayout();
+			((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit();
+			this.ResumeLayout(false);
+
+		}
+
+		#endregion
+
+		private System.Windows.Forms.Panel panel1;
+		private System.Windows.Forms.DataGridView dataGridView1;
+		private System.Windows.Forms.CheckBox _autoUpdateCheckBox;
+		private System.Windows.Forms.DataGridViewTextBoxColumn _astColumn;
+	}
+}

Added: vs-plugin/trunk/Nemerle.VsIntegration/GUI/AstToolControl.cs
==============================================================================
--- (empty file)
+++ vs-plugin/trunk/Nemerle.VsIntegration/GUI/AstToolControl.cs	Tue Dec 26 02:12:35 2006
@@ -0,0 +1,18 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Drawing;
+using System.Data;
+using System.Text;
+using System.Windows.Forms;
+
+namespace Nemerle.VisualStudio.GUI
+{
+	public partial class AstToolControl : UserControl
+	{
+		public AstToolControl()
+		{
+			InitializeComponent();
+		}
+	}
+}

Added: vs-plugin/trunk/Nemerle.VsIntegration/GUI/AstToolControl.resx
==============================================================================
--- (empty file)
+++ vs-plugin/trunk/Nemerle.VsIntegration/GUI/AstToolControl.resx	Tue Dec 26 02:12:35 2006
@@ -0,0 +1,123 @@
+<?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=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>
+  <metadata name="_astColumn.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+</root>
\ No newline at end of file

Added: vs-plugin/trunk/Nemerle.VsIntegration/GUI/AstToolWindow.cs
==============================================================================
--- (empty file)
+++ vs-plugin/trunk/Nemerle.VsIntegration/GUI/AstToolWindow.cs	Tue Dec 26 02:12:35 2006
@@ -0,0 +1,65 @@
+using System;
+using System.Collections;
+using System.ComponentModel;
+using System.Drawing;
+using System.Data;
+using System.Windows.Forms;
+using System.Runtime.InteropServices;
+using Microsoft.VisualStudio.Shell.Interop;
+using Microsoft.VisualStudio.Shell;
+
+namespace Nemerle.VisualStudio.GUI
+{
+	/// <summary>
+	/// This class implements the tool window exposed by this package and hosts a user control.
+	///
+	/// In Visual Studio tool windows are composed of a frame (implemented by the shell) and a pane, 
+	/// usually implemented by the package implementer.
+	///
+	/// This class derives from the ToolWindowPane class provided from the MPF in order to use its 
+	/// implementation of the IVsWindowPane interface.
+	/// </summary>
+	[Guid("721e9eb7-98fa-4efb-9e17-d60a6894ccd0")]
+	public class AstToolWindow : ToolWindowPane
+	{
+		// This is the user control hosted by the tool window; it is exposed to the base class 
+		// using the Window property. Note that, even if this class implements IDispose, we are
+		// not calling Dispose on this object. This is because ToolWindowPane calls Dispose on 
+		// the object returned by the Window property.
+		private AstToolControl control;
+
+		/// <summary>
+		/// Standard constructor for the tool window.
+		/// </summary>
+		public AstToolWindow()
+			:
+				base(null)
+		{
+			// Set the window title reading it from the resources.
+			this.Caption = "AST";
+			// Set the image that will appear on the tab of the window frame
+			// when docked with an other window
+			// The resource ID correspond to the one defined in the resx file
+			// while the Index is the offset in the bitmap strip. Each image in
+			// the strip being 16x16.
+			this.BitmapResourceID = 301;
+			this.BitmapIndex = 1;
+
+
+			control = new AstToolControl();
+		}
+
+		/// <summary>
+		/// This property returns the handle to the user control that should
+		/// be hosted in the Tool Window.
+		/// </summary>
+		override public IWin32Window Window
+		{
+			get
+			{
+				return (IWin32Window)control;
+			}
+		}
+
+	}
+}

Modified: vs-plugin/trunk/Nemerle.VsIntegration/LanguageService/NemerleViewFilter.cs
==============================================================================
--- vs-plugin/trunk/Nemerle.VsIntegration/LanguageService/NemerleViewFilter.cs	(original)
+++ vs-plugin/trunk/Nemerle.VsIntegration/LanguageService/NemerleViewFilter.cs	Tue Dec 26 02:12:35 2006
@@ -9,6 +9,7 @@
 
 using Nemerle.Completion2;
 using Nemerle.Compiler;
+using Nemerle.VisualStudio.Project;
 
 namespace Nemerle.VisualStudio.LanguageService
 {
@@ -36,6 +37,13 @@
 				case 0x3103: txt = "cmdIdRename"; break;
 				case 0x3104: txt = "cmdIdInline"; break;
 				case 0x3105: txt = "cmdIdOptions"; break;
+				case 0x3106: // AstToolWindow
+					//this.CodeWindowManager.LanguageService.
+					NemerleSource source = Source as NemerleSource;
+					if (source != null)
+						source.ProjectInfo.ProjectNode.Package.OnAstToolWindowShow(null, null);
+
+					break;
 			}
 			if (txt != null)
 			    System.Diagnostics.Trace.Assert(false, "Implement the menu!\r\nID: " + txt);

Modified: vs-plugin/trunk/Nemerle.VsIntegration/Nemerle.VisualStudio.csproj
==============================================================================
--- vs-plugin/trunk/Nemerle.VsIntegration/Nemerle.VisualStudio.csproj	(original)
+++ vs-plugin/trunk/Nemerle.VsIntegration/Nemerle.VisualStudio.csproj	Tue Dec 26 02:12:35 2006
@@ -265,8 +265,19 @@
     <ZipProject Include="Templates\Projects\WindowsApplication\Program.n" />
   </ItemGroup>
   <ItemGroup>
+    <Compile Include="GUI\AstToolControl.cs">
+      <SubType>UserControl</SubType>
+    </Compile>
+    <Compile Include="GUI\AstToolControl.Designer.cs">
+      <DependentUpon>AstToolControl.cs</DependentUpon>
+    </Compile>
+    <Compile Include="GUI\AstToolWindow.cs" />
     <Compile Include="RegistrationAttributes\SingleFileGeneratorSupportRegistrationAttribute.cs" />
     <None Include="Resources\Nemerle.ico" />
+    <EmbeddedResource Include="GUI\AstToolControl.resx">
+      <SubType>Designer</SubType>
+      <DependentUpon>AstToolControl.cs</DependentUpon>
+    </EmbeddedResource>
     <EmbeddedResource Include="GUI\GoToTypeForm.resx">
       <SubType>Designer</SubType>
       <DependentUpon>GoToTypeForm.cs</DependentUpon>

Modified: vs-plugin/trunk/Nemerle.VsIntegration/NemerlePackage.cs
==============================================================================
--- vs-plugin/trunk/Nemerle.VsIntegration/NemerlePackage.cs	(original)
+++ vs-plugin/trunk/Nemerle.VsIntegration/NemerlePackage.cs	Tue Dec 26 02:12:35 2006
@@ -15,6 +15,7 @@
 using Nemerle.VisualStudio.Project;
 
 using System.Diagnostics;
+using Nemerle.VisualStudio.GUI;
 
 namespace Nemerle.VisualStudio
 {
@@ -98,9 +99,13 @@
 	//phantom: try to play with it only after menu will be fixed (handlers leashing)
 	//[ProvideKeyBindingTable(NemerleConstants.EditorFactoryGuidString, 102)]
 
+	// This attribute registers a tool window exposed by this package.
+	[ProvideToolWindow(typeof(AstToolWindow))]
+
 	#endregion
 
 	public class NemerlePackage : ProjectPackage, IOleComponent, IVsInstalledProduct
+		, IOleCommandTarget
 	{
 		private uint                  _componentID;
 		private NemerleLibraryManager _libraryManager;
@@ -130,14 +135,13 @@
 
 			if (menuService != null)
 			{
-				RegisterCommand(menuService, NemerleMenus.ExtendSelection, new EventHandler(OnExtendSelection));
+				RegisterCommand(menuService, MenuCmd.ExtendSelection, OnExtendSelection);
+				RegisterCommand(menuService, MenuCmd.AstToolWindow,   OnAstToolWindowShow);
 				// TODO: change handlers
-				RegisterCommand(menuService, NemerleMenus.ShrinkSelection, new EventHandler(OnExtendSelection));
-
-				RegisterCommand(menuService, NemerleMenus.Rename, new EventHandler(OnExtendSelection));
-				RegisterCommand(menuService, NemerleMenus.Inline, new EventHandler(OnExtendSelection));
-
-				RegisterCommand(menuService, NemerleMenus.Options, new EventHandler(OnExtendSelection));
+				RegisterCommand(menuService, MenuCmd.ShrinkSelection, OnExtendSelection);
+				RegisterCommand(menuService, MenuCmd.Rename,          OnExtendSelection);
+				RegisterCommand(menuService, MenuCmd.Inline,          OnExtendSelection);
+				RegisterCommand(menuService, MenuCmd.Options,         OnExtendSelection);
 			}
 			else
 				Trace.WriteLine("Command Service is null!");
@@ -147,7 +151,25 @@
 		{
 			MenuCommand command = new MenuCommand(handler, commandId);
 			service.AddCommand(command);
-			Debug.WriteLine(string.Format("Menu command {0} added", command));
+			//Debug.WriteLine(string.Format("Menu command {0} added", command));
+		}
+
+		/// <summary>
+		/// This function is called when the user clicks the menu item that shows the 
+		/// tool window. See the Initialize method to see how the menu item is associated to 
+		/// this function using the OleMenuCommandService service and the MenuCommand class.
+		/// </summary>
+		internal void OnAstToolWindowShow(object sender, EventArgs e)
+		{
+			// Get the instance number 0 of this tool window. This window is single instance so this instance
+			// is actually the only one.
+			// The last flag is set to true so that if the tool window does not exists it will be created.
+			ToolWindowPane window = this.FindToolWindow(typeof(AstToolWindow), 0, true);
+			if (window == null || window.Frame == null)
+				throw new COMException("Can not create window.");
+
+			IVsWindowFrame windowFrame = (IVsWindowFrame)window.Frame;
+			Microsoft.VisualStudio.ErrorHandler.ThrowOnFailure(windowFrame.Show());
 		}
 
 		//phantom: this handler doesn't want to be leashed, try to do tie it up, guys!
@@ -302,7 +324,7 @@
 			return 0;
 		}
 
-		public int  FPreTranslateMessage(MSG[] pMsg)                        { return 0; }
+		public int  FPreTranslateMessage(MSG[] pMsg)                        { return 1; }
 		public int  FQueryTerminate     (int fPromptUser)                   { return 1; }
 
 		public void OnAppActivate       (int fActive, uint dwOtherThreadID) {}
@@ -365,5 +387,16 @@
 		}
 
 		#endregion
+
+		int IOleCommandTarget.Exec(ref Guid pguidCmdGroup, uint nCmdID, uint nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut)
+		{
+			throw new Exception("The method or operation is not implemented.");
+		}
+
+		int IOleCommandTarget.QueryStatus(ref Guid pguidCmdGroup, uint cCmds, OLECMD[] prgCmds, IntPtr pCmdText)
+		{
+			//throw new Exception("The method or operation is not implemented.");
+			return 0;
+		}
 	}
 }

Modified: vs-plugin/trunk/Nemerle.VsIntegration/Project/NemerleFileNode.cs
==============================================================================
--- vs-plugin/trunk/Nemerle.VsIntegration/Project/NemerleFileNode.cs	(original)
+++ vs-plugin/trunk/Nemerle.VsIntegration/Project/NemerleFileNode.cs	Tue Dec 26 02:12:35 2006
@@ -173,7 +173,7 @@
 			if (ProjectMgr == null)
 				throw new InvalidOperationException();
 
-			if (guidCmdGroup == NemerleMenus.guidNemerleProjectCmdSet && cmd == (uint)NemerleMenus.SetAsMain.ID)
+			if (guidCmdGroup == MenuCmd.guidNemerleProjectCmdSet && cmd == (uint)MenuCmd.SetAsMain.ID)
 			{
 				// Set the MainFile project property to the Filename of this Node.
 				//
@@ -207,8 +207,8 @@
 						return VSConstants.S_OK;
 				}
 			}
-			else if (guidCmdGroup == NemerleMenus.guidNemerleProjectCmdSet)
-				if (cmd == (uint)NemerleMenus.SetAsMain.ID)
+			else if (guidCmdGroup == MenuCmd.guidNemerleProjectCmdSet)
+				if (cmd == (uint)MenuCmd.SetAsMain.ID)
 				{
 					result |= QueryStatusResult.SUPPORTED | QueryStatusResult.ENABLED;
 					return VSConstants.S_OK;

Modified: vs-plugin/trunk/Nemerle.VsIntegration/Project/NemerleMenus.cs
==============================================================================
--- vs-plugin/trunk/Nemerle.VsIntegration/Project/NemerleMenus.cs	(original)
+++ vs-plugin/trunk/Nemerle.VsIntegration/Project/NemerleMenus.cs	Tue Dec 26 02:12:35 2006
@@ -6,19 +6,18 @@
 	/// <summary>
 	/// CommandIDs matching the commands defined items from PkgCmdID.h and guids.h
 	/// </summary>
-	public sealed class NemerleMenus
+	public sealed class MenuCmd
 	{
 		internal static readonly Guid guidNemerleProjectCmdSet = new Guid(NemerleConstants.ProjectCmdSetGuidString);
+		static CommandID MakeCmd(int id) { return new CommandID(guidNemerleProjectCmdSet, id); }
 
-		internal static readonly CommandID SetAsMain = new CommandID(guidNemerleProjectCmdSet, 0x3001);
-
-		internal static readonly CommandID ExtendSelection = new CommandID(guidNemerleProjectCmdSet, 0x3101);
-		internal static readonly CommandID ShrinkSelection = new CommandID(guidNemerleProjectCmdSet, 0x3102);
-
-		internal static readonly CommandID Rename = new CommandID(guidNemerleProjectCmdSet, 0x3103);
-		internal static readonly CommandID Inline = new CommandID(guidNemerleProjectCmdSet, 0x3104);
-
-		internal static readonly CommandID Options = new CommandID(guidNemerleProjectCmdSet, 0x3105);
+		internal static readonly CommandID SetAsMain       = MakeCmd(0x3001);
+		internal static readonly CommandID ExtendSelection = MakeCmd(0x3101);
+		internal static readonly CommandID ShrinkSelection = MakeCmd(0x3102);
+		internal static readonly CommandID Rename          = MakeCmd(0x3103);
+		internal static readonly CommandID Inline          = MakeCmd(0x3104);
+		internal static readonly CommandID Options         = MakeCmd(0x3105);
+		internal static readonly CommandID AstToolWindow   = MakeCmd(0x3106);
 	}
 }
 



More information about the svn mailing list