Browse Source
git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@983 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61shortcuts
77 changed files with 2282 additions and 79 deletions
@ -0,0 +1,45 @@
@@ -0,0 +1,45 @@
|
||||
<?xml version="1.0"?> |
||||
<Template author="Matt Ward" version="1.0"> |
||||
|
||||
<Config |
||||
name = "Gtk# Window" |
||||
icon = "C#.File.Form" |
||||
category = "C#" |
||||
defaultname = "Window${Number}.cs" |
||||
language = "C#"/> |
||||
|
||||
<Description>A window for a Gtk# application.</Description> |
||||
|
||||
<!-- |
||||
Special new file templates: |
||||
${StandardNamespace} -> Standardnamespace of the current project or FileNameWithoutExtension |
||||
${FullName} -> Full generated path name |
||||
${FileName} -> File name with extension |
||||
${FileNameWithoutExtension} -> File name without extension |
||||
${Extension} -> Extension in the form ".cs" |
||||
${Path} -> Full path of the file |
||||
${ClassName} -> Class name (generally FileNameWithoutExtension w/o 'bad' characters) |
||||
--> |
||||
<Files> |
||||
<File name="${FullName}" language="C#"><![CDATA[${StandardHeader.C#} |
||||
|
||||
using Gtk; |
||||
using System; |
||||
|
||||
namespace ${StandardNamespace} |
||||
{ |
||||
/// <summary> |
||||
/// Description of ${ClassName}. |
||||
/// </summary> |
||||
public class ${ClassName} : Window |
||||
{ |
||||
public ${ClassName}() : base("${ClassName}") |
||||
{ |
||||
} |
||||
} |
||||
} |
||||
]]></File> |
||||
</Files> |
||||
|
||||
<AdditionalOptions/> |
||||
</Template> |
@ -0,0 +1,139 @@
@@ -0,0 +1,139 @@
|
||||
<?xml version="1.0"?> |
||||
<Template originator = "Matt Ward" |
||||
created = "01/01/2006" |
||||
lastModified = "09/01/2006"> |
||||
|
||||
<!-- Template Header --> |
||||
<TemplateConfiguration> |
||||
<Name>Glade# Application</Name> |
||||
<Category>C#</Category> |
||||
<Icon>C#.Project.Form</Icon> |
||||
<LanguageName>C#</LanguageName> |
||||
<Description>A project that creates a Glade# application</Description> |
||||
</TemplateConfiguration> |
||||
|
||||
<!-- Actions --> |
||||
<Actions> |
||||
<Open filename = "MainWindow.cs"/> |
||||
</Actions> |
||||
|
||||
<Solution name = "${ProjectName}" directory = "."> |
||||
<Options> |
||||
<StartupProject>${ProjectName}</StartupProject> |
||||
</Options> |
||||
|
||||
<Project name = "${ProjectName}" directory = "."> |
||||
<Options OutputType = "WinExe"/> |
||||
|
||||
<PropertyGroup> |
||||
<TargetFrameworkVersion>Mono v1.1</TargetFrameworkVersion> |
||||
</PropertyGroup> |
||||
|
||||
<Imports clear="True"> |
||||
<Import Project="$(SharpDevelopBinPath)\SharpDevelop.Build.CSharp.targets" /> |
||||
</Imports> |
||||
|
||||
<ProjectItems> |
||||
<Reference Include="atk-sharp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" /> |
||||
<Reference Include="gdk-sharp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" /> |
||||
<Reference Include="glade-sharp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" /> |
||||
<Reference Include="glib-sharp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" /> |
||||
<Reference Include="gtk-sharp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" /> |
||||
<Reference Include="pango-sharp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" /> |
||||
<Reference Include="System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> |
||||
</ProjectItems> |
||||
|
||||
<Files> |
||||
<File name="MainWindow.cs"><![CDATA[${StandardHeader.C#} |
||||
using Glade; |
||||
using Gtk; |
||||
using System; |
||||
|
||||
namespace ${StandardNamespace} |
||||
{ |
||||
/// <summary> |
||||
/// Description of MainWindow. |
||||
/// </summary> |
||||
public class MainWindow |
||||
{ |
||||
public MainWindow() |
||||
{ |
||||
Glade.XML gxml = new Glade.XML(null, "${StandardNamespace}.glade.xml", "MainWindow", null); |
||||
gxml.Autoconnect(this); |
||||
} |
||||
|
||||
[STAThread] |
||||
public static void Main(string[] args) |
||||
{ |
||||
Application.Init(); |
||||
new MainWindow(); |
||||
Application.Run(); |
||||
} |
||||
|
||||
void MainWindowDeleteEvent(object o, DeleteEventArgs args) |
||||
{ |
||||
Application.Quit(); |
||||
args.RetVal = true; |
||||
} |
||||
} |
||||
}]]></File> |
||||
<File name="glade.xml" buildAction="EmbeddedResource"><![CDATA[<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*--> |
||||
<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd"> |
||||
|
||||
<glade-interface> |
||||
|
||||
<widget class="GtkWindow" id="MainWindow"> |
||||
<property name="visible">True</property> |
||||
<property name="title" translatable="yes">MainWindow</property> |
||||
<property name="type">GTK_WINDOW_TOPLEVEL</property> |
||||
<property name="window_position">GTK_WIN_POS_NONE</property> |
||||
<property name="modal">False</property> |
||||
<property name="resizable">True</property> |
||||
<property name="destroy_with_parent">False</property> |
||||
<property name="decorated">True</property> |
||||
<property name="skip_taskbar_hint">False</property> |
||||
<property name="skip_pager_hint">False</property> |
||||
<property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property> |
||||
<property name="gravity">GDK_GRAVITY_NORTH_WEST</property> |
||||
<signal name="delete_event" handler="MainWindowDeleteEvent" last_modification_time="Sun, 01 Jan 2006 13:24:18 GMT"/> |
||||
|
||||
<child> |
||||
<placeholder/> |
||||
</child> |
||||
</widget> |
||||
|
||||
</glade-interface> |
||||
]]></File> |
||||
<File name="AssemblyInfo.cs"> |
||||
<![CDATA[using System.Reflection; |
||||
using System.Runtime.CompilerServices; |
||||
|
||||
// Information about this assembly is defined by the following |
||||
// attributes. |
||||
// |
||||
// change them to the information which is associated with the assembly |
||||
// you compile. |
||||
|
||||
[assembly: AssemblyTitle("")] |
||||
[assembly: AssemblyDescription("")] |
||||
[assembly: AssemblyConfiguration("")] |
||||
[assembly: AssemblyCompany("")] |
||||
[assembly: AssemblyProduct("")] |
||||
[assembly: AssemblyCopyright("")] |
||||
[assembly: AssemblyTrademark("")] |
||||
[assembly: AssemblyCulture("")] |
||||
|
||||
// The assembly version has following format : |
||||
// |
||||
// Major.Minor.Build.Revision |
||||
// |
||||
// You can specify all values by your own or you can build default build and revision |
||||
// numbers with the '*' character (the default): |
||||
|
||||
[assembly: AssemblyVersion("1.0.*")] |
||||
|
||||
]]></File> |
||||
</Files> |
||||
</Project> |
||||
</Solution> |
||||
</Template> |
@ -0,0 +1,110 @@
@@ -0,0 +1,110 @@
|
||||
<?xml version="1.0"?> |
||||
<Template originator = "Matt Ward" |
||||
created = "01/01/2006" |
||||
lastModified = "09/01/2006"> |
||||
|
||||
<!-- Template Header --> |
||||
<TemplateConfiguration> |
||||
<Name>Gtk# Application</Name> |
||||
<Category>C#</Category> |
||||
<Icon>C#.Project.Form</Icon> |
||||
<LanguageName>C#</LanguageName> |
||||
<Description>A project that creates a Gtk# application</Description> |
||||
</TemplateConfiguration> |
||||
|
||||
<!-- Actions --> |
||||
<Actions> |
||||
<Open filename = "MainWindow.cs"/> |
||||
</Actions> |
||||
|
||||
<Solution name = "${ProjectName}" directory = "."> |
||||
<Options> |
||||
<StartupProject>${ProjectName}</StartupProject> |
||||
</Options> |
||||
|
||||
<Project name = "${ProjectName}" directory = "."> |
||||
<Options OutputType = "WinExe"/> |
||||
|
||||
<PropertyGroup> |
||||
<TargetFrameworkVersion>Mono v1.1</TargetFrameworkVersion> |
||||
</PropertyGroup> |
||||
|
||||
<Imports clear="True"> |
||||
<Import Project="$(SharpDevelopBinPath)\SharpDevelop.Build.CSharp.targets" /> |
||||
</Imports> |
||||
|
||||
<ProjectItems> |
||||
<Reference Include="atk-sharp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" /> |
||||
<Reference Include="gdk-sharp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" /> |
||||
<Reference Include="glib-sharp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" /> |
||||
<Reference Include="gtk-sharp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" /> |
||||
<Reference Include="pango-sharp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" /> |
||||
<Reference Include="System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> |
||||
</ProjectItems> |
||||
|
||||
<Files> |
||||
<File name="MainWindow.cs"><![CDATA[${StandardHeader.C#} |
||||
using Gtk; |
||||
using System; |
||||
|
||||
namespace ${StandardNamespace} |
||||
{ |
||||
/// <summary> |
||||
/// Description of MainWindow. |
||||
/// </summary> |
||||
public class MainWindow : Window |
||||
{ |
||||
public MainWindow() : base("MainWindow") |
||||
{ |
||||
DeleteEvent += new DeleteEventHandler(MainWindowDeleteEvent); |
||||
ShowAll(); |
||||
} |
||||
|
||||
[STAThread] |
||||
public static void Main(string[] arg) |
||||
{ |
||||
Application.Init(); |
||||
new MainWindow(); |
||||
Application.Run(); |
||||
} |
||||
|
||||
void MainWindowDeleteEvent(object o, DeleteEventArgs args) |
||||
{ |
||||
Application.Quit(); |
||||
args.RetVal = true; |
||||
} |
||||
} |
||||
}]]></File> |
||||
<File name="AssemblyInfo.cs"> |
||||
<![CDATA[using System.Reflection; |
||||
using System.Runtime.CompilerServices; |
||||
|
||||
// Information about this assembly is defined by the following |
||||
// attributes. |
||||
// |
||||
// change them to the information which is associated with the assembly |
||||
// you compile. |
||||
|
||||
[assembly: AssemblyTitle("")] |
||||
[assembly: AssemblyDescription("")] |
||||
[assembly: AssemblyConfiguration("")] |
||||
[assembly: AssemblyCompany("")] |
||||
[assembly: AssemblyProduct("")] |
||||
[assembly: AssemblyCopyright("")] |
||||
[assembly: AssemblyTrademark("")] |
||||
[assembly: AssemblyCulture("")] |
||||
|
||||
// The assembly version has following format : |
||||
// |
||||
// Major.Minor.Build.Revision |
||||
// |
||||
// You can specify all values by your own or you can build default build and revision |
||||
// numbers with the '*' character (the default): |
||||
|
||||
[assembly: AssemblyVersion("1.0.*")] |
||||
|
||||
]]></File> |
||||
</Files> |
||||
</Project> |
||||
</Solution> |
||||
</Template> |
@ -0,0 +1,58 @@
@@ -0,0 +1,58 @@
|
||||
Microsoft Visual Studio Solution File, Format Version 9.00 |
||||
# SharpDevelop 2.0.0.960 |
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MonoAddIn", "Project\MonoAddIn.csproj", "{082DCD64-EE32-4151-A50F-E139CF754CC0}" |
||||
EndProject |
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MonoReflectionLoader", "..\MonoReflectionLoader\Project\MonoReflectionLoader.csproj", "{8C52FFA5-35AF-4E28-8498-2DC2F168A241}" |
||||
EndProject |
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.Build.Tasks", "..\..\..\Libraries\ICSharpCode.Build.Tasks\Project\ICSharpCode.Build.Tasks.csproj", "{4139CCF6-FB49-4A9D-B2CF-331E9EA3198D}" |
||||
EndProject |
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.Core", "..\..\..\Main\Core\Project\ICSharpCode.Core.csproj", "{35CEF10F-2D4C-45F2-9DD1-161E0FEC583C}" |
||||
EndProject |
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.SharpDevelop", "..\..\..\Main\Base\Project\ICSharpCode.SharpDevelop.csproj", "{2748AD25-9C63-4E12-877B-4DCE96FBED54}" |
||||
EndProject |
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NRefactory", "..\..\..\Libraries\NRefactory\Project\NRefactory.csproj", "{3A9AE6AA-BC07-4A2F-972C-581E3AE2F195}" |
||||
EndProject |
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.TextEditor", "..\..\..\Libraries\ICSharpCode.TextEditor\Project\ICSharpCode.TextEditor.csproj", "{2D18BE89-D210-49EB-A9DD-2246FBB3DF6D}" |
||||
EndProject |
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WinFormsUI", "..\..\..\Libraries\DockPanel_Src\WinFormsUI\WinFormsUI.csproj", "{D3C782BA-178E-4235-A3BA-8C11DEBB6BEE}" |
||||
EndProject |
||||
Global |
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution |
||||
Debug|Any CPU = Debug|Any CPU |
||||
Release|Any CPU = Release|Any CPU |
||||
EndGlobalSection |
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution |
||||
{082DCD64-EE32-4151-A50F-E139CF754CC0}.Debug|Any CPU.Build.0 = Debug|Any CPU |
||||
{082DCD64-EE32-4151-A50F-E139CF754CC0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
||||
{082DCD64-EE32-4151-A50F-E139CF754CC0}.Release|Any CPU.Build.0 = Release|Any CPU |
||||
{082DCD64-EE32-4151-A50F-E139CF754CC0}.Release|Any CPU.ActiveCfg = Release|Any CPU |
||||
{8C52FFA5-35AF-4E28-8498-2DC2F168A241}.Debug|Any CPU.Build.0 = Debug|Any CPU |
||||
{8C52FFA5-35AF-4E28-8498-2DC2F168A241}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
||||
{8C52FFA5-35AF-4E28-8498-2DC2F168A241}.Release|Any CPU.Build.0 = Release|Any CPU |
||||
{8C52FFA5-35AF-4E28-8498-2DC2F168A241}.Release|Any CPU.ActiveCfg = Release|Any CPU |
||||
{4139CCF6-FB49-4A9D-B2CF-331E9EA3198D}.Debug|Any CPU.Build.0 = Debug|Any CPU |
||||
{4139CCF6-FB49-4A9D-B2CF-331E9EA3198D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
||||
{4139CCF6-FB49-4A9D-B2CF-331E9EA3198D}.Release|Any CPU.Build.0 = Release|Any CPU |
||||
{4139CCF6-FB49-4A9D-B2CF-331E9EA3198D}.Release|Any CPU.ActiveCfg = Release|Any CPU |
||||
{35CEF10F-2D4C-45F2-9DD1-161E0FEC583C}.Debug|Any CPU.Build.0 = Debug|Any CPU |
||||
{35CEF10F-2D4C-45F2-9DD1-161E0FEC583C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
||||
{35CEF10F-2D4C-45F2-9DD1-161E0FEC583C}.Release|Any CPU.Build.0 = Release|Any CPU |
||||
{35CEF10F-2D4C-45F2-9DD1-161E0FEC583C}.Release|Any CPU.ActiveCfg = Release|Any CPU |
||||
{2748AD25-9C63-4E12-877B-4DCE96FBED54}.Debug|Any CPU.Build.0 = Debug|Any CPU |
||||
{2748AD25-9C63-4E12-877B-4DCE96FBED54}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
||||
{2748AD25-9C63-4E12-877B-4DCE96FBED54}.Release|Any CPU.Build.0 = Release|Any CPU |
||||
{2748AD25-9C63-4E12-877B-4DCE96FBED54}.Release|Any CPU.ActiveCfg = Release|Any CPU |
||||
{3A9AE6AA-BC07-4A2F-972C-581E3AE2F195}.Debug|Any CPU.Build.0 = Debug|Any CPU |
||||
{3A9AE6AA-BC07-4A2F-972C-581E3AE2F195}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
||||
{3A9AE6AA-BC07-4A2F-972C-581E3AE2F195}.Release|Any CPU.Build.0 = Release|Any CPU |
||||
{3A9AE6AA-BC07-4A2F-972C-581E3AE2F195}.Release|Any CPU.ActiveCfg = Release|Any CPU |
||||
{2D18BE89-D210-49EB-A9DD-2246FBB3DF6D}.Debug|Any CPU.Build.0 = Debug|Any CPU |
||||
{2D18BE89-D210-49EB-A9DD-2246FBB3DF6D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
||||
{2D18BE89-D210-49EB-A9DD-2246FBB3DF6D}.Release|Any CPU.Build.0 = Release|Any CPU |
||||
{2D18BE89-D210-49EB-A9DD-2246FBB3DF6D}.Release|Any CPU.ActiveCfg = Release|Any CPU |
||||
{D3C782BA-178E-4235-A3BA-8C11DEBB6BEE}.Debug|Any CPU.Build.0 = Debug|Any CPU |
||||
{D3C782BA-178E-4235-A3BA-8C11DEBB6BEE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
||||
{D3C782BA-178E-4235-A3BA-8C11DEBB6BEE}.Release|Any CPU.Build.0 = Release|Any CPU |
||||
{D3C782BA-178E-4235-A3BA-8C11DEBB6BEE}.Release|Any CPU.ActiveCfg = Release|Any CPU |
||||
EndGlobalSection |
||||
EndGlobal |
@ -0,0 +1,39 @@
@@ -0,0 +1,39 @@
|
||||
// <file>
|
||||
// <copyright see="prj:///doc/copyright.txt"/>
|
||||
// <license see="prj:///doc/license.txt"/>
|
||||
// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/>
|
||||
// <version>$Revision$</version>
|
||||
// </file>
|
||||
|
||||
using System.Reflection; |
||||
using System.Runtime.CompilerServices; |
||||
|
||||
// Information about this assembly is defined by the following
|
||||
// attributes.
|
||||
//
|
||||
// change them to the information which is associated with the assembly
|
||||
// you compile.
|
||||
|
||||
[assembly: AssemblyTitle("MonoAddIn")] |
||||
[assembly: AssemblyDescription("Mono-AddIn for SharpDevelop")] |
||||
[assembly: AssemblyConfiguration("")] |
||||
[assembly: AssemblyCompany("ic#code")] |
||||
[assembly: AssemblyProduct("SharpDevelop")] |
||||
[assembly: AssemblyCopyright("2004-2005 AlphaSierraPapa")] |
||||
[assembly: AssemblyTrademark("")] |
||||
[assembly: AssemblyCulture("")] |
||||
|
||||
// The assembly version has following format :
|
||||
//
|
||||
// Major.Minor.Build.Revision
|
||||
//
|
||||
// You can specify all values by your own or you can build default build and revision
|
||||
// numbers with the '*' character (the default):
|
||||
|
||||
[assembly: AssemblyVersion("2.0.0.982")] |
||||
|
||||
// The following attributes specify the key for the sign of your assembly. See the
|
||||
// .NET Framework documentation for more information about signing.
|
||||
// This is not required, if you don't want signing let these attributes like they're.
|
||||
[assembly: AssemblyDelaySign(false)] |
||||
[assembly: AssemblyKeyFile("")] |
@ -0,0 +1,36 @@
@@ -0,0 +1,36 @@
|
||||
<AddIn name = "Mono AddIn" |
||||
author = "Matt Ward" |
||||
copyright = "prj:///doc/copyright.txt" |
||||
description = "Mono support for SharpDevelop"> |
||||
|
||||
<Manifest> |
||||
<Identity name="ICSharpCode.MonoAddIn"/> |
||||
</Manifest> |
||||
|
||||
<Runtime> |
||||
<Import assembly="MonoAddIn.dll"> |
||||
<ConditionEvaluator name="IsMonoInstalled" class="ICSharpCode.MonoAddIn.IsMonoInstalledCondition"/> |
||||
<ConditionEvaluator name="IsMonoProject" class="ICSharpCode.MonoAddIn.IsMonoProjectCondition"/> |
||||
</Import> |
||||
</Runtime> |
||||
|
||||
<Path path="/SharpDevelop/Pads/ProjectBrowser/ContextMenu/ProjectNode"> |
||||
<Condition name="IsMonoInstalled" action="Exclude"> |
||||
<MenuItem id="AddMonoReference" |
||||
label="Add Mono Reference" |
||||
insertafter="AddReference" |
||||
insertbefore="AddWebReference" |
||||
class="ICSharpCode.MonoAddIn.AddMonoReferenceCommand"/> |
||||
</Condition> |
||||
</Path> |
||||
|
||||
<Path name="/SharpDevelop/Pads/ProjectBrowser/ContextMenu/ReferenceFolderNode"> |
||||
<Condition name="IsMonoInstalled" action="Exclude"> |
||||
<MenuItem id="AddMonoReference" |
||||
label="Add Mono Reference" |
||||
insertafter="AddReference" |
||||
insertbefore="AddWebReference" |
||||
class="ICSharpCode.MonoAddIn.AddMonoReferenceCommand"/> |
||||
</Condition> |
||||
</Path> |
||||
</AddIn> |
@ -0,0 +1,81 @@
@@ -0,0 +1,81 @@
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
||||
<PropertyGroup> |
||||
<OutputType>Library</OutputType> |
||||
<RootNamespace>MonoAddIn</RootNamespace> |
||||
<AssemblyName>MonoAddIn</AssemblyName> |
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> |
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> |
||||
<ProjectGuid>{082DCD64-EE32-4151-A50F-E139CF754CC0}</ProjectGuid> |
||||
<AllowUnsafeBlocks>False</AllowUnsafeBlocks> |
||||
<NoStdLib>False</NoStdLib> |
||||
<RegisterForComInterop>False</RegisterForComInterop> |
||||
<GenerateSerializationAssemblies>Auto</GenerateSerializationAssemblies> |
||||
<BaseAddress>4194304</BaseAddress> |
||||
<PlatformTarget>AnyCPU</PlatformTarget> |
||||
<FileAlignment>4096</FileAlignment> |
||||
<WarningLevel>4</WarningLevel> |
||||
<TreatWarningsAsErrors>false</TreatWarningsAsErrors> |
||||
</PropertyGroup> |
||||
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' "> |
||||
<OutputPath>..\..\..\..\..\AddIns\AddIns\Misc\MonoAddIn\</OutputPath> |
||||
<Optimize>False</Optimize> |
||||
<DefineConstants>DEBUG;TRACE</DefineConstants> |
||||
<DebugSymbols>true</DebugSymbols> |
||||
<DebugType>Full</DebugType> |
||||
<CheckForOverflowUnderflow>True</CheckForOverflowUnderflow> |
||||
</PropertyGroup> |
||||
<PropertyGroup Condition=" '$(Configuration)' == 'Release' "> |
||||
<OutputPath>..\..\..\..\..\AddIns\AddIns\Misc\MonoAddIn\</OutputPath> |
||||
<Optimize>True</Optimize> |
||||
<DefineConstants>TRACE</DefineConstants> |
||||
<DebugSymbols>false</DebugSymbols> |
||||
<DebugType>None</DebugType> |
||||
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow> |
||||
</PropertyGroup> |
||||
<ItemGroup> |
||||
<Reference Include="System" /> |
||||
<Reference Include="System.Data" /> |
||||
<Reference Include="System.Drawing" /> |
||||
<Reference Include="System.Windows.Forms" /> |
||||
<Reference Include="System.Xml" /> |
||||
</ItemGroup> |
||||
<ItemGroup> |
||||
<None Include="MonoAddIn.addin"> |
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory> |
||||
</None> |
||||
<Compile Include="Configuration\AssemblyInfo.cs" /> |
||||
<Compile Include="Src\AddMonoReferenceCommand.cs" /> |
||||
<Compile Include="Src\IsMonoInstalledCondition.cs" /> |
||||
<Compile Include="Src\SelectMonoReferenceDialog.cs" /> |
||||
<Compile Include="Src\MonoGacReferencePanel.cs" /> |
||||
<Compile Include="Src\MonoProjectContentLoader.cs" /> |
||||
<Compile Include="Src\IsMonoProjectCondition.cs" /> |
||||
</ItemGroup> |
||||
<ItemGroup> |
||||
<ProjectReference Include="..\..\MonoReflectionLoader\Project\MonoReflectionLoader.csproj"> |
||||
<Project>{8C52FFA5-35AF-4E28-8498-2DC2F168A241}</Project> |
||||
<Name>MonoReflectionLoader</Name> |
||||
<SpecificVersion>False</SpecificVersion> |
||||
<Private>False</Private> |
||||
</ProjectReference> |
||||
<ProjectReference Include="..\..\..\..\Main\Base\Project\ICSharpCode.SharpDevelop.csproj"> |
||||
<Project>{2748AD25-9C63-4E12-877B-4DCE96FBED54}</Project> |
||||
<Name>ICSharpCode.SharpDevelop</Name> |
||||
<Private>False</Private> |
||||
<SpecificVersion>False</SpecificVersion> |
||||
</ProjectReference> |
||||
<ProjectReference Include="..\..\..\..\Main\Core\Project\ICSharpCode.Core.csproj"> |
||||
<Project>{35CEF10F-2D4C-45F2-9DD1-161E0FEC583C}</Project> |
||||
<Name>ICSharpCode.Core</Name> |
||||
<Private>False</Private> |
||||
<SpecificVersion>False</SpecificVersion> |
||||
</ProjectReference> |
||||
<ProjectReference Include="..\..\..\..\Libraries\ICSharpCode.Build.Tasks\Project\ICSharpCode.Build.Tasks.csproj"> |
||||
<Project>{4139CCF6-FB49-4A9D-B2CF-331E9EA3198D}</Project> |
||||
<Name>ICSharpCode.Build.Tasks</Name> |
||||
<Private>False</Private> |
||||
<SpecificVersion>False</SpecificVersion> |
||||
</ProjectReference> |
||||
</ItemGroup> |
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" /> |
||||
</Project> |
@ -0,0 +1,49 @@
@@ -0,0 +1,49 @@
|
||||
// <file>
|
||||
// <copyright see="prj:///doc/copyright.txt"/>
|
||||
// <license see="prj:///doc/license.txt"/>
|
||||
// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/>
|
||||
// <version>$Revision$</version>
|
||||
// </file>
|
||||
|
||||
using ICSharpCode.Build.Tasks; |
||||
using ICSharpCode.Core; |
||||
using ICSharpCode.SharpDevelop.Gui; |
||||
using ICSharpCode.SharpDevelop.Project; |
||||
using System; |
||||
using System.IO; |
||||
using System.Windows.Forms; |
||||
|
||||
namespace ICSharpCode.MonoAddIn |
||||
{ |
||||
/// <summary>
|
||||
/// Displays the AddMonoReference dialog allowing the user to add
|
||||
/// a Mono GAC reference to the project
|
||||
/// </summary>
|
||||
public class AddMonoReferenceCommand : AbstractMenuCommand |
||||
{ |
||||
public override void Run() |
||||
{ |
||||
AbstractProjectBrowserTreeNode node = Owner as AbstractProjectBrowserTreeNode; |
||||
IProject project = (node != null) ? node.Project : ProjectService.CurrentProject; |
||||
if (project == null) { |
||||
return; |
||||
} |
||||
using (SelectMonoReferenceDialog selDialog = new SelectMonoReferenceDialog(project)) { |
||||
if (selDialog.ShowDialog(ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.MainForm) == DialogResult.OK) { |
||||
|
||||
MonoProjectContentLoader.CreateMonoProjectContent(project); |
||||
|
||||
foreach (ReferenceProjectItem gacReference in selDialog.GacReferences) { |
||||
MonoProjectContentLoader.AddGacReference(gacReference.Include); |
||||
} |
||||
|
||||
foreach (ReferenceProjectItem reference in selDialog.ReferenceInformations) { |
||||
ProjectService.AddProjectItem(project, reference); |
||||
} |
||||
|
||||
project.Save(); |
||||
} |
||||
} |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,24 @@
@@ -0,0 +1,24 @@
|
||||
// <file>
|
||||
// <copyright see="prj:///doc/copyright.txt"/>
|
||||
// <license see="prj:///doc/license.txt"/>
|
||||
// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/>
|
||||
// <version>$Revision$</version>
|
||||
// </file>
|
||||
|
||||
using ICSharpCode.Build.Tasks; |
||||
using ICSharpCode.Core; |
||||
using System; |
||||
|
||||
namespace ICSharpCode.MonoAddIn |
||||
{ |
||||
/// <summary>
|
||||
/// Determines whether Mono is installed.
|
||||
/// </summary>
|
||||
public class IsMonoInstalledCondition : IConditionEvaluator |
||||
{ |
||||
public bool IsValid(object caller, Condition condition) |
||||
{ |
||||
return MonoToolLocationHelper.IsMonoInstalled; |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,29 @@
@@ -0,0 +1,29 @@
|
||||
// <file>
|
||||
// <copyright see="prj:///doc/copyright.txt"/>
|
||||
// <license see="prj:///doc/license.txt"/>
|
||||
// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/>
|
||||
// <version>$Revision$</version>
|
||||
// </file>
|
||||
|
||||
using ICSharpCode.Build.Tasks; |
||||
using ICSharpCode.Core; |
||||
using ICSharpCode.SharpDevelop.Project; |
||||
using System; |
||||
|
||||
namespace ICSharpCode.MonoAddIn |
||||
{ |
||||
/// <summary>
|
||||
/// Determines whether the selected project is set to target the Mono framework.
|
||||
/// </summary>
|
||||
public class IsMonoProjectCondition : IConditionEvaluator |
||||
{ |
||||
public bool IsValid(object caller, Condition condition) |
||||
{ |
||||
IProject project = ProjectService.CurrentProject; |
||||
if (project == null) { |
||||
return false; |
||||
} |
||||
return MonoProjectContentLoader.IsMonoProject(project as MSBuildProject); |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,30 @@
@@ -0,0 +1,30 @@
|
||||
// <file>
|
||||
// <copyright see="prj:///doc/copyright.txt"/>
|
||||
// <license see="prj:///doc/license.txt"/>
|
||||
// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/>
|
||||
// <version>$Revision$</version>
|
||||
// </file>
|
||||
|
||||
using ICSharpCode.Build.Tasks; |
||||
using ICSharpCode.SharpDevelop.Gui; |
||||
using System; |
||||
using System.Windows.Forms; |
||||
|
||||
namespace ICSharpCode.MonoAddIn |
||||
{ |
||||
public class MonoGacReferencePanel : GacReferencePanel |
||||
{ |
||||
public MonoGacReferencePanel(ISelectReferenceDialog selectDialog) : base(selectDialog) |
||||
{ |
||||
} |
||||
|
||||
protected override void PrintCache() |
||||
{ |
||||
foreach (MonoAssemblyName assemblyName in MonoGlobalAssemblyCache.GetAssemblyNames()) { |
||||
ListViewItem item = new ListViewItem(new string[] {assemblyName.Name, assemblyName.Version.ToString(), assemblyName.Directory}); |
||||
item.Tag = assemblyName.FullName; |
||||
Items.Add(item); |
||||
} |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,134 @@
@@ -0,0 +1,134 @@
|
||||
// <file>
|
||||
// <copyright see="prj:///doc/copyright.txt"/>
|
||||
// <license see="prj:///doc/license.txt"/>
|
||||
// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/>
|
||||
// <version>$Revision$</version>
|
||||
// </file>
|
||||
|
||||
using ICSharpCode.Core; |
||||
using ICSharpCode.Build.Tasks; |
||||
using ICSharpCode.SharpDevelop.Dom; |
||||
using ICSharpCode.SharpDevelop.Project; |
||||
using System; |
||||
using System.IO; |
||||
using System.Reflection; |
||||
|
||||
namespace ICSharpCode.MonoAddIn |
||||
{ |
||||
/// <summary>
|
||||
/// Adds Mono specific GAC assembly references to the project content registry.
|
||||
/// </summary>
|
||||
public class MonoProjectContentLoader |
||||
{ |
||||
string fileName = String.Empty; |
||||
string include = String.Empty; |
||||
|
||||
MonoProjectContentLoader(string fileName, string include) |
||||
{ |
||||
this.fileName = fileName; |
||||
this.include = include; |
||||
} |
||||
|
||||
public static bool IsMonoProject(MSBuildProject project) |
||||
{ |
||||
if (project != null) { |
||||
PropertyStorageLocations location; |
||||
foreach (string configuration in project.GetConfigurationNames()) { |
||||
foreach (string platform in project.GetPlatformNames()) { |
||||
string propertyValue = project.GetProperty(configuration, platform, "TargetFrameworkVersion", String.Empty, out location); |
||||
if (propertyValue != null && propertyValue.StartsWith("Mono", StringComparison.InvariantCultureIgnoreCase)) { |
||||
return true; |
||||
} |
||||
} |
||||
} |
||||
} |
||||
return false; |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// Adds the Mono Gac reference to the Dom Cache.
|
||||
/// </summary>
|
||||
/// <param name="name">The full name of the Gac assembly.</param>
|
||||
public static void AddGacReference(string name) |
||||
{ |
||||
try { |
||||
MonoAssemblyName assemblyName = MonoGlobalAssemblyCache.FindAssemblyName(name); |
||||
if (assemblyName != null) { |
||||
CreateMonoProjectContent(assemblyName.FileName, name); |
||||
} |
||||
} catch (Exception ex) { |
||||
LoggingService.Debug(ex.ToString()); |
||||
} |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// Creates any missing Dom cache items for the project.
|
||||
/// </summary>
|
||||
public static void CreateMonoProjectContent(IProject project) |
||||
{ |
||||
foreach (ProjectItem item in project.Items) { |
||||
ReferenceProjectItem referenceItem = item as ReferenceProjectItem; |
||||
if (item.ItemType == ItemType.Reference) { |
||||
CreateMonoProjectContent(item.FileName, item.Include); |
||||
} |
||||
} |
||||
} |
||||
|
||||
static void CreateMonoProjectContent(string fileName, string include) |
||||
{ |
||||
MonoProjectContentLoader loader = new MonoProjectContentLoader(fileName, include); |
||||
ProjectContentRegistry.RunLocked(loader.CreateMonoProjectContent); |
||||
} |
||||
|
||||
static bool IsProjectContentAdded(string fileName, string include) |
||||
{ |
||||
AssemblyName assemblyName = new AssemblyName(include); |
||||
if (assemblyName == null) { |
||||
return true; |
||||
} |
||||
|
||||
if (ProjectContentRegistry.GetExistingProjectContent(assemblyName) != null) { |
||||
return true; |
||||
} |
||||
|
||||
ReflectionProjectContent pc = DomPersistence.LoadProjectContentByAssemblyName(fileName); |
||||
if (pc != null) { |
||||
return true; |
||||
} |
||||
|
||||
pc = DomPersistence.LoadProjectContentByAssemblyName(include); |
||||
if (pc != null) { |
||||
return true; |
||||
} |
||||
|
||||
return false; |
||||
} |
||||
|
||||
void CreateMonoProjectContent() |
||||
{ |
||||
if (IsProjectContentAdded(fileName, include)) { |
||||
return; |
||||
} |
||||
|
||||
AppDomainSetup setup = new AppDomainSetup(); |
||||
setup.DisallowCodeDownload = true; |
||||
setup.ApplicationBase = AppDomain.CurrentDomain.BaseDirectory; |
||||
AppDomain domain = AppDomain.CreateDomain("MonoAssemblyLoadingDomain", AppDomain.CurrentDomain.Evidence, setup); |
||||
try { |
||||
object o = domain.CreateInstanceAndUnwrap(typeof(MonoReflectionLoader).Assembly.FullName, typeof(MonoReflectionLoader).FullName); |
||||
MonoReflectionLoader loader = (MonoReflectionLoader)o; |
||||
string database = loader.LoadAndCreateDatabase(fileName, include); |
||||
if (database != null) { |
||||
ReflectionProjectContent content = DomPersistence.LoadProjectContent(database); |
||||
if (content != null) { |
||||
DomPersistence.SaveProjectContent(content); |
||||
} |
||||
} |
||||
} catch (Exception ex) { |
||||
LoggingService.Debug("Error loading " + include + " from " + fileName + ": " + ex.ToString()); |
||||
} finally { |
||||
AppDomain.Unload(domain); |
||||
} |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,314 @@
@@ -0,0 +1,314 @@
|
||||
// <file>
|
||||
// <copyright see="prj:///doc/copyright.txt"/>
|
||||
// <license see="prj:///doc/license.txt"/>
|
||||
// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/>
|
||||
// <version>$Revision$</version>
|
||||
// </file>
|
||||
|
||||
using ICSharpCode.Build.Tasks; |
||||
using ICSharpCode.Core; |
||||
using ICSharpCode.SharpDevelop.Gui; |
||||
using ICSharpCode.SharpDevelop.Project; |
||||
using System; |
||||
using System.Collections.Generic; |
||||
using System.Drawing; |
||||
using System.IO; |
||||
using System.Collections; |
||||
using System.ComponentModel; |
||||
using System.Windows.Forms; |
||||
|
||||
namespace ICSharpCode.MonoAddIn |
||||
{ |
||||
public class SelectMonoReferenceDialog : System.Windows.Forms.Form, ISelectReferenceDialog |
||||
{ |
||||
private System.Windows.Forms.ListView referencesListView; |
||||
private System.Windows.Forms.Button selectButton; |
||||
private System.Windows.Forms.Button removeButton; |
||||
private System.Windows.Forms.TabPage gacTabPage; |
||||
private System.Windows.Forms.TabPage projectTabPage; |
||||
private System.Windows.Forms.TabPage browserTabPage; |
||||
private System.Windows.Forms.Label referencesLabel; |
||||
private System.Windows.Forms.ColumnHeader referenceHeader; |
||||
private System.Windows.Forms.ColumnHeader typeHeader; |
||||
private System.Windows.Forms.ColumnHeader locationHeader; |
||||
private System.Windows.Forms.TabControl referenceTabControl; |
||||
private System.Windows.Forms.Button okButton; |
||||
private System.Windows.Forms.Button cancelButton; |
||||
private System.Windows.Forms.Button helpButton; |
||||
private System.ComponentModel.Container components = null; |
||||
|
||||
List<ReferenceProjectItem> gacReferences = new List<ReferenceProjectItem>(); |
||||
IProject configureProject; |
||||
|
||||
public ArrayList ReferenceInformations { |
||||
get { |
||||
ArrayList referenceInformations = new ArrayList(); |
||||
foreach (ListViewItem item in referencesListView.Items) { |
||||
System.Diagnostics.Debug.Assert(item.Tag != null); |
||||
referenceInformations.Add(item.Tag); |
||||
} |
||||
return referenceInformations; |
||||
} |
||||
} |
||||
|
||||
public List<ReferenceProjectItem> GacReferences { |
||||
get { |
||||
return gacReferences; |
||||
} |
||||
} |
||||
|
||||
public SelectMonoReferenceDialog(IProject configureProject) |
||||
{ |
||||
this.configureProject = configureProject; |
||||
|
||||
InitializeComponent(); |
||||
|
||||
gacTabPage.Controls.Add(new MonoGacReferencePanel(this)); |
||||
projectTabPage.Controls.Add(new ProjectReferencePanel(this)); |
||||
browserTabPage.Controls.Add(new AssemblyReferencePanel(this)); |
||||
} |
||||
|
||||
public void AddReference(ReferenceType referenceType, string referenceName, string referenceLocation, object tag) |
||||
{ |
||||
foreach (ListViewItem item in referencesListView.Items) { |
||||
if (referenceLocation == item.SubItems[2].Text && referenceName == item.Text ) { |
||||
return; |
||||
} |
||||
} |
||||
|
||||
ListViewItem newItem = new ListViewItem(new string[] {referenceName, referenceType.ToString(), referenceLocation}); |
||||
switch (referenceType) { |
||||
case ReferenceType.Project: |
||||
newItem.Tag = new ProjectReferenceProjectItem(configureProject, (IProject)tag); |
||||
break; |
||||
case ReferenceType.Gac: |
||||
ReferenceProjectItem gacReference = new ReferenceProjectItem(configureProject); |
||||
gacReference.Include = referenceLocation; |
||||
gacReferences.Add(gacReference); |
||||
// Add hint path so we can build against Microsoft's Csc too.
|
||||
gacReference.HintPath = FileUtility.GetRelativePath(configureProject.Directory, GetAssemblyLocation(referenceLocation)); |
||||
gacReference.SpecificVersion = false; |
||||
newItem.Tag = gacReference; |
||||
break; |
||||
case ReferenceType.Assembly: |
||||
ReferenceProjectItem assemblyReference = new ReferenceProjectItem(configureProject); |
||||
assemblyReference.Include = Path.GetFileNameWithoutExtension(referenceLocation); |
||||
assemblyReference.HintPath = FileUtility.GetRelativePath(configureProject.Directory, referenceLocation); |
||||
assemblyReference.SpecificVersion = false; |
||||
newItem.Tag = assemblyReference; |
||||
break; |
||||
default: |
||||
throw new System.NotSupportedException("Unknown reference type:" + referenceType); |
||||
} |
||||
|
||||
referencesListView.Items.Add(newItem); |
||||
} |
||||
|
||||
void SelectReference(object sender, EventArgs e) |
||||
{ |
||||
IReferencePanel refPanel = (IReferencePanel)referenceTabControl.SelectedTab.Controls[0]; |
||||
refPanel.AddReference(null, null); |
||||
} |
||||
|
||||
void RemoveReference(object sender, EventArgs e) |
||||
{ |
||||
ArrayList itemsToDelete = new ArrayList(); |
||||
|
||||
foreach (ListViewItem item in referencesListView.SelectedItems) { |
||||
itemsToDelete.Add(item); |
||||
} |
||||
|
||||
foreach (ListViewItem item in itemsToDelete) { |
||||
referencesListView.Items.Remove(item); |
||||
ReferenceProjectItem referenceItem = item.Tag as ReferenceProjectItem; |
||||
if (referenceItem != null) { |
||||
gacReferences.Remove(referenceItem); |
||||
} |
||||
} |
||||
} |
||||
|
||||
string GetAssemblyLocation(string name) |
||||
{ |
||||
MonoAssemblyName assemblyName = MonoGlobalAssemblyCache.FindAssemblyName(name); |
||||
if (assemblyName != null) { |
||||
return assemblyName.FileName; |
||||
} |
||||
return String.Empty; |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
protected override void Dispose(bool disposing) |
||||
{ |
||||
if (disposing) { |
||||
if (components != null) { |
||||
components.Dispose(); |
||||
} |
||||
} |
||||
base.Dispose( disposing ); |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent() |
||||
{ |
||||
this.referenceTabControl = new System.Windows.Forms.TabControl(); |
||||
this.referencesListView = new System.Windows.Forms.ListView(); |
||||
this.selectButton = new System.Windows.Forms.Button(); |
||||
this.removeButton = new System.Windows.Forms.Button(); |
||||
this.gacTabPage = new System.Windows.Forms.TabPage(); |
||||
this.projectTabPage = new System.Windows.Forms.TabPage(); |
||||
this.browserTabPage = new System.Windows.Forms.TabPage(); |
||||
this.referencesLabel = new System.Windows.Forms.Label(); |
||||
this.referenceHeader = new System.Windows.Forms.ColumnHeader(); |
||||
this.typeHeader = new System.Windows.Forms.ColumnHeader(); |
||||
this.locationHeader = new System.Windows.Forms.ColumnHeader(); |
||||
this.okButton = new System.Windows.Forms.Button(); |
||||
this.cancelButton = new System.Windows.Forms.Button(); |
||||
this.helpButton = new System.Windows.Forms.Button(); |
||||
this.referenceTabControl.SuspendLayout(); |
||||
this.SuspendLayout(); |
||||
//
|
||||
// referenceTabControl
|
||||
//
|
||||
this.referenceTabControl.Controls.AddRange(new System.Windows.Forms.Control[] { |
||||
this.gacTabPage, |
||||
this.projectTabPage, |
||||
this.browserTabPage, |
||||
}); |
||||
this.referenceTabControl.Location = new System.Drawing.Point(8, 8); |
||||
this.referenceTabControl.SelectedIndex = 0; |
||||
this.referenceTabControl.Size = new System.Drawing.Size(472, 224); |
||||
this.referenceTabControl.TabIndex = 0; |
||||
//
|
||||
// referencesListView
|
||||
//
|
||||
this.referencesListView.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { |
||||
this.referenceHeader, |
||||
this.typeHeader, |
||||
this.locationHeader}); |
||||
this.referencesListView.Location = new System.Drawing.Point(8, 256); |
||||
this.referencesListView.Size = new System.Drawing.Size(472, 97); |
||||
this.referencesListView.TabIndex = 3; |
||||
this.referencesListView.View = System.Windows.Forms.View.Details; |
||||
this.referencesListView.FullRowSelect = true; |
||||
|
||||
|
||||
//
|
||||
// selectButton
|
||||
//
|
||||
this.selectButton.Location = new System.Drawing.Point(488, 32); |
||||
this.selectButton.TabIndex = 1; |
||||
this.selectButton.Text = ResourceService.GetString("Dialog.SelectReferenceDialog.SelectButton"); |
||||
this.selectButton.Click += new EventHandler(SelectReference); |
||||
this.selectButton.FlatStyle = FlatStyle.System; |
||||
|
||||
//
|
||||
// removeButton
|
||||
//
|
||||
this.removeButton.Location = new System.Drawing.Point(488, 256); |
||||
this.removeButton.TabIndex = 4; |
||||
this.removeButton.Text = ResourceService.GetString("Global.RemoveButtonText"); |
||||
this.removeButton.Click += new EventHandler(RemoveReference); |
||||
this.removeButton.FlatStyle = FlatStyle.System; |
||||
|
||||
//
|
||||
// gacTabPage
|
||||
//
|
||||
this.gacTabPage.Location = new System.Drawing.Point(4, 22); |
||||
this.gacTabPage.Size = new System.Drawing.Size(464, 198); |
||||
this.gacTabPage.TabIndex = 0; |
||||
this.gacTabPage.Text = ResourceService.GetString("Dialog.SelectReferenceDialog.GacTabPage"); |
||||
this.gacTabPage.UseVisualStyleBackColor = true; |
||||
//
|
||||
// projectTabPage
|
||||
//
|
||||
this.projectTabPage.Location = new System.Drawing.Point(4, 22); |
||||
this.projectTabPage.Size = new System.Drawing.Size(464, 198); |
||||
this.projectTabPage.TabIndex = 1; |
||||
this.projectTabPage.Text = ResourceService.GetString("Dialog.SelectReferenceDialog.ProjectTabPage"); |
||||
this.projectTabPage.UseVisualStyleBackColor = true; |
||||
//
|
||||
// browserTabPage
|
||||
//
|
||||
this.browserTabPage.Location = new System.Drawing.Point(4, 22); |
||||
this.browserTabPage.Size = new System.Drawing.Size(464, 198); |
||||
this.browserTabPage.TabIndex = 2; |
||||
this.browserTabPage.Text = ResourceService.GetString("Dialog.SelectReferenceDialog.BrowserTabPage"); |
||||
this.browserTabPage.UseVisualStyleBackColor = true; |
||||
//
|
||||
// referencesLabel
|
||||
//
|
||||
this.referencesLabel.Location = new System.Drawing.Point(8, 240); |
||||
this.referencesLabel.Size = new System.Drawing.Size(472, 16); |
||||
this.referencesLabel.TabIndex = 2; |
||||
this.referencesLabel.Text = ResourceService.GetString("Dialog.SelectReferenceDialog.ReferencesLabel"); |
||||
//
|
||||
// referenceHeader
|
||||
//
|
||||
this.referenceHeader.Text = ResourceService.GetString("Dialog.SelectReferenceDialog.ReferenceHeader"); |
||||
this.referenceHeader.Width = 183; |
||||
//
|
||||
// typeHeader
|
||||
//
|
||||
this.typeHeader.Text = ResourceService.GetString("Dialog.SelectReferenceDialog.TypeHeader"); |
||||
this.typeHeader.Width = 57; |
||||
//
|
||||
// locationHeader
|
||||
//
|
||||
this.locationHeader.Text = ResourceService.GetString("Dialog.SelectReferenceDialog.LocationHeader"); |
||||
this.locationHeader.Width = 228; |
||||
//
|
||||
// okButton
|
||||
//
|
||||
this.okButton.DialogResult = System.Windows.Forms.DialogResult.OK; |
||||
this.okButton.Location = new System.Drawing.Point(312, 368); |
||||
this.okButton.TabIndex = 5; |
||||
this.okButton.Text = ResourceService.GetString("Global.OKButtonText"); |
||||
this.okButton.FlatStyle = FlatStyle.System; |
||||
|
||||
//
|
||||
// cancelButton
|
||||
//
|
||||
this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; |
||||
this.cancelButton.Location = new System.Drawing.Point(400, 368); |
||||
this.cancelButton.TabIndex = 6; |
||||
this.cancelButton.Text = ResourceService.GetString("Global.CancelButtonText"); |
||||
this.cancelButton.FlatStyle = FlatStyle.System; |
||||
|
||||
//
|
||||
// helpButton
|
||||
//
|
||||
this.helpButton.Location = new System.Drawing.Point(488, 368); |
||||
this.helpButton.TabIndex = 7; |
||||
this.helpButton.Text = ResourceService.GetString("Global.HelpButtonText"); |
||||
this.helpButton.FlatStyle = FlatStyle.System; |
||||
|
||||
//
|
||||
// SelectReferenceDialog
|
||||
//
|
||||
this.AcceptButton = this.okButton; |
||||
this.CancelButton = this.cancelButton; |
||||
this.ClientSize = new System.Drawing.Size(570, 399); |
||||
this.Controls.AddRange(new System.Windows.Forms.Control[] { |
||||
this.helpButton, |
||||
this.cancelButton, |
||||
this.okButton, |
||||
this.referencesLabel, |
||||
this.removeButton, |
||||
this.selectButton, |
||||
this.referencesListView, |
||||
this.referenceTabControl}); |
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; |
||||
this.MaximizeBox = false; |
||||
this.MinimizeBox = false; |
||||
this.ShowInTaskbar = false; |
||||
this.Text = ResourceService.GetString("Dialog.SelectReferenceDialog.DialogName"); |
||||
this.referenceTabControl.ResumeLayout(false); |
||||
this.ResumeLayout(false); |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,39 @@
@@ -0,0 +1,39 @@
|
||||
// <file>
|
||||
// <copyright see="prj:///doc/copyright.txt"/>
|
||||
// <license see="prj:///doc/license.txt"/>
|
||||
// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/>
|
||||
// <version>$Revision$</version>
|
||||
// </file>
|
||||
|
||||
using System.Reflection; |
||||
using System.Runtime.CompilerServices; |
||||
|
||||
// Information about this assembly is defined by the following
|
||||
// attributes.
|
||||
//
|
||||
// change them to the information which is associated with the assembly
|
||||
// you compile.
|
||||
|
||||
[assembly: AssemblyTitle("MonoReflectionLoader")] |
||||
[assembly: AssemblyDescription("MonoReflectionLoader for SharpDevelop")] |
||||
[assembly: AssemblyConfiguration("")] |
||||
[assembly: AssemblyCompany("ic#code")] |
||||
[assembly: AssemblyProduct("SharpDevelop")] |
||||
[assembly: AssemblyCopyright("2004-2005 AlphaSierraPapa")] |
||||
[assembly: AssemblyTrademark("")] |
||||
[assembly: AssemblyCulture("")] |
||||
|
||||
// The assembly version has following format :
|
||||
//
|
||||
// Major.Minor.Build.Revision
|
||||
//
|
||||
// You can specify all values by your own or you can build default build and revision
|
||||
// numbers with the '*' character (the default):
|
||||
|
||||
[assembly: AssemblyVersion("2.0.0.982")] |
||||
|
||||
// The following attributes specify the key for the sign of your assembly. See the
|
||||
// .NET Framework documentation for more information about signing.
|
||||
// This is not required, if you don't want signing let these attributes like they're.
|
||||
[assembly: AssemblyDelaySign(false)] |
||||
[assembly: AssemblyKeyFile("")] |
@ -0,0 +1,63 @@
@@ -0,0 +1,63 @@
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
||||
<PropertyGroup> |
||||
<OutputType>Library</OutputType> |
||||
<RootNamespace>MonoReflectionLoader</RootNamespace> |
||||
<AssemblyName>MonoReflectionLoader</AssemblyName> |
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> |
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> |
||||
<ProjectGuid>{8C52FFA5-35AF-4E28-8498-2DC2F168A241}</ProjectGuid> |
||||
<AllowUnsafeBlocks>False</AllowUnsafeBlocks> |
||||
<NoStdLib>False</NoStdLib> |
||||
<RegisterForComInterop>False</RegisterForComInterop> |
||||
<GenerateSerializationAssemblies>Auto</GenerateSerializationAssemblies> |
||||
<BaseAddress>4194304</BaseAddress> |
||||
<PlatformTarget>AnyCPU</PlatformTarget> |
||||
<FileAlignment>4096</FileAlignment> |
||||
<WarningLevel>4</WarningLevel> |
||||
<TreatWarningsAsErrors>false</TreatWarningsAsErrors> |
||||
</PropertyGroup> |
||||
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' "> |
||||
<OutputPath>..\..\..\..\..\bin\</OutputPath> |
||||
<Optimize>False</Optimize> |
||||
<DefineConstants>DEBUG;TRACE</DefineConstants> |
||||
<DebugSymbols>true</DebugSymbols> |
||||
<DebugType>Full</DebugType> |
||||
<CheckForOverflowUnderflow>True</CheckForOverflowUnderflow> |
||||
</PropertyGroup> |
||||
<PropertyGroup Condition=" '$(Configuration)' == 'Release' "> |
||||
<OutputPath>..\..\..\..\..\bin\</OutputPath> |
||||
<Optimize>True</Optimize> |
||||
<DefineConstants>TRACE</DefineConstants> |
||||
<DebugSymbols>false</DebugSymbols> |
||||
<DebugType>None</DebugType> |
||||
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow> |
||||
</PropertyGroup> |
||||
<ItemGroup> |
||||
<Reference Include="System" /> |
||||
</ItemGroup> |
||||
<ItemGroup> |
||||
<Compile Include="Src\MonoReflectionLoader.cs" /> |
||||
<Compile Include="Configuration\AssemblyInfo.cs" /> |
||||
</ItemGroup> |
||||
<ItemGroup> |
||||
<ProjectReference Include="..\..\..\..\Main\Base\Project\ICSharpCode.SharpDevelop.csproj"> |
||||
<Project>{2748AD25-9C63-4E12-877B-4DCE96FBED54}</Project> |
||||
<Name>ICSharpCode.SharpDevelop</Name> |
||||
<Private>False</Private> |
||||
<SpecificVersion>False</SpecificVersion> |
||||
</ProjectReference> |
||||
<ProjectReference Include="..\..\..\..\Main\Core\Project\ICSharpCode.Core.csproj"> |
||||
<Project>{35CEF10F-2D4C-45F2-9DD1-161E0FEC583C}</Project> |
||||
<Name>ICSharpCode.Core</Name> |
||||
<Private>False</Private> |
||||
<SpecificVersion>False</SpecificVersion> |
||||
</ProjectReference> |
||||
<ProjectReference Include="..\..\..\..\Libraries\ICSharpCode.Build.Tasks\Project\ICSharpCode.Build.Tasks.csproj"> |
||||
<Project>{4139CCF6-FB49-4A9D-B2CF-331E9EA3198D}</Project> |
||||
<Name>ICSharpCode.Build.Tasks</Name> |
||||
<Private>False</Private> |
||||
<SpecificVersion>False</SpecificVersion> |
||||
</ProjectReference> |
||||
</ItemGroup> |
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" /> |
||||
</Project> |
@ -0,0 +1,73 @@
@@ -0,0 +1,73 @@
|
||||
// <file>
|
||||
// <copyright see="prj:///doc/copyright.txt"/>
|
||||
// <license see="prj:///doc/license.txt"/>
|
||||
// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/>
|
||||
// <version>$Revision$</version>
|
||||
// </file>
|
||||
|
||||
using ICSharpCode.Build.Tasks; |
||||
using ICSharpCode.Core; |
||||
using ICSharpCode.SharpDevelop.Dom; |
||||
using System; |
||||
using System.IO; |
||||
using System.Reflection; |
||||
|
||||
namespace ICSharpCode.MonoAddIn |
||||
{ |
||||
public sealed class MonoReflectionLoader : MarshalByRefObject |
||||
{ |
||||
public MonoReflectionLoader() |
||||
{ |
||||
} |
||||
|
||||
public string LoadAndCreateDatabase(string fileName, string include) |
||||
{ |
||||
try { |
||||
LoggingService.Debug("MonoReflectionLoader: Load: " + include); |
||||
ReflectionProjectContent content = LoadProjectContent(fileName, include); |
||||
if (content == null) |
||||
return null; |
||||
return DomPersistence.SaveProjectContent(content); |
||||
} catch (Exception ex) { |
||||
LoggingService.Error(ex); |
||||
return null; |
||||
} |
||||
} |
||||
|
||||
ReflectionProjectContent LoadProjectContent(string fileName, string include) |
||||
{ |
||||
fileName = Path.GetFullPath(fileName); |
||||
Assembly assembly; |
||||
AppDomain.CurrentDomain.ReflectionOnlyAssemblyResolve += AssemblyResolve; |
||||
try { |
||||
if (File.Exists(fileName)) { |
||||
assembly = Assembly.ReflectionOnlyLoadFrom(fileName); |
||||
return new ReflectionProjectContent(assembly, fileName); |
||||
} |
||||
assembly = LoadMonoGacAssembly(include); |
||||
if (assembly != null) |
||||
return new ReflectionProjectContent(assembly); |
||||
else |
||||
return null; |
||||
} catch (BadImageFormatException) { |
||||
return null; |
||||
} finally { |
||||
AppDomain.CurrentDomain.ReflectionOnlyAssemblyResolve -= AssemblyResolve; |
||||
} |
||||
} |
||||
|
||||
Assembly AssemblyResolve(object sender, ResolveEventArgs e) |
||||
{ |
||||
return LoadMonoGacAssembly(e.Name); |
||||
} |
||||
|
||||
Assembly LoadMonoGacAssembly(string name) |
||||
{ |
||||
MonoAssemblyName assemblyName = MonoGlobalAssemblyCache.FindAssemblyName(name); |
||||
if (assemblyName != null && assemblyName.FileName != null) { |
||||
return Assembly.ReflectionOnlyLoadFrom(assemblyName.FileName); |
||||
} |
||||
return null; |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,123 @@
@@ -0,0 +1,123 @@
|
||||
// <file>
|
||||
// <copyright see="prj:///doc/copyright.txt"/>
|
||||
// <license see="prj:///doc/license.txt"/>
|
||||
// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/>
|
||||
// <version>$Revision$</version>
|
||||
// </file>
|
||||
|
||||
using Microsoft.Build.Framework; |
||||
using Microsoft.Build.Utilities; |
||||
using System; |
||||
using System.Collections.Generic; |
||||
|
||||
namespace ICSharpCode.Build.Tasks |
||||
{ |
||||
/// <summary>
|
||||
/// Adds GAC folders to the assembly search path for any GAC references.
|
||||
/// </summary>
|
||||
public class AddMonoAssemblySearchPaths : Task |
||||
{ |
||||
/// <summary>
|
||||
/// String used in the AssemblySearchPath property to specify where
|
||||
/// Mono GAC folder items should be added.
|
||||
/// </summary>
|
||||
public const string MonoGacSearchPathIndicator = "{MonoGAC}"; |
||||
|
||||
string[] paths; |
||||
ITaskItem[] assemblies; |
||||
|
||||
public AddMonoAssemblySearchPaths() |
||||
{ |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Mono assembly search paths.
|
||||
/// </summary>
|
||||
[Required] |
||||
[Output] |
||||
public string[] Paths { |
||||
get { |
||||
return paths; |
||||
} |
||||
set { |
||||
paths = value; |
||||
} |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// These are the assembly references in the project being built. This
|
||||
/// set of items is also passed to the ResolveAssemblyReference task.
|
||||
/// </summary>
|
||||
[Required] |
||||
public ITaskItem[] Assemblies { |
||||
get { |
||||
return assemblies; |
||||
} |
||||
set { |
||||
assemblies = value; |
||||
} |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// Replaces the {MonoGAC} entry in the AssemblySearchPaths.
|
||||
/// </summary>
|
||||
public override bool Execute() |
||||
{ |
||||
List<string> updatedSearchPaths = new List<string>(); |
||||
List<string> monoGacSearchPaths = new List<string>(); |
||||
|
||||
if (assemblies != null) { |
||||
foreach (ITaskItem item in assemblies) { |
||||
string monoGacFolder = GetMonoGacFolder(item); |
||||
if (monoGacFolder != null) { |
||||
monoGacSearchPaths.Add(monoGacFolder); |
||||
} |
||||
} |
||||
} |
||||
|
||||
// Add Mono GAC search paths to existing search paths.
|
||||
foreach (string path in paths) { |
||||
if (path.Equals(MonoGacSearchPathIndicator, StringComparison.InvariantCultureIgnoreCase)) { |
||||
updatedSearchPaths.AddRange(monoGacSearchPaths); |
||||
} else { |
||||
updatedSearchPaths.Add(path); |
||||
} |
||||
} |
||||
paths = new string[updatedSearchPaths.Count]; |
||||
updatedSearchPaths.CopyTo(paths); |
||||
|
||||
return true; |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// Gets the corresponding Mono GAC folder for the task item.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Basic logic is:
|
||||
///
|
||||
/// 1) If the Gac reference has a full specified assembly name
|
||||
/// (e.g. name, version, culture, public key token) then just generate
|
||||
/// the expected Gac folder.
|
||||
/// 2) If the Gac reference is a short name, then look in Mono's gac for
|
||||
/// latest version (i.e. highest version number) of the assembly and
|
||||
/// adds it folder.
|
||||
///
|
||||
/// Extra possiblities:
|
||||
///
|
||||
/// 1) Verify the assembly actually exists and take action accordingly.
|
||||
/// 2) Allow partial assembly names (i.e short + version and nothing else).
|
||||
/// 3) Check the hint path actually resolves to an assembly otherwise add
|
||||
/// a possible GAC folder.
|
||||
/// </remarks>
|
||||
/// <returns><see langword="null"/> if no GAC folder can be found
|
||||
/// for the task item.</returns>
|
||||
string GetMonoGacFolder(ITaskItem item) |
||||
{ |
||||
MonoAssemblyName assemblyName = MonoGlobalAssemblyCache.FindAssemblyName(item.ItemSpec); |
||||
if (assemblyName != null) { |
||||
return assemblyName.Directory; |
||||
} |
||||
return null; |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,81 @@
@@ -0,0 +1,81 @@
|
||||
// <file>
|
||||
// <copyright see="prj:///doc/copyright.txt"/>
|
||||
// <license see="prj:///doc/license.txt"/>
|
||||
// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/>
|
||||
// <version>$Revision$</version>
|
||||
// </file>
|
||||
|
||||
using Microsoft.Build.Framework; |
||||
using Microsoft.Build.Utilities; |
||||
using System; |
||||
|
||||
namespace ICSharpCode.Build.Tasks |
||||
{ |
||||
/// <summary>
|
||||
/// Gets the path to the Mono Framework assemblies.
|
||||
/// </summary>
|
||||
public class GetMonoFrameworkPath : Task |
||||
{ |
||||
public const string TargetMonoFrameworkVersion11 = "Mono v1.1"; |
||||
public const string TargetMonoFrameworkVersion20 = "Mono v2.0"; |
||||
|
||||
string path = String.Empty; |
||||
TargetMonoFrameworkVersion targetFrameworkVersion = TargetMonoFrameworkVersion.VersionLatest; |
||||
|
||||
public GetMonoFrameworkPath() |
||||
{ |
||||
} |
||||
|
||||
[Output] |
||||
public string Path { |
||||
get { |
||||
return path; |
||||
} |
||||
set { |
||||
path = value; |
||||
} |
||||
} |
||||
|
||||
public string TargetFrameworkVersion { |
||||
get { |
||||
return ConvertToString(targetFrameworkVersion); |
||||
} |
||||
set { |
||||
targetFrameworkVersion = ConvertToEnum(value); |
||||
} |
||||
} |
||||
|
||||
public override bool Execute() |
||||
{ |
||||
if (MonoToolLocationHelper.IsMonoInstalled) { |
||||
System.Diagnostics.Debug.WriteLine("TargetFrameworkVersion: " + targetFrameworkVersion.ToString()); |
||||
path = MonoToolLocationHelper.GetPathToMonoFramework(targetFrameworkVersion); |
||||
System.Diagnostics.Debug.WriteLine("MonoFrameworkPath: " + path); |
||||
return true; |
||||
} |
||||
Log.LogError("Mono is not installed."); |
||||
return false; |
||||
} |
||||
|
||||
static string ConvertToString(TargetMonoFrameworkVersion frameworkVersion) |
||||
{ |
||||
switch (frameworkVersion) { |
||||
case TargetMonoFrameworkVersion.Version11: |
||||
return TargetMonoFrameworkVersion11; |
||||
case TargetMonoFrameworkVersion.Version20: |
||||
return TargetMonoFrameworkVersion20; |
||||
} |
||||
return null; |
||||
} |
||||
|
||||
static TargetMonoFrameworkVersion ConvertToEnum(string frameworkVersion) |
||||
{ |
||||
if (frameworkVersion == TargetMonoFrameworkVersion11) { |
||||
return TargetMonoFrameworkVersion.Version11; |
||||
} else if (frameworkVersion == TargetMonoFrameworkVersion20) { |
||||
return TargetMonoFrameworkVersion.Version20; |
||||
} |
||||
throw new ArgumentException(String.Concat("Unknown Target Mono Framework Version: ", frameworkVersion)); |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,47 @@
@@ -0,0 +1,47 @@
|
||||
// <file>
|
||||
// <copyright see="prj:///doc/copyright.txt"/>
|
||||
// <license see="prj:///doc/license.txt"/>
|
||||
// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/>
|
||||
// <version>$Revision$</version>
|
||||
// </file>
|
||||
|
||||
using Microsoft.Build.Framework; |
||||
using Microsoft.Build.Utilities; |
||||
using System; |
||||
|
||||
namespace ICSharpCode.Build.Tasks |
||||
{ |
||||
/// <summary>
|
||||
/// Gets the path to the Mono SDK folder.
|
||||
/// </summary>
|
||||
public class GetMonoFrameworkSdkPath : Task |
||||
{ |
||||
string path = String.Empty; |
||||
|
||||
public GetMonoFrameworkSdkPath() |
||||
{ |
||||
} |
||||
|
||||
[Output] |
||||
public string Path { |
||||
get { |
||||
return path; |
||||
} |
||||
set { |
||||
path = value; |
||||
} |
||||
} |
||||
|
||||
public override bool Execute() |
||||
{ |
||||
if (MonoToolLocationHelper.IsMonoInstalled) { |
||||
path = MonoToolLocationHelper.GetPathToMonoSdk(); |
||||
System.Diagnostics.Debug.WriteLine("MonoSdk: " + path); |
||||
return true; |
||||
} |
||||
Log.LogError("Mono is not installed."); |
||||
return false; |
||||
|
||||
} |
||||
} |
||||
} |
@ -0,0 +1,196 @@
@@ -0,0 +1,196 @@
|
||||
// <file>
|
||||
// <copyright see="prj:///doc/copyright.txt"/>
|
||||
// <license see="prj:///doc/license.txt"/>
|
||||
// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/>
|
||||
// <version>$Revision$</version>
|
||||
// </file>
|
||||
|
||||
using System; |
||||
using System.Globalization; |
||||
using System.IO; |
||||
using System.Reflection; |
||||
using System.Text; |
||||
|
||||
namespace ICSharpCode.Build.Tasks |
||||
{ |
||||
public class MonoAssemblyName |
||||
{ |
||||
string name = String.Empty; |
||||
Version version; |
||||
string directory = String.Empty; |
||||
CultureInfo cultureInfo; |
||||
byte[] publicKeyToken; |
||||
|
||||
public MonoAssemblyName(string name) : this(name, String.Empty) |
||||
{ |
||||
} |
||||
|
||||
public MonoAssemblyName(string name, string directory) |
||||
{ |
||||
AssemblyName assemblyName = new AssemblyName(name); |
||||
this.name = assemblyName.Name; |
||||
version = assemblyName.Version; |
||||
cultureInfo = assemblyName.CultureInfo; |
||||
publicKeyToken = assemblyName.GetPublicKeyToken(); |
||||
this.directory = directory; |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// Returns whether the assembly name, version, culture and public key token
|
||||
/// are specified.
|
||||
/// </summary>
|
||||
public bool IsFullyQualified { |
||||
get { |
||||
return (name != null) && (version != null) && (cultureInfo != null) && (publicKeyToken != null); |
||||
} |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// The short name of the assembly.
|
||||
/// </summary>
|
||||
public string Name { |
||||
get { |
||||
return name; |
||||
} |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// Returns the full assembly name of the form:
|
||||
/// Name, Version, Culture, Public Key Token.
|
||||
/// </summary>
|
||||
public string FullName { |
||||
get { |
||||
return GetFullName(name, GetVersionAsString(version), GetCultureAsString(cultureInfo), GetPublicKeyTokenAsString(publicKeyToken)); |
||||
} |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// Returns the full assembly name of the form:
|
||||
/// Name, Version, Culture, Public Key Token.
|
||||
/// </summary>
|
||||
public static string GetFullName(string name, string version, string cultureInfo, string publicKeyToken) |
||||
{ |
||||
StringBuilder fullName = new StringBuilder(); |
||||
|
||||
// Add name.
|
||||
fullName.Append(name); |
||||
|
||||
// Add version.
|
||||
if (version != null) { |
||||
fullName.AppendFormat(", Version={0}", version); |
||||
} |
||||
|
||||
// Add culture.
|
||||
string culture = "neutral"; |
||||
if (cultureInfo != null) { |
||||
culture = cultureInfo; |
||||
} |
||||
fullName.AppendFormat(", Culture={0}", culture); |
||||
|
||||
// Add public key token.
|
||||
if (publicKeyToken != null && publicKeyToken.Length > 0) { |
||||
fullName.AppendFormat(", PublicKeyToken={0}", publicKeyToken); |
||||
} |
||||
return fullName.ToString(); |
||||
} |
||||
|
||||
public Version Version { |
||||
get { |
||||
return version; |
||||
} |
||||
} |
||||
|
||||
public CultureInfo CultureInfo { |
||||
get { |
||||
return cultureInfo; |
||||
} |
||||
} |
||||
|
||||
public byte[] GetPublicKeyToken() |
||||
{ |
||||
return publicKeyToken; |
||||
} |
||||
|
||||
public static string GetPublicKeyTokenAsString(byte[] publicKeyToken) |
||||
{ |
||||
StringBuilder convertedToken = new StringBuilder(); |
||||
if (publicKeyToken != null) { |
||||
foreach (byte b in publicKeyToken) { |
||||
convertedToken.Append(b.ToString("x2")); |
||||
} |
||||
} |
||||
return convertedToken.ToString(); |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the full path to the assembly excluding the assembly name.
|
||||
/// </summary>
|
||||
public string Directory { |
||||
get { |
||||
return directory; |
||||
} |
||||
set { |
||||
directory = value; |
||||
} |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// Gets the full filename of the assembly.
|
||||
/// </summary>
|
||||
public string FileName { |
||||
get { |
||||
return Path.Combine(directory, String.Concat(name, ".dll")); |
||||
} |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// Determines whether the assembly names match.
|
||||
/// </summary>
|
||||
/// <returns>
|
||||
/// Handles partially qualified assembly names and will return
|
||||
/// <see langword="true"/> if the match is a partial match.
|
||||
/// </returns>
|
||||
public bool IsMatch(MonoAssemblyName assemblyName) |
||||
{ |
||||
if (name == assemblyName.Name) { |
||||
if (assemblyName.publicKeyToken != null && publicKeyToken != null) { |
||||
if (assemblyName.publicKeyToken.Length == publicKeyToken.Length) { |
||||
for (int i = 0; i < publicKeyToken.Length; ++i) { |
||||
if (publicKeyToken[i] != assemblyName.publicKeyToken[i]) { |
||||
return false; |
||||
} |
||||
} |
||||
} |
||||
} |
||||
if (assemblyName.version != null && version != null) { |
||||
if (assemblyName.version != version) { |
||||
return false; |
||||
} |
||||
} |
||||
if (assemblyName.cultureInfo != null && cultureInfo != null) { |
||||
if (assemblyName.cultureInfo == cultureInfo) { |
||||
return false; |
||||
} |
||||
} |
||||
return true; |
||||
} |
||||
return false; |
||||
} |
||||
|
||||
static string GetVersionAsString(Version version) |
||||
{ |
||||
if (version != null) { |
||||
return version.ToString(); |
||||
} |
||||
return null; |
||||
} |
||||
|
||||
static string GetCultureAsString(CultureInfo cultureInfo) |
||||
{ |
||||
if (cultureInfo != null && cultureInfo.Name.Length > 0) { |
||||
return cultureInfo.Name; |
||||
} |
||||
return null; |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,119 @@
@@ -0,0 +1,119 @@
|
||||
// <file>
|
||||
// <copyright see="prj:///doc/copyright.txt"/>
|
||||
// <license see="prj:///doc/license.txt"/>
|
||||
// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/>
|
||||
// <version>$Revision$</version>
|
||||
// </file>
|
||||
|
||||
using System; |
||||
using System.Globalization; |
||||
using System.IO; |
||||
using System.Reflection; |
||||
using System.Text; |
||||
|
||||
namespace ICSharpCode.Build.Tasks |
||||
{ |
||||
public class MonoGacDirectory |
||||
{ |
||||
string gacBaseDirectory = String.Empty; |
||||
MonoAssemblyName assemblyName; |
||||
|
||||
public MonoGacDirectory() |
||||
{ |
||||
} |
||||
|
||||
public MonoGacDirectory(string gacBaseDirectory, MonoAssemblyName assemblyName) |
||||
{ |
||||
this.gacBaseDirectory = gacBaseDirectory; |
||||
this.assemblyName = assemblyName; |
||||
} |
||||
|
||||
public MonoGacDirectory(string gacBaseDirectory, string assemblyDirectoryName, string versionDirectoryName) |
||||
{ |
||||
string assemblyDirectory = Path.Combine(gacBaseDirectory, Path.Combine(assemblyDirectoryName, versionDirectoryName)); |
||||
assemblyName = new MonoAssemblyName(GetAssemblyName(assemblyDirectoryName, versionDirectoryName), assemblyDirectory); |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// The assembly name associated with this directory.
|
||||
/// </summary>
|
||||
public MonoAssemblyName AssemblyName { |
||||
get { |
||||
return assemblyName; |
||||
} |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// Gets the full path to the directory containing the assembly.
|
||||
/// </summary>
|
||||
public string FullPath { |
||||
get { |
||||
return Path.Combine(gacBaseDirectory, Path.Combine(assemblyName.Name, GetSubFolderName(assemblyName.Version, assemblyName.CultureInfo, assemblyName.GetPublicKeyToken()))); |
||||
} |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// Gets the Mono Gac directory based on the assembly name.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// If the assembly name is not fully qualified then this method returns
|
||||
/// null.
|
||||
/// </remarks>
|
||||
public static MonoGacDirectory GetAssemblyDirectory(string gacBaseDirectory, MonoAssemblyName assemblyName) |
||||
{ |
||||
if (assemblyName.IsFullyQualified) { |
||||
return new MonoGacDirectory(gacBaseDirectory, assemblyName); |
||||
} |
||||
return null; |
||||
} |
||||
|
||||
public static string GetAssemblyName(string assemblyDirectoryName, string versionDirectoryName) |
||||
{ |
||||
string version = null; |
||||
string culture = null; |
||||
string publicKeyToken = null; |
||||
|
||||
if (versionDirectoryName != null && versionDirectoryName.Length > 0) { |
||||
string[] items = versionDirectoryName.Split('_'); |
||||
if (items.Length == 3) { |
||||
if (items[0].Length > 0) { |
||||
version = items[0]; |
||||
} |
||||
if (items[1].Length > 0) { |
||||
culture = items[1]; |
||||
} |
||||
if (items[2].Length > 0) { |
||||
publicKeyToken = items[2]; |
||||
} |
||||
} |
||||
} |
||||
return MonoAssemblyName.GetFullName(assemblyDirectoryName, version, culture, publicKeyToken); |
||||
} |
||||
|
||||
static string GetSubFolderName(Version version, CultureInfo culture, byte[] publicKeyToken) |
||||
{ |
||||
StringBuilder folderName = new StringBuilder(); |
||||
|
||||
// Add version.
|
||||
if (version != null) { |
||||
folderName.Append(version.ToString()); |
||||
} |
||||
folderName.Append("_"); |
||||
|
||||
// Add culture.
|
||||
if (culture != null) { |
||||
folderName.Append(culture.Name); |
||||
} |
||||
folderName.Append("_"); |
||||
|
||||
// Add public key token.
|
||||
if (publicKeyToken != null) { |
||||
foreach (byte b in publicKeyToken) { |
||||
folderName.Append(b.ToString("x2")); |
||||
} |
||||
} |
||||
|
||||
return folderName.ToString(); |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,122 @@
@@ -0,0 +1,122 @@
|
||||
// <file>
|
||||
// <copyright see="prj:///doc/copyright.txt"/>
|
||||
// <license see="prj:///doc/license.txt"/>
|
||||
// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/>
|
||||
// <version>$Revision$</version>
|
||||
// </file>
|
||||
|
||||
using Microsoft.Win32; |
||||
using System; |
||||
using System.Collections.Generic; |
||||
using System.IO; |
||||
using System.Security; |
||||
|
||||
namespace ICSharpCode.Build.Tasks |
||||
{ |
||||
public class MonoGlobalAssemblyCache |
||||
{ |
||||
MonoGlobalAssemblyCache() |
||||
{ |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// Gets all the assembly names in the Mono GAC.
|
||||
/// </summary>
|
||||
/// <param name="folder">The GAC folder</param>
|
||||
public static List<MonoAssemblyName> GetAssemblyNames(string folder) |
||||
{ |
||||
List<MonoAssemblyName> assemblyNames = new List<MonoAssemblyName>(); |
||||
if (folder != null && Directory.Exists(folder)) { |
||||
DirectoryInfo gacDirectoryInfo = new DirectoryInfo(folder); |
||||
foreach (DirectoryInfo assemblyNameDirectoryInfo in gacDirectoryInfo.GetDirectories()) { |
||||
foreach (DirectoryInfo versionDirectoryInfo in assemblyNameDirectoryInfo.GetDirectories()) { |
||||
string assemblyFullName = MonoGacDirectory.GetAssemblyName(assemblyNameDirectoryInfo.Name, versionDirectoryInfo.Name); |
||||
MonoAssemblyName name = CreateMonoAssemblyName(assemblyFullName); |
||||
if (name != null) { |
||||
name.Directory = versionDirectoryInfo.FullName; |
||||
assemblyNames.Add(name); |
||||
} |
||||
} |
||||
} |
||||
} |
||||
return assemblyNames; |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// Gets all the assembly names in the Mono GAC.
|
||||
/// </summary>
|
||||
public static List<MonoAssemblyName> GetAssemblyNames() |
||||
{ |
||||
return GetAssemblyNames(MonoToolLocationHelper.GetPathToMonoGac()); |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// Finds the GAC assembly which matches the specified name.
|
||||
/// </summary>
|
||||
/// <param name="name">
|
||||
/// A short name or a fully qualifed assembly name of the form
|
||||
/// (glib-sharp, Version=1.0, Culture=neutral, PublicKeyToken=9449494)
|
||||
/// </param>
|
||||
public static MonoAssemblyName FindAssemblyName(string name) |
||||
{ |
||||
string gacFolder = MonoToolLocationHelper.GetPathToMonoGac(); |
||||
if (gacFolder != null) { |
||||
MonoAssemblyName assemblyName = CreateMonoAssemblyName(name); |
||||
if (assemblyName != null) { |
||||
if (assemblyName.IsFullyQualified) { |
||||
MonoGacDirectory directory = MonoGacDirectory.GetAssemblyDirectory(gacFolder, assemblyName); |
||||
if (directory != null) { |
||||
assemblyName.Directory = directory.FullPath; |
||||
return assemblyName; |
||||
} |
||||
} else { |
||||
return FindPartialAssemblyName(assemblyName); |
||||
} |
||||
} |
||||
} |
||||
return null; |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// Tries to match the partially specified assembly name.
|
||||
/// </summary>
|
||||
static MonoAssemblyName FindPartialAssemblyName(MonoAssemblyName partialName) |
||||
{ |
||||
string assemblyDirectoryName = Path.Combine(MonoToolLocationHelper.GetPathToMonoGac(), partialName.Name); |
||||
if (Directory.Exists(assemblyDirectoryName)) { |
||||
MonoAssemblyName matchedName = null; |
||||
DirectoryInfo assemblyNameDirectoryInfo = new DirectoryInfo(assemblyDirectoryName); |
||||
foreach (DirectoryInfo versionDirectoryInfo in assemblyNameDirectoryInfo.GetDirectories()) { |
||||
string assemblyFullName = MonoGacDirectory.GetAssemblyName(assemblyNameDirectoryInfo.Name, versionDirectoryInfo.Name); |
||||
MonoAssemblyName name = CreateMonoAssemblyName(assemblyFullName, versionDirectoryInfo.FullName); |
||||
if (name != null && name.IsFullyQualified) { |
||||
if (matchedName == null) { |
||||
if (partialName.IsMatch(name)) { |
||||
matchedName = name; |
||||
} |
||||
} else if (partialName.IsMatch(name) && name.Version > matchedName.Version) { |
||||
matchedName = name; |
||||
} |
||||
} |
||||
} |
||||
return matchedName; |
||||
} |
||||
|
||||
return null; |
||||
} |
||||
|
||||
static MonoAssemblyName CreateMonoAssemblyName(string name, string directory) |
||||
{ |
||||
try { |
||||
return new MonoAssemblyName(name, directory); |
||||
} catch (Exception) { } |
||||
|
||||
return null; |
||||
} |
||||
|
||||
static MonoAssemblyName CreateMonoAssemblyName(string name) |
||||
{ |
||||
return CreateMonoAssemblyName(name, String.Empty); |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,18 @@
@@ -0,0 +1,18 @@
|
||||
// <file>
|
||||
// <copyright see="prj:///doc/copyright.txt"/>
|
||||
// <license see="prj:///doc/license.txt"/>
|
||||
// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/>
|
||||
// <version>$Revision$</version>
|
||||
// </file>
|
||||
|
||||
using System; |
||||
|
||||
namespace ICSharpCode.Build.Tasks |
||||
{ |
||||
public enum TargetMonoFrameworkVersion |
||||
{ |
||||
Version11 = 0, |
||||
Version20 = 1, |
||||
VersionLatest = 1 |
||||
} |
||||
} |
Loading…
Reference in new issue