[svn] r7198: vs-plugin/trunk/Nemerle.VsIntegration: !ToDo/ToDo.txt GUI/AstToolControl.Designer.cs NemerleC...

pbludov svnadmin at nemerle.org
Wed Jan 3 06:34:13 CET 2007


Log:
Debug property page for project settings. Now it's possible to debug class libraries.

Author: pbludov
Date: Wed Jan  3 06:34:05 2007
New Revision: 7198

Modified:
   vs-plugin/trunk/Nemerle.VsIntegration/!ToDo/ToDo.txt
   vs-plugin/trunk/Nemerle.VsIntegration/GUI/AstToolControl.Designer.cs
   vs-plugin/trunk/Nemerle.VsIntegration/NemerleConstants.cs
   vs-plugin/trunk/Nemerle.VsIntegration/NemerlePackage.cs
   vs-plugin/trunk/Nemerle.VsIntegration/Project/ConfigurationPropertyPages.cs
   vs-plugin/trunk/Nemerle.VsIntegration/Project/NemerleProjectNode.cs
   vs-plugin/trunk/Nemerle.VsIntegration/Project/PropertyPages.cs
   vs-plugin/trunk/Nemerle.VsIntegration/Resources.Designer.cs
   vs-plugin/trunk/Nemerle.VsIntegration/Resources.cs
   vs-plugin/trunk/Nemerle.VsIntegration/Resources.resx

Modified: vs-plugin/trunk/Nemerle.VsIntegration/!ToDo/ToDo.txt
==============================================================================
--- vs-plugin/trunk/Nemerle.VsIntegration/!ToDo/ToDo.txt	(original)
+++ vs-plugin/trunk/Nemerle.VsIntegration/!ToDo/ToDo.txt	Wed Jan  3 06:34:05 2007
@@ -1,2 +1,4 @@
 1.  Ðåàëèçîâàòü âûâîä èíôîðìàöèè î ÀÑÒ ôàéëà â äîêèíã-îêíî "Ast Tool Window".
 		Îáíîâëåíèå îêíà äåëàåò íà Check().
\ No newline at end of file
+2.	Ïîæåíèòü íîâûé èíñòàëëÿòîð ñ èìåþùèìñÿ. Äîáàâèòü âîçìîæíîñòü çàäàòü êàòàëîã è âûáðàòü êîìïîíåíòû.
+3.	Ãåíåðàöèÿ êîäà ñ ìåòàäàííûõ.

Modified: vs-plugin/trunk/Nemerle.VsIntegration/GUI/AstToolControl.Designer.cs
==============================================================================
--- vs-plugin/trunk/Nemerle.VsIntegration/GUI/AstToolControl.Designer.cs	(original)
+++ vs-plugin/trunk/Nemerle.VsIntegration/GUI/AstToolControl.Designer.cs	Wed Jan  3 06:34:05 2007
@@ -104,7 +104,7 @@
 			// 
 			// _astColumn
 			// 
-			this._astColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
+			this._astColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
 			this._astColumn.HeaderText = "AST";
 			this._astColumn.Name = "_astColumn";
 			this._astColumn.ReadOnly = true;

Modified: vs-plugin/trunk/Nemerle.VsIntegration/NemerleConstants.cs
==============================================================================
--- vs-plugin/trunk/Nemerle.VsIntegration/NemerleConstants.cs	(original)
+++ vs-plugin/trunk/Nemerle.VsIntegration/NemerleConstants.cs	Wed Jan  3 06:34:05 2007
@@ -39,6 +39,7 @@
 		public const string FolderNodePropertiesGuidString         = "EDCC3B86-0BAD-11DB-BC1A-00112FDE8B61";
 		public const string ProjectNodePropertiesGuidString        = "EDCC3B87-0BAD-11DB-BC1A-00112FDE8B61";
 		public const string GeneralPropertyPageGuidString          = "EDCC3B88-0BAD-11DB-BC1A-00112FDE8B61";
