Browse Source

Update Mono addin sample for SharpDevelop 5

addin-manager-package-subdirectories
Matt Ward 12 years ago
parent
commit
b36b26459e
  1. 16
      samples/Mono/Mono.AddIn/Mono.AddIn.csproj
  2. 23
      samples/Mono/Mono.AddIn/Mono.addin
  3. 3
      samples/Mono/Mono.AddIn/Src/AddMonoReferenceCommand.cs
  4. 6
      samples/Mono/Mono.AddIn/Src/MonoGacReferencePanel.cs
  5. 56
      samples/Mono/Mono.AddIn/Src/MonoProjectContentRegistry.cs
  6. 2
      samples/Mono/Mono.AddIn/Templates/VBNet.Console.Project.xpt
  7. 2
      samples/Mono/Mono.AddIn/Templates/VBNet.Gtk.Window.xft
  8. 2
      samples/Mono/Mono.AddIn/Templates/VBNetGtkProject.xpt

16
samples/Mono/Mono.AddIn/Mono.AddIn.csproj

@ -15,8 +15,11 @@ @@ -15,8 +15,11 @@
<PlatformTarget>AnyCPU</PlatformTarget>
<FileAlignment>4096</FileAlignment>
<WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TreatWarningsAsErrors>False</TreatWarningsAsErrors>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<TargetFrameworkProfile />
<NoWin32Manifest>False</NoWin32Manifest>
<IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<OutputPath>..\..\..\AddIns\Samples\Mono.AddIn</OutputPath>
@ -25,6 +28,7 @@ @@ -25,6 +28,7 @@
<DebugSymbols>true</DebugSymbols>
<DebugType>Full</DebugType>
<CheckForOverflowUnderflow>True</CheckForOverflowUnderflow>
<BaseIntermediateOutputPath>obj\</BaseIntermediateOutputPath>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<OutputPath>..\..\..\AddIns\Samples\Mono.AddIn</OutputPath>
@ -34,6 +38,9 @@ @@ -34,6 +38,9 @@
<DebugType>None</DebugType>
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
</PropertyGroup>
<PropertyGroup Condition=" '$(Platform)' == 'AnyCPU' ">
<Prefer32Bit>False</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="ICSharpCode.Core">
<HintPath>..\..\..\bin\ICSharpCode.Core.dll</HintPath>
@ -43,10 +50,6 @@ @@ -43,10 +50,6 @@
<HintPath>..\..\..\bin\ICSharpCode.SharpDevelop.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="ICSharpCode.SharpDevelop.Dom">
<HintPath>..\..\..\bin\ICSharpCode.SharpDevelop.Dom.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Data" />
@ -59,7 +62,6 @@ @@ -59,7 +62,6 @@
<Compile Include="Src\AddMonoReferenceCommand.cs" />
<Compile Include="Src\IsMonoInstalledCondition.cs" />
<Compile Include="Src\MonoGacReferencePanel.cs" />
<Compile Include="Src\MonoProjectContentRegistry.cs" />
<Compile Include="Src\SelectMonoReferenceDialog.cs" />
<None Include="Templates\DefaultApp.config">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>

23
samples/Mono/Mono.AddIn/Mono.addin

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
<AddIn name = "Mono AddIn"
<AddIn name = "Mono"
author = "Matt Ward"
copyright = ""
description = "Mono support for SharpDevelop">
@ -45,23 +45,6 @@ @@ -45,23 +45,6 @@
</Condition>
</Condition>
</Path>
<Path name = "/Workspace/ProjectContentRegistry">
<ComplexCondition>
<And>
<Or>
<Condition name="CompareProjectProperty" property="MonoTargetFrameworkVersion" equals="v1.1"/>
<Condition name="CompareProjectProperty" property="MonoTargetFrameworkVersion" equals="v2.0"/>
<Condition name="CompareProjectProperty" property="MonoTargetFrameworkVersion" equals="v4.0"/>
</Or>
<Or>
<Condition name="ProjectActive" activeproject="C#"/>
<Condition name="ProjectActive" activeproject="VBNet"/>
</Or>
</And>
<ProjectContentRegistry id="MonoGac" class="Mono.AddIn.MonoProjectContentRegistry"/>
</ComplexCondition>
</Path>
<!--
Register path to SharpDevelop.Build.Mono.*.targets for the MSBuild engine.
@ -69,9 +52,9 @@ @@ -69,9 +52,9 @@
-->
<Path name="/SharpDevelop/MSBuildEngine/AdditionalProperties">
<String id="MonoBuildTasksPath" text="${AddInPath:Mono.AddIn}"/>
</Path>
</Path>
<Path name="/SharpDevelop/BackendBindings/Templates">
<Directory id="Mono" path="./Templates"/>
<TemplateFile id="Mono" path="./Templates"/>
</Path>
</AddIn>

