incubator-nmaven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sisb...@apache.org
Subject svn commit: r534235 - in /incubator/nmaven/branches/SI_XPT/assemblies/NMaven.SharpDevelop.Addin: ./ Resources/ Resources/NMavenBuildControl.xfrm Src/ Src/CompilerMessageViewHandler.cs Src/NMavenBuildControl.cs Src/NMavenBuildPad.cs
Date Tue, 01 May 2007 20:45:10 GMT
Author: sisbell
Date: Tue May  1 13:45:09 2007
New Revision: 534235

URL: http://svn.apache.org/viewvc?view=rev&rev=534235
Log:
Initial import of sharp develop adding for .NET builds.

Added:
    incubator/nmaven/branches/SI_XPT/assemblies/NMaven.SharpDevelop.Addin/
    incubator/nmaven/branches/SI_XPT/assemblies/NMaven.SharpDevelop.Addin/Resources/
    incubator/nmaven/branches/SI_XPT/assemblies/NMaven.SharpDevelop.Addin/Resources/NMavenBuildControl.xfrm
    incubator/nmaven/branches/SI_XPT/assemblies/NMaven.SharpDevelop.Addin/Src/
    incubator/nmaven/branches/SI_XPT/assemblies/NMaven.SharpDevelop.Addin/Src/CompilerMessageViewHandler.cs
    incubator/nmaven/branches/SI_XPT/assemblies/NMaven.SharpDevelop.Addin/Src/NMavenBuildControl.cs
    incubator/nmaven/branches/SI_XPT/assemblies/NMaven.SharpDevelop.Addin/Src/NMavenBuildPad.cs

Added: incubator/nmaven/branches/SI_XPT/assemblies/NMaven.SharpDevelop.Addin/Resources/NMavenBuildControl.xfrm
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_XPT/assemblies/NMaven.SharpDevelop.Addin/Resources/NMavenBuildControl.xfrm?view=auto&rev=534235
==============================================================================
--- incubator/nmaven/branches/SI_XPT/assemblies/NMaven.SharpDevelop.Addin/Resources/NMavenBuildControl.xfrm
(added)
+++ incubator/nmaven/branches/SI_XPT/assemblies/NMaven.SharpDevelop.Addin/Resources/NMavenBuildControl.xfrm
Tue May  1 13:45:09 2007
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Components version="1.0">
+      <System.Windows.Forms.Form>
+        <Name value="MainForm" />
+        <Location value="{X=138,Y=19}" />
+        <Text value="Build" />
+        <Size value="{Width=400, Height=400}" />
+        <TabIndex value="3" />
+      </System.Windows.Forms.Form> 
+</Components>

Added: incubator/nmaven/branches/SI_XPT/assemblies/NMaven.SharpDevelop.Addin/Src/CompilerMessageViewHandler.cs
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_XPT/assemblies/NMaven.SharpDevelop.Addin/Src/CompilerMessageViewHandler.cs?view=auto&rev=534235
==============================================================================
--- incubator/nmaven/branches/SI_XPT/assemblies/NMaven.SharpDevelop.Addin/Src/CompilerMessageViewHandler.cs
(added)
+++ incubator/nmaven/branches/SI_XPT/assemblies/NMaven.SharpDevelop.Addin/Src/CompilerMessageViewHandler.cs
Tue May  1 13:45:09 2007
@@ -0,0 +1,54 @@
+using System;
+using System.Runtime.CompilerServices;
+using System.Windows.Forms;
+using System.Drawing;
+using System.Threading;
+using NMaven.Logging;
+using ICSharpCode.Core;
+using ICSharpCode.SharpDevelop.Gui;
+using ICSharpCode.SharpDevelop;
+
+namespace NMaven.SharpDevelop.Addin
+{
+	/// <summary>
+	/// Description of CompilerMessageViewLogger.
+	/// </summary>
+	public class CompilerMessageViewHandler : IHandler
+	{
+		private Level level;
+		
+		private CompilerMessageView compilerMessageView;
+				
+		public CompilerMessageViewHandler()
+		{
+			this.level = Level.INFO;
+		}
+		
+		public void SetCompilerMessageView(CompilerMessageView compilerMessageView)
+		{
+			this.compilerMessageView = compilerMessageView;	
+		}
+		
+		[MethodImpl(MethodImplOptions.Synchronized)]
+		public void publish(LogRecord record)
+		{
+			if(record.GetLevel().GetValue() >= level.GetValue())
+			{
+				compilerMessageView.GetCategory("NMaven Build")
+					.AppendText(record.GetMessage());
+			}
+		}
+		
+		[MethodImpl(MethodImplOptions.Synchronized)]
+		public void SetLevel(Level level)
+		{
+			this.level = level;
+		}
+		
+		[MethodImpl(MethodImplOptions.Synchronized)]
+		public Level GetLevel()
+		{
+			return level;
+		}		
+	}
+}