+		public const string DebugPropertyPageGuidString            = "EDCC3B89-0BAD-11DB-BC1A-00112FDE8B61";
 
 		public const string ProjectImageListName = "Resources.NemerleImageList.bmp";
 

Modified: vs-plugin/trunk/Nemerle.VsIntegration/NemerlePackage.cs
==============================================================================
--- vs-plugin/trunk/Nemerle.VsIntegration/NemerlePackage.cs	(original)
+++ vs-plugin/trunk/Nemerle.VsIntegration/NemerlePackage.cs	Wed Jan  3 06:34:05 2007
@@ -77,6 +77,7 @@
 		LanguageVsTemplate = NemerleConstants.LanguageName)]
 	[ProvideMenuResource(1000, 1)]
 	[ProvideObject           (typeof(GeneralPropertyPage))]
+	[ProvideObject           (typeof(DebugPropertyPage))]
 	[ProvideObject           (typeof(NemerleBuildPropertyPage))]
 	[ProvideEditorExtension  (typeof(NemerleEditorFactory), NemerleConstants.FileExtension, 32)]
 	[ProvideEditorLogicalView(typeof(NemerleEditorFactory), NemerleConstants.EditorLogicalViewGuidString)] //LOGVIEWID_Designer

Modified: vs-plugin/trunk/Nemerle.VsIntegration/Project/ConfigurationPropertyPages.cs
==============================================================================
--- vs-plugin/trunk/Nemerle.VsIntegration/Project/ConfigurationPropertyPages.cs	(original)
+++ vs-plugin/trunk/Nemerle.VsIntegration/Project/ConfigurationPropertyPages.cs	Wed Jan  3 06:34:05 2007
@@ -1,6 +1,11 @@
 using System;
+using System.ComponentModel;
+using System.Diagnostics;
+using System.Drawing.Design;
 using System.Runtime.InteropServices;
+using System.Windows.Forms.Design;
 
+using Microsoft.VisualStudio;
 using Microsoft.VisualStudio.Package;
 
 namespace Nemerle.VisualStudio.Project
@@ -10,4 +15,101 @@
 	public class NemerleBuildPropertyPage : BuildPropertyPage
 	{
 	}
+
+	/// <summary>
+	/// Enumerated list of the properties shown on the debug property page
+	/// </summary>
+	internal enum DebugPropertyPageTag
+	{
+		StartProgram,
+		WorkingDirectory,
+		CmdArgs,
+	}
+
+	/// <summary>
+	/// Defines the properties on the debug property page and the logic the binds the properties to project data (load and save)
+	/// </summary>
+	[ComVisible(true)]
+	[Guid(NemerleConstants.DebugPropertyPageGuidString)]
+	public class DebugPropertyPage : SettingsPage
+	{
+		#region fields
+		private string startProgram;
+		private string workingDirectory;
+		private string cmdArgs;
+
+		public DebugPropertyPage()
+		{
+			Name = SR.GetString(SR.DebugCaption);
+		}
+		#endregion
+
+		#region properties
+
+		[SRCategoryAttribute(SR.DebugCaption)]
+		[SRDisplayName(SR.StartProgram)]
+		[SRDescriptionAttribute(SR.StartProgramDescription)]
+		[Editor(typeof(FileNameEditor), typeof(UITypeEditor))]
+		public string StartProgram
+		{
+			get { return startProgram; }
+			set { startProgram = value; IsDirty = true; }
+		}
+
+
+		[SRCategoryAttribute(SR.DebugCaption)]
+		[SRDisplayName(SR.WorkingDirectory)]
+		[SRDescriptionAttribute(SR.WorkingDirectoryDescription)]
+		[Editor(typeof(FolderNameEditor), typeof(UITypeEditor))]
+		public string WorkingDirectory
+		{
+			get { return workingDirectory; }
+			set { workingDirectory = value; IsDirty = true; }
+		}
+
+		[SRCategoryAttribute(SR.DebugCaption)]
+		[SRDisplayName(SR.CmdArgs)]
+		[SRDescriptionAttribute(SR.CmdArgsDescription)]
+		public string CmdArgs
+		{
+			get { return cmdArgs; }
+			set { cmdArgs = value; IsDirty = true; }
+		}
+		#endregion
+
+		#region overridden methods
+		public override string GetClassName()
+		{
+			return GetType().FullName;
+		}
+
+		protected override void BindProperties()
+		{
+			if (ProjectMgr == null)
+			{
+				Debug.Assert(false);
+				return;
+			}
+
+			startProgram = GetConfigProperty(DebugPropertyPageTag.StartProgram.ToString());
+			workingDirectory = GetConfigProperty(DebugPropertyPageTag.WorkingDirectory.ToString());
+			cmdArgs = GetConfigProperty(DebugPropertyPageTag.CmdArgs.ToString());
+		}
+
+		protected override int ApplyChanges()
+		{
+			if (ProjectMgr == null)
+			{
+				Debug.Assert(false);
+				return VSConstants.E_INVALIDARG;
+			}
+
+			SetConfigProperty(DebugPropertyPageTag.StartProgram.ToString(), startProgram);
+			SetConfigProperty(DebugPropertyPageTag.WorkingDirectory.ToString(), workingDirectory);
+			SetConfigProperty(DebugPropertyPageTag.CmdArgs.ToString(), cmdArgs);
+			IsDirty = false;
+			return VSConstants.S_OK;
+		}
+		#endregion
+	}
 }

