Browse Source
git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@1133 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61shortcuts
16 changed files with 442 additions and 6 deletions
@ -0,0 +1,27 @@ |
|||||||
|
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("HtmlPreview")] |
||||||
|
[assembly: AssemblyDescription("Addin for SharpDevelop 2.0")] |
||||||
|
[assembly: AssemblyConfiguration("")] |
||||||
|
[assembly: AssemblyCompany("")] |
||||||
|
[assembly: AssemblyProduct("SharpDevelop")] |
||||||
|
[assembly: AssemblyCopyright("GNU Lesser General Public Licence")] |
||||||
|
[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.*")] |
||||||
|
|
||||||
@ -0,0 +1,15 @@ |
|||||||
|
<AddIn name = "HtmlPreview" |
||||||
|
author = "Daniel Grunwald" |
||||||
|
copyright = "GNU Lesser General Public License"> |
||||||
|
|
||||||
|
<Runtime> |
||||||
|
<Import assembly = "HtmlPreview.dll"/> |
||||||
|
</Runtime> |
||||||
|
|
||||||
|
<Path name = "/SharpDevelop/Workbench/DisplayBindings"> |
||||||
|
<DisplayBinding id = "HtmlPreview" |
||||||
|
type = "Secondary" |
||||||
|
class = "HtmlPreview.PreviewDisplayBinding" |
||||||
|
fileNamePattern = "\.html?$" /> |
||||||
|
</Path> |
||||||
|
</AddIn> |
||||||
@ -0,0 +1,62 @@ |
|||||||
|
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
||||||
|
<PropertyGroup> |
||||||
|
<OutputType>Library</OutputType> |
||||||
|
<RootNamespace>HtmlPreview</RootNamespace> |
||||||
|
<AssemblyName>HtmlPreview</AssemblyName> |
||||||
|
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> |
||||||
|
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> |
||||||
|
<ProjectGuid>{BECEEB35-A81D-4545-AC8E-BC622451DB99}</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> |
||||||
|
<StartAction>Program</StartAction> |
||||||
|
<StartProgram>..\..\..\bin\SharpDevelop.exe</StartProgram> |
||||||
|
<OutputPath>..\..\..\AddIns\Samples\HtmlPreview</OutputPath> |
||||||
|
</PropertyGroup> |
||||||
|
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' "> |
||||||
|
<Optimize>False</Optimize> |
||||||
|
<DefineConstants>DEBUG;TRACE</DefineConstants> |
||||||
|
<DebugSymbols>true</DebugSymbols> |
||||||
|
<DebugType>Full</DebugType> |
||||||
|
<CheckForOverflowUnderflow>True</CheckForOverflowUnderflow> |
||||||
|
</PropertyGroup> |
||||||
|
<PropertyGroup Condition=" '$(Configuration)' == 'Release' "> |
||||||
|
<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" /> |
||||||
|
<Reference Include="ICSharpCode.SharpDevelop"> |
||||||
|
<HintPath>..\..\..\bin\ICSharpCode.SharpDevelop.dll</HintPath> |
||||||
|
<SpecificVersion>False</SpecificVersion> |
||||||
|
<Private>False</Private> |
||||||
|
</Reference> |
||||||
|
<Reference Include="ICSharpCode.Core"> |
||||||
|
<HintPath>..\..\..\bin\ICSharpCode.Core.dll</HintPath> |
||||||
|
<SpecificVersion>False</SpecificVersion> |
||||||
|
<Private>False</Private> |
||||||
|
</Reference> |
||||||
|
</ItemGroup> |
||||||
|
<ItemGroup> |
||||||
|
<None Include="HtmlPreview.addin"> |
||||||
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory> |
||||||
|
</None> |
||||||
|
<Compile Include="Configuration\AssemblyInfo.cs" /> |
||||||
|
<Compile Include="Src\PreviewViewContent.cs" /> |
||||||
|
<Compile Include="Src\PreviewDisplayBinding.cs" /> |
||||||
|
</ItemGroup> |
||||||
|
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" /> |
||||||
|
</Project> |
||||||
@ -0,0 +1,16 @@ |
|||||||
|
Microsoft Visual Studio Solution File, Format Version 9.00 |
||||||
|
# SharpDevelop 2.0.0.1128 |
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HtmlPreview", "HtmlPreview.csproj", "{BECEEB35-A81D-4545-AC8E-BC622451DB99}" |
||||||
|
EndProject |
||||||
|
Global |
||||||
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution |
||||||
|
Debug|Any CPU = Debug|Any CPU |
||||||
|
Release|Any CPU = Release|Any CPU |
||||||
|
EndGlobalSection |
||||||
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution |
||||||
|
{BECEEB35-A81D-4545-AC8E-BC622451DB99}.Debug|Any CPU.Build.0 = Debug|Any CPU |
||||||
|
{BECEEB35-A81D-4545-AC8E-BC622451DB99}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
||||||
|
{BECEEB35-A81D-4545-AC8E-BC622451DB99}.Release|Any CPU.Build.0 = Release|Any CPU |
||||||
|
{BECEEB35-A81D-4545-AC8E-BC622451DB99}.Release|Any CPU.ActiveCfg = Release|Any CPU |
||||||
|
EndGlobalSection |
||||||
|
EndGlobal |
||||||
@ -0,0 +1,33 @@ |
|||||||
|
/* |
||||||
|
* Created by SharpDevelop. |
||||||
|
* User: Daniel Grunwald |
||||||
|
* Date: 19.10.2005 |
||||||
|
* Time: 17:02 |
||||||
|
*/ |
||||||
|
|
||||||
|
using System; |
||||||
|
using ICSharpCode.Core; |
||||||
|
using ICSharpCode.SharpDevelop.Gui; |
||||||
|
|
||||||
|
namespace HtmlPreview |
||||||
|
{ |
||||||
|
/// <summary>
|
||||||
|
/// Description of PreviewDisplayBinding.
|
||||||
|
/// </summary>
|
||||||
|
public class PreviewDisplayBinding : ISecondaryDisplayBinding |
||||||
|
{ |
||||||
|
public bool ReattachWhenParserServiceIsReady { |
||||||
|
get { |
||||||
|
return false; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
public bool CanAttachTo(IViewContent content) { |
||||||
|
return true; |
||||||
|
} |
||||||
|
|
||||||
|
public ISecondaryViewContent[] CreateSecondaryViewContent(IViewContent viewContent) { |
||||||
|
return new ISecondaryViewContent[] { new PreviewViewContent() }; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
@ -0,0 +1,53 @@ |
|||||||
|
/* |
||||||
|
* Created by SharpDevelop. |
||||||
|
* User: Daniel Grunwald |
||||||
|
* Date: 19.10.2005 |
||||||
|
* Time: 15:53 |
||||||
|
*/ |
||||||
|
|
||||||
|
using System; |
||||||
|
using System.Windows.Forms; |
||||||
|
using ICSharpCode.Core; |
||||||
|
using ICSharpCode.SharpDevelop.Gui; |
||||||
|
|
||||||
|
namespace HtmlPreview |
||||||
|
{ |
||||||
|
/// <summary>
|
||||||
|
/// Description of PreviewViewContent.
|
||||||
|
/// </summary>
|
||||||
|
public class PreviewViewContent : AbstractSecondaryViewContent |
||||||
|
{ |
||||||
|
public PreviewViewContent() |
||||||
|
{ |
||||||
|
} |
||||||
|
|
||||||
|
WebBrowser browser = new WebBrowser(); |
||||||
|
|
||||||
|
#region ICSharpCode.SharpDevelop.Gui.AbstractSecondaryViewContent interface implementation
|
||||||
|
public override Control Control { |
||||||
|
get { |
||||||
|
return browser; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
public override string TabPageText { |
||||||
|
get { |
||||||
|
return "Preview"; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
public override void Deselected() { |
||||||
|
browser.DocumentText = ""; |
||||||
|
base.Deselected(); |
||||||
|
} |
||||||
|
public override void Selected() { |
||||||
|
IViewContent viewContent = this.WorkbenchWindow.ViewContent; |
||||||
|
IEditable editable = (IEditable)viewContent; |
||||||
|
browser.DocumentText = editable.Text; |
||||||
|
base.Selected(); |
||||||
|
} |
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
} |
||||||
|
} |
||||||
@ -0,0 +1,27 @@ |
|||||||
|
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("ImageViewer")] |
||||||
|
[assembly: AssemblyDescription("Addin for SharpDevelop 2.0")] |
||||||
|
[assembly: AssemblyConfiguration("")] |
||||||
|
[assembly: AssemblyCompany("")] |
||||||
|
[assembly: AssemblyProduct("SharpDevelop")] |
||||||
|
[assembly: AssemblyCopyright("GNU Lesser General Public Licence")] |
||||||
|
[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.*")] |
||||||
|
|
||||||
@ -0,0 +1,23 @@ |
|||||||
|
<AddIn name = "ImageViewer" |
||||||
|
author = "Daniel Grunwald" |
||||||
|
copyright = "GNU Lesser General Public License"> |
||||||
|
|
||||||
|
<Runtime> |
||||||
|
<Import assembly = "ImageViewer.dll"/> |
||||||
|
</Runtime> |
||||||
|
|
||||||
|
<Path name="/SharpDevelop/Workbench/FileFilter"> |
||||||
|
<FileFilter id = "ImageFileFilter" |
||||||
|
name = "Images" |
||||||
|
extensions = "*.bmp;*.gif;*.jpg;*.jpeg;*.png" |
||||||
|
insertbefore = "Boo"/> |
||||||
|
</Path> |
||||||
|
|
||||||
|
<Path name = "/SharpDevelop/Workbench/DisplayBindings"> |
||||||
|
<DisplayBinding id = "ImageViewer" |
||||||
|
class = "ImageViewer.ImageViewerDisplayBinding" |
||||||
|
insertbefore = "Text" |
||||||
|
fileNamePattern = "\.(bmp|gif|jpe?g|png)$" |
||||||
|
languagePattern = "^ImagesFiles$"/> |
||||||
|
</Path> |
||||||
|
</AddIn> |
||||||
@ -0,0 +1,66 @@ |
|||||||
|
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
||||||
|
<PropertyGroup> |
||||||
|
<OutputType>Library</OutputType> |
||||||
|
<RootNamespace>ImageViewer</RootNamespace> |
||||||
|
<AssemblyName>ImageViewer</AssemblyName> |
||||||
|
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> |
||||||
|
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> |
||||||
|
<ProjectGuid>{BECEEB35-A81D-4545-AC8E-BC622451DB99}</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> |
||||||
|
<StartAction>Program</StartAction> |
||||||
|
<StartProgram>..\..\..\bin\SharpDevelop.exe</StartProgram> |
||||||
|
<OutputPath>..\..\..\AddIns\Samples\ImageViewer\</OutputPath> |
||||||
|
</PropertyGroup> |
||||||
|
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' "> |
||||||
|
<Optimize>False</Optimize> |
||||||
|
<DefineConstants>DEBUG;TRACE</DefineConstants> |
||||||
|
<DebugSymbols>true</DebugSymbols> |
||||||
|
<DebugType>Full</DebugType> |
||||||
|
<CheckForOverflowUnderflow>True</CheckForOverflowUnderflow> |
||||||
|
</PropertyGroup> |
||||||
|
<PropertyGroup Condition=" '$(Configuration)' == 'Release' "> |
||||||
|
<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" /> |
||||||
|
<Reference Include="ICSharpCode.Core"> |
||||||
|
<HintPath>..\..\..\bin\ICSharpCode.Core.dll</HintPath> |
||||||
|
<SpecificVersion>False</SpecificVersion> |
||||||
|
<Private>False</Private> |
||||||
|
</Reference> |
||||||
|
<Reference Include="ICSharpCode.SharpDevelop"> |
||||||
|
<HintPath>..\..\..\bin\ICSharpCode.SharpDevelop.dll</HintPath> |
||||||
|
<SpecificVersion>False</SpecificVersion> |
||||||
|
<Private>False</Private> |
||||||
|
</Reference> |
||||||
|
</ItemGroup> |
||||||
|
<ItemGroup> |
||||||
|
<None Include="ImageViewer.addin"> |
||||||
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory> |
||||||
|
</None> |
||||||
|
<Compile Include="Configuration\AssemblyInfo.cs" /> |
||||||
|
<Compile Include="Src\ImageViewerDisplayBinding.cs" /> |
||||||
|
<Compile Include="Src\ImageViewContent.cs" /> |
||||||
|
</ItemGroup> |
||||||
|
<ItemGroup> |
||||||
|
<Folder Include="Src" /> |
||||||
|
<Folder Include="Resources" /> |
||||||
|
</ItemGroup> |
||||||
|
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" /> |
||||||
|
</Project> |
||||||
@ -0,0 +1,16 @@ |
|||||||
|
Microsoft Visual Studio Solution File, Format Version 9.00 |
||||||
|
# SharpDevelop 2.0.0.1128 |
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ImageViewer", "ImageViewer.csproj", "{BECEEB35-A81D-4545-AC8E-BC622451DB99}" |
||||||
|
EndProject |
||||||
|
Global |
||||||
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution |
||||||
|
Debug|Any CPU = Debug|Any CPU |
||||||
|
Release|Any CPU = Release|Any CPU |
||||||
|
EndGlobalSection |
||||||
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution |
||||||
|
{BECEEB35-A81D-4545-AC8E-BC622451DB99}.Debug|Any CPU.Build.0 = Debug|Any CPU |
||||||
|
{BECEEB35-A81D-4545-AC8E-BC622451DB99}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
||||||
|
{BECEEB35-A81D-4545-AC8E-BC622451DB99}.Release|Any CPU.Build.0 = Release|Any CPU |
||||||
|
{BECEEB35-A81D-4545-AC8E-BC622451DB99}.Release|Any CPU.ActiveCfg = Release|Any CPU |
||||||
|
EndGlobalSection |
||||||
|
EndGlobal |
||||||
@ -0,0 +1,51 @@ |
|||||||
|
/* |
||||||
|
* Created by SharpDevelop. |
||||||
|
* User: Daniel Grunwald |
||||||
|
* Date: 19.10.2005 |
||||||
|
* Time: 21:43 |
||||||
|
*/ |
||||||
|
|
||||||
|
using System; |
||||||
|
using System.IO; |
||||||
|
using System.Windows.Forms; |
||||||
|
using ICSharpCode.Core; |
||||||
|
using ICSharpCode.SharpDevelop.Gui; |
||||||
|
|
||||||
|
namespace ImageViewer |
||||||
|
{ |
||||||
|
public class ImageViewContent : AbstractViewContent |
||||||
|
{ |
||||||
|
PictureBox box = new PictureBox(); |
||||||
|
public override Control Control { |
||||||
|
get { |
||||||
|
return box; |
||||||
|
} |
||||||
|
} |
||||||
|
public override string TabPageText { |
||||||
|
get { |
||||||
|
return "Image Viewer"; |
||||||
|
} |
||||||
|
} |
||||||
|
public override void Load(string fileName) { |
||||||
|
this.IsDirty = false; |
||||||
|
this.FileName = fileName; |
||||||
|
this.TitleName = Path.GetFileName(fileName); |
||||||
|
box.SizeMode = PictureBoxSizeMode.Zoom; |
||||||
|
box.Load(fileName); |
||||||
|
} |
||||||
|
|
||||||
|
public override void Save(string fileName) { |
||||||
|
this.IsDirty = false; |
||||||
|
this.FileName = fileName; |
||||||
|
this.TitleName = Path.GetFileName(fileName); |
||||||
|
box.Image.Save(fileName); |
||||||
|
} |
||||||
|
|
||||||
|
public override bool IsReadOnly { |
||||||
|
get { |
||||||
|
return (File.GetAttributes(this.FileName) |
||||||
|
& FileAttributes.ReadOnly) != 0; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
@ -0,0 +1,30 @@ |
|||||||
|
/* |
||||||
|
* Created by SharpDevelop. |
||||||
|
* User: Daniel Grunwald |
||||||
|
* Date: 19.10.2005 |
||||||
|
* Time: 21:41 |
||||||
|
*/ |
||||||
|
using System; |
||||||
|
using ICSharpCode.Core; |
||||||
|
using ICSharpCode.SharpDevelop.Gui; |
||||||
|
|
||||||
|
namespace ImageViewer |
||||||
|
{ |
||||||
|
public class ImageViewerDisplayBinding : IDisplayBinding |
||||||
|
{ |
||||||
|
public bool CanCreateContentForFile(string fileName) { |
||||||
|
return true; |
||||||
|
} |
||||||
|
public IViewContent CreateContentForFile(string fileName) { |
||||||
|
ImageViewContent vc = new ImageViewContent(); |
||||||
|
vc.Load(fileName); |
||||||
|
return vc; |
||||||
|
} |
||||||
|
public bool CanCreateContentForLanguage(string languageName) { |
||||||
|
return false; |
||||||
|
} |
||||||
|
public IViewContent CreateContentForLanguage(string languageName, string content) { |
||||||
|
throw new NotImplementedException(); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
Loading…
Reference in new issue