Added: incubator/nmaven/branches/SI_XPT/assemblies/NMaven.SharpDevelop.Addin/Src/NMavenBuildControl.cs
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_XPT/assemblies/NMaven.SharpDevelop.Addin/Src/NMavenBuildControl.cs?view=auto&rev=534235
==============================================================================
--- incubator/nmaven/branches/SI_XPT/assemblies/NMaven.SharpDevelop.Addin/Src/NMavenBuildControl.cs
(added)
+++ incubator/nmaven/branches/SI_XPT/assemblies/NMaven.SharpDevelop.Addin/Src/NMavenBuildControl.cs
Tue May  1 13:45:09 2007
@@ -0,0 +1,72 @@
+using System;
+using System.Windows.Forms;
+using System.Collections.Generic;
+using System.Drawing;
+using System.Net;
+using System.Net.Sockets;
+
+using NMaven.IDE.View;
+using NMaven.IDE;
+using NMaven.IDE.Commands;
+using NMaven.IDE.Controls;
+using NMaven.IDE.Impl;
+using NMaven.Service;
+using NMaven.Logging;
+
+using ICSharpCode.SharpDevelop.Gui;
+using ICSharpCode.SharpDevelop.Gui.XmlForms;
+using ICSharpCode.SharpDevelop;
+
+namespace NMaven.SharpDevelop.Addin
+{
+	public class NMavenBuildControl : BaseSharpDevelopUserControl
+	{
+       
+		private CompilerMessageView view;
+		
+		private MessageViewCategory category;
+		
+		public NMavenBuildControl()
+		{
+			category = new MessageViewCategory("NMaven Build");
+			view = CompilerMessageView.Instance;
+			view.AddCategory(category);
+    		
+			SetupFromXmlStream(this.GetType().Assembly.GetManifestResourceStream("NMaven.SharpDevelop.Addin.Resources.NMavenBuildControl.xfrm"));
+			
+			CompilerMessageViewHandler handler = new CompilerMessageViewHandler();
+			handler.SetCompilerMessageView(view);
+			Logger logger = Logger.GetLogger("NMaven Build");
+			logger.AddHandler(handler);
+			logger.Log(Level.INFO, "NMaven Build\r\n");
+			MavenBuildControl buildControl = new MavenBuildControl();            
+			buildControl.Init(logger, findOpenPort(), new Size(400, 400) );
+			buildControl.Size = new Size(400, 400);
+			buildControl.ClearOutputWindow += new EventHandler(ClearOutputWindow);
+			this.Controls.Add(buildControl);
+		}
+		
+		void ClearOutputWindow(object sender, EventArgs e)
+		{
+			category.ClearText();
+		}
+		
+		private int findOpenPort()
+		{
+			for(int i = 1; i < 10; i++)
+			{
+				int port = (new Random()).Next(1025, 65536);
+				try {
+		            Socket socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
+		            socket.Bind(new IPEndPoint(IPAddress.Any, port));
+		            socket.Close();
+		            return port;
+				}
+				catch (SocketException e)
+				{					
+				}								
+			}
+			return -1;
+		}
+	}		
+}

Added: incubator/nmaven/branches/SI_XPT/assemblies/NMaven.SharpDevelop.Addin/Src/NMavenBuildPad.cs
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_XPT/assemblies/NMaven.SharpDevelop.Addin/Src/NMavenBuildPad.cs?view=auto&rev=534235
==============================================================================
--- incubator/nmaven/branches/SI_XPT/assemblies/NMaven.SharpDevelop.Addin/Src/NMavenBuildPad.cs
(added)
+++ incubator/nmaven/branches/SI_XPT/assemblies/NMaven.SharpDevelop.Addin/Src/NMavenBuildPad.cs
Tue May  1 13:45:09 2007
@@ -0,0 +1,49 @@
+using System;
+using System.Windows.Forms;
+using ICSharpCode.Core;
+using ICSharpCode.SharpDevelop.Gui;
+
+namespace NMaven.SharpDevelop.Addin
+{
+	/// <summary>
+	/// Description of the pad content
+	/// </summary>
+	public class NMavenBuildPad : AbstractPadContent
+	{
+		NMavenBuildControl ctl;
+		
+		/// <summary>
+		/// Creates a new TestPad object
+		/// </summary>
+		public NMavenBuildPad()
+		{
+			ctl = new NMavenBuildControl();
+		}
+		
+		/// <summary>
+		/// The <see cref="System.Windows.Forms.Control"/> representing the pad
+		/// </summary>
+		public override Control Control {
+			get {
+				return ctl;
+			}
+		}
+		
+		/// <summary>
+		/// Refreshes the pad
+		/// </summary>
+		public override void RedrawContent()
+		{
+			// TODO: Refresh the whole pad control here, renew all resource strings whatever
+			//       Note that you do not need to recreate the control.
+		}
+		
+		/// <summary>
+		/// Cleans up all used resources
+		/// </summary>
+		public override void Dispose()
+		{
+			ctl.Dispose();
+		}
+	}
+}



Mime
View raw message