Modified: vs-plugin/trunk/Nemerle.VsIntegration/Project/NemerleProjectNode.cs
==============================================================================
--- vs-plugin/trunk/Nemerle.VsIntegration/Project/NemerleProjectNode.cs	(original)
+++ vs-plugin/trunk/Nemerle.VsIntegration/Project/NemerleProjectNode.cs	Wed Jan  3 06:34:05 2007
@@ -13,6 +13,7 @@
 using Microsoft.VisualStudio.Package.Automation;
 using Microsoft.VisualStudio.Shell.Interop;
 using Microsoft.VisualStudio.Shell;
+using MSBuild = Microsoft.Build.BuildEngine;
 
 using Nemerle.VisualStudio.LanguageService;
 
@@ -254,7 +255,11 @@
 		/// <returns></returns>
 		protected override Guid[] GetConfigurationDependentPropertyPages()
 		{
-			return new Guid[] { typeof(NemerleBuildPropertyPage).GUID };
+			return new Guid[]
+			{
+				typeof(NemerleBuildPropertyPage).GUID,
+				typeof(DebugPropertyPage).GUID,
+			};
 		}
 
 		/// <summary>
@@ -350,6 +355,15 @@
 			return newNode;
 		}
 
+		// Copypasted from VisualStudioIntegration\Common\Source\CSharp\Project\ProjectNode.cs
+		// due to bug with outputtype case
+		//
+		public override string GetAssemblyName(string config)
+		{
+			base.GetAssemblyName(config);
+
+			return OutputFileName;
+		}
 
 		/// <summary>
 		/// Creates the format list for the open file dialog