3
samples/Mono/Mono.AddIn/Src/AddMonoReferenceCommand.cs

@ -28,6 +28,7 @@ @@ -28,6 +28,7 @@
using System;
using System.Windows.Forms;
using ICSharpCode.Core;
using ICSharpCode.SharpDevelop;
using ICSharpCode.SharpDevelop.Project;
namespace Mono.AddIn
@ -46,7 +47,7 @@ namespace Mono.AddIn @@ -46,7 +47,7 @@ namespace Mono.AddIn
return;
}
using (SelectMonoReferenceDialog selDialog = new SelectMonoReferenceDialog(project)) {
if (selDialog.ShowDialog(ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.MainWin32Window) == DialogResult.OK) {
if (selDialog.ShowDialog(SD.WinForms.MainWin32Window) == DialogResult.OK) {
foreach (ReferenceProjectItem reference in selDialog.ReferenceInformations) {
ProjectService.AddProjectItem(project, reference);
}

6
samples/Mono/Mono.AddIn/Src/MonoGacReferencePanel.cs

@ -25,12 +25,14 @@ @@ -25,12 +25,14 @@
// IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
// OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
using ICSharpCode.SharpDevelop.Dom;
using System;
using System.Collections.Generic;
using System.Windows.Forms;
using Mono.Build.Tasks;
using ICSharpCode.SharpDevelop.Dom;
using ICSharpCode.SharpDevelop.Gui;
using ICSharpCode.SharpDevelop.Parser;
using Mono.Build.Tasks;
namespace Mono.AddIn
{

56
samples/Mono/Mono.AddIn/Src/MonoProjectContentRegistry.cs

@ -1,56 +0,0 @@ @@ -1,56 +0,0 @@
// SharpDevelop samples
// Copyright (c) 2006, AlphaSierraPapa
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification, are
// permitted provided that the following conditions are met:
//
// - Redistributions of source code must retain the above copyright notice, this list
// of conditions and the following disclaimer.
//
// - Redistributions in binary form must reproduce the above copyright notice, this list
// of conditions and the following disclaimer in the documentation and/or other materials
// provided with the distribution.
//
// - Neither the name of the SharpDevelop team nor the names of its contributors may be used to
// endorse or promote products derived from this software without specific prior written
// permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS &AS IS& AND ANY EXPRESS
// OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
// AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
// IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
// OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
using System;
using System.IO;
using ICSharpCode.SharpDevelop;
using ICSharpCode.SharpDevelop.Dom;
using Mono.Build.Tasks;
namespace Mono.AddIn
{
public class MonoProjectContentRegistry : ProjectContentRegistry
{
protected override IProjectContent LoadProjectContent(string itemInclude, string itemFileName)
{
if (File.Exists(itemFileName)) {
return AssemblyParserService.DefaultProjectContentRegistry.GetProjectContentForReference(itemInclude, itemFileName);
}
MonoAssemblyName assemblyName = MonoGlobalAssemblyCache.FindAssemblyName(itemInclude);
if (assemblyName != null && assemblyName.FileName != null) {
return CecilReader.LoadAssembly(assemblyName.FileName, this);
} else {
if (MonoToolLocationHelper.IsMonoInstalled) {
HostCallback.ShowAssemblyLoadError(itemFileName, itemInclude, "Could not find assembly in Mono's GAC.");
} else {
HostCallback.ShowAssemblyLoadError(itemFileName, itemInclude, "Could not find assembly in Mono's GAC - Mono is not installed.");
}
return null;
}
}
}
}

2
samples/Mono/Mono.AddIn/Templates/VBNet.Console.Project.xpt

@ -8,7 +8,7 @@ @@ -8,7 +8,7 @@
<Name>Console Application</Name>
<Category>VB</Category>
<Subcategory>Mono</Subcategory>
<Icon>VBNet.Project.DOSProject</Icon>
<Icon>VB.Project.DOSProject</Icon>
<Description>Console project for Mono.</Description>
</TemplateConfiguration>

2
samples/Mono/Mono.AddIn/Templates/VBNet.Gtk.Window.xft

@ -3,7 +3,7 @@ @@ -3,7 +3,7 @@
<Config
name = "${res:Templates.File.GtkSharpWindow.Name}"
icon = "VBNet.File.Form"
icon = "VB.File.Form"
category = "VB"
subcategory = "Mono"
defaultname = "Window${Number}.vb"

2
samples/Mono/Mono.AddIn/Templates/VBNetGtkProject.xpt

@ -8,7 +8,7 @@ @@ -8,7 +8,7 @@
<Name>Gtk# Application</Name>
<Category>VB</Category>
<Subcategory>Mono</Subcategory>
<Icon>VBNet.Project.Form</Icon>
<Icon>VB.Project.Form</Icon>
<Description>A project that creates a Gtk# application.</Description>
</TemplateConfiguration>

Loading…
Cancel
Save