Modified: vs-plugin/trunk/Nemerle.VsIntegration/Project/PropertyPages.cs
==============================================================================
--- vs-plugin/trunk/Nemerle.VsIntegration/Project/PropertyPages.cs	(original)
+++ vs-plugin/trunk/Nemerle.VsIntegration/Project/PropertyPages.cs	Wed Jan  3 06:34:05 2007
@@ -30,40 +30,6 @@
 	[Guid(NemerleConstants.GeneralPropertyPageGuidString)]
 	public class GeneralPropertyPage : MSP.SettingsPage, IInternalExtenderProvider
 	{
-		#region LocDisplayNameAttribute
-
-		[AttributeUsage(
-			AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field,
-			Inherited     = false,
-			AllowMultiple = false)]
-		sealed class LocDisplayNameAttribute : DisplayNameAttribute
-		{
-			string name;
-
-			public LocDisplayNameAttribute(string name)
-			{
-				this.name = name;
-			}
-
-			public override string DisplayName
-			{
-				get
-				{
-					string result = SR.GetString(name);
-
-					if (result == null)
-					{
-						Debug.Assert(false, "String resource '" + name + "' is missing");
-						result = name;
-					}
-
-					return result;
-				}
-			}
-		}
-
-		#endregion
-
 		#region Fields
 
 		string           _assemblyName;
@@ -162,7 +128,7 @@
 		#region exposed properties
 
 		[SRCategoryAttribute(SR.Application)]
-		[LocDisplayName(SR.AssemblyName)]
+		[SRDisplayName(SR.AssemblyName)]
 		[SRDescriptionAttribute(SR.AssemblyNameDescription)]
 		public string AssemblyName
 		{
@@ -171,7 +137,7 @@
 		}
 
 		[SRCategoryAttribute(SR.Application)]
-		[LocDisplayName(SR.OutputType)]
+		[SRDisplayName(SR.OutputType)]
 		[SRDescriptionAttribute(SR.OutputTypeDescription)]
 		public MSP.OutputType OutputType
 		{
@@ -180,7 +146,7 @@
 		}
 
 		[SRCategoryAttribute(SR.Application)]
-		[LocDisplayName(SR.DefaultNamespace)]
+		[SRDisplayName(SR.DefaultNamespace)]
 		[SRDescriptionAttribute(SR.DefaultNamespaceDescription)]
 		public string DefaultNamespace
 		{
@@ -189,7 +155,7 @@
 		}
 
 		[SRCategoryAttribute(SR.Application)]
-		[LocDisplayName(SR.StartupObject)]
+		[SRDisplayName(SR.StartupObject)]
 		[SRDescriptionAttribute(SR.StartupObjectDescription)]
 		public string StartupObject
 		{
@@ -198,7 +164,7 @@
 		}
 
 		[SRCategoryAttribute(SR.Application)]
-		[LocDisplayName(SR.ApplicationIcon)]
+		[SRDisplayName(SR.ApplicationIcon)]
 		[SRDescriptionAttribute(SR.ApplicationIconDescription)]
 		public string ApplicationIcon
 		{
@@ -207,7 +173,7 @@
 		}
 
 		[SRCategoryAttribute(SR.Project)]
-		[LocDisplayName(SR.ProjectFile)]
+		[SRDisplayName(SR.ProjectFile)]
 		[SRDescriptionAttribute(SR.ProjectFileDescription)]
 		[MSP.AutomationBrowsable(false)]
 		public string ProjectFile
@@ -216,7 +182,7 @@
 		}
 
 		[SRCategoryAttribute(SR.Project)]
-		[LocDisplayName(SR.ProjectFolder)]
+		[SRDisplayName(SR.ProjectFolder)]
 		[SRDescriptionAttribute(SR.ProjectFolderDescription)]
 		[MSP.AutomationBrowsable(false)]
 		public string ProjectFolder
@@ -225,7 +191,7 @@
 		}
 
 		[SRCategoryAttribute(SR.Project)]
-		[LocDisplayName(SR.OutputFile)]
+		[SRDisplayName(SR.OutputFile)]
 		[SRDescriptionAttribute(SR.OutputFileDescription)]
 		[MSP.AutomationBrowsable(false)]
 		public string OutputFile
@@ -234,7 +200,7 @@
 		}
 
 		[SRCategoryAttribute(SR.Project)]
-		[LocDisplayName(SR.TargetPlatform)]
+		[SRDisplayName(SR.TargetPlatform)]
 		[SRDescriptionAttribute(SR.TargetPlatformDescription)]
 		[MSP.AutomationBrowsable(false)]
 		public MSP.PlatformType TargetPlatform
@@ -244,7 +210,7 @@
 		}
 
 		[SRCategoryAttribute(SR.Project)]
-		[LocDisplayName(SR.TargetPlatformLocation)]
+		[SRDisplayName(SR.TargetPlatformLocation)]
 		[SRDescriptionAttribute(SR.TargetPlatformLocationDescription)]
 		[MSP.AutomationBrowsable(false)]
 		public string TargetPlatformLocation
@@ -333,4 +299,5 @@
 
 		#endregion
 	}
+
 }
\ No newline at end of file

Modified: vs-plugin/trunk/Nemerle.VsIntegration/Resources.Designer.cs
==============================================================================
--- vs-plugin/trunk/Nemerle.VsIntegration/Resources.Designer.cs	(original)
+++ vs-plugin/trunk/Nemerle.VsIntegration/Resources.Designer.cs	Wed Jan  3 06:34:05 2007
@@ -1,7 +1,7 @@
 //------------------------------------------------------------------------------
 // <auto-generated>
 //     This code was generated by a tool.
-//     Runtime Version:2.0.50727.308
+//     Runtime Version:2.0.50727.42
 //
 //     Changes to this file may cause incorrect behavior and will be lost if
 //     the code is regenerated.
@@ -165,6 +165,33 @@
         }
         
         /// <summary>
+        ///   Looks up a localized string similar to Command Arguments.
+        /// </summary>
+        internal static string CmdArgs {
+            get {
+                return ResourceManager.GetString("CmdArgs", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   Looks up a localized string similar to Optional arguments passed to starting program..
+        /// </summary>
+        internal static string CmdArgsDescription {
+            get {
+                return ResourceManager.GetString("CmdArgsDescription", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   Looks up a localized string similar to Debug.
+        /// </summary>
+        internal static string DebugCaption {
+            get {
+                return ResourceManager.GetString("DebugCaption", resourceCulture);
+            }
+        }
+        
+        /// <summary>
         ///   Looks up a localized string similar to Default Namespace.
         /// </summary>
         internal static string DefaultNamespace {
@@ -337,6 +364,24 @@
         }
         
         /// <summary>
+        ///   Looks up a localized string similar to Start Program.
+        /// </summary>
+        internal static string StartProgram {
+            get {
+                return ResourceManager.GetString("StartProgram", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   Looks up a localized string similar to The location of the starting program..
+        /// </summary>
+        internal static string StartProgramDescription {
+            get {
+                return ResourceManager.GetString("StartProgramDescription", resourceCulture);
+            }
+        }
+        
+        /// <summary>
         ///   Looks up a localized string similar to Startup Object.
         /// </summary>
         internal static string StartupObject {
@@ -398,5 +443,23 @@
                 return ResourceManager.GetString("TargetPlatformLocationDescription", resourceCulture);
             }
         }
+        
+        /// <summary>
+        ///   Looks up a localized string similar to Working Directory.
+        /// </summary>
+        internal static string WorkingDirectory {
+            get {
+                return ResourceManager.GetString("WorkingDirectory", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   Looks up a localized string similar to The initial folder..
+        /// </summary>
+        internal static string WorkingDirectoryDescription {
+            get {
+                return ResourceManager.GetString("WorkingDirectoryDescription", resourceCulture);
+            }
+        }
     }
 }

Modified: vs-plugin/trunk/Nemerle.VsIntegration/Resources.cs
==============================================================================
--- vs-plugin/trunk/Nemerle.VsIntegration/Resources.cs	(original)
+++ vs-plugin/trunk/Nemerle.VsIntegration/Resources.cs	Wed Jan  3 06:34:05 2007
@@ -1,5 +1,6 @@
 using System;
 using System.ComponentModel;
+using System.Diagnostics;
 using System.Globalization;
 using System.Resources;
 using System.Threading;
@@ -28,6 +29,34 @@
 	}
 
 	[AttributeUsage(AttributeTargets.All)]
+		sealed class SRDisplayNameAttribute : DisplayNameAttribute
+		{
+			string name;
+
+			public SRDisplayNameAttribute(string name)
+			{
+				this.name = name;
+			}
+
+			public override string DisplayName
+			{
+				get
+				{
+					string result = SR.GetString(name);
+
+					if (result == null)
+					{
+						Debug.Assert(false, "String resource '" + name + "' is missing");
+						result = name;
+					}
+
+					return result;
+				}
+			}
+		}
+
+
+	[AttributeUsage(AttributeTargets.All)]
 	internal sealed class SRCategoryAttribute : CategoryAttribute
 	{
 		public SRCategoryAttribute(string category) : base(category) {}
@@ -45,6 +74,9 @@
 		internal const string ApplicationIconDescription  = "ApplicationIconDescription";
 		internal const string AssemblyName                = "AssemblyName";
 		internal const string AssemblyNameDescription     = "AssemblyNameDescription";
+		internal const string CmdArgs                           = "CmdArgs";
+		internal const string CmdArgsDescription                = "CmdArgsDescription";
+		internal const string DebugCaption                      = "DebugCaption";
 		internal const string DefaultNamespace            = "DefaultNamespace";
 		internal const string DefaultNamespaceDescription = "DefaultNamespaceDescription";
 		internal const string GeneralCaption              = "GeneralCaption";
@@ -58,13 +90,16 @@
 		internal const string ProjectFileExtensionFilter  = "ProjectFileExtensionFilter";
 		internal const string ProjectFolder               = "ProjectFolder";
 		internal const string ProjectFolderDescription    = "ProjectFolderDescription";
+		internal const string StartProgram                      = "StartProgram";
+		internal const string StartProgramDescription           = "StartProgramDescription";
 		internal const string StartupObject               = "StartupObject";
 		internal const string StartupObjectDescription    = "StartupObjectDescription";
 		internal const string TargetPlatform              = "TargetPlatform";
 		internal const string TargetPlatformDescription   = "TargetPlatformDescription";
 		internal const string TargetPlatformLocation      = "TargetPlatformLocation";
-
 		internal const string TargetPlatformLocationDescription = "TargetPlatformLocationDescription";
+		internal const string WorkingDirectory                  = "WorkingDirectory";
+		internal const string WorkingDirectoryDescription       = "WorkingDirectoryDescription";
 
 		static SR     loader = null;
 		static object s_InternalSyncObject;

Modified: vs-plugin/trunk/Nemerle.VsIntegration/Resources.resx
==============================================================================
--- vs-plugin/trunk/Nemerle.VsIntegration/Resources.resx	(original)
+++ vs-plugin/trunk/Nemerle.VsIntegration/Resources.resx	Wed Jan  3 06:34:05 2007
@@ -233,4 +233,25 @@
   <data name="301" type="System.Resources.ResXFileRef, System.Windows.Forms">
     <value>Resources\Images_24bit.bmp;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
   </data>
+  <data name="DebugCaption" xml:space="preserve">
+    <value>Debug</value>
+  </data>
+  <data name="CmdArgs" xml:space="preserve">
+    <value>Command Arguments</value>
+  </data>
+  <data name="CmdArgsDescription" xml:space="preserve">
+    <value>Optional arguments passed to starting program.</value>
+  </data>
+  <data name="StartProgram" xml:space="preserve">
+    <value>Start Program</value>
+  </data>
+  <data name="StartProgramDescription" xml:space="preserve">
+    <value>The location of the starting program.</value>
+  </data>
+  <data name="WorkingDirectory" xml:space="preserve">
+    <value>Working Directory</value>
+  </data>
+  <data name="WorkingDirectoryDescription" xml:space="preserve">
+    <value>The initial folder.</value>
+  </data>
 </root>
\ No newline at end of file



More information about the svn mailing list