Skip to content

Commit

Permalink
Merge branch 'v2.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
dwmkerr committed Nov 30, 2014
2 parents 1cb5aed + 8dca06e commit b3307c7
Show file tree
Hide file tree
Showing 61 changed files with 1,584 additions and 768 deletions.
24 changes: 24 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
## Version 2.2

* SharpShell is now built with Visual Studio 2013 Community Edition.
* Overhauled the logging mechanism.
* Fixed preview handler bugs #33, #58, #50, #52, #56.
* Preview handlers no longer flicker.


### Breaking Changes

* `Logging.DebugLog` and `Logging.DebugError` are no longer available. Logging is
enabled based on configuration in the registry rather than debug mode. Use
`Logging.Log` or `Logging.Error` instead.
* `Logging` class has no facility to enable/disable logging.
* Preview Handlers MUST be decorated with the `PreviewHandler` attribute. This
pattern will be implemented for other extensions in time.

### srm

* Show SharpShell config on the machine with `srm config`.

### Development

* The SharpShell assembly embedded into SRM is updated automatically during the build.
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
using System.Runtime.InteropServices;
using SharpShell.Attributes;
using SharpShell.SharpPreviewHandler;

namespace AbcPreviewHandler
{
/// <summary>
/// The Abc Preview Handler is a preview handler that shows a simple
/// coloured background for ABC files.
/// </summary>
[ComVisible(true)]
[COMServerAssociation(AssociationType.ClassOfExtension, ".abc")]
[DisplayName("Abc Preview Handler")]
[Guid("B86199F1-13D0-4711-AFE6-08C1E4C58905")]
[PreviewHandler(DisableLowILProcessIsolation = false)]
public class AbcPreviewHandler : SharpPreviewHandler
{
/// <summary>
/// DoPreview must create the preview handler user interface and initialize it with data
/// provided by the shell.
/// </summary>
/// <returns>
/// The preview handler user interface.
/// </returns>
protected override PreviewHandlerControl DoPreview()
{
// Create the handler control.
var handler = new AbcPreviewHandlerControl();

// Do we have a file path? If so, we can do a preview.
if(!string.IsNullOrEmpty(SelectedFilePath))
handler.DoPreview(SelectedFilePath);

// Return the handler control.
return handler;
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{1A56CE6E-68DF-42A3-A8C4-B28D6E5EF632}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>AbcPreviewHandler</RootNamespace>
<AssemblyName>AbcPreviewHandler</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
<SignAssembly>true</SignAssembly>
</PropertyGroup>
<PropertyGroup>
<AssemblyOriginatorKeyFile>Key.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="AbcPreviewHandler.cs" />
<Compile Include="AbcPreviewHandlerControl.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="AbcPreviewHandlerControl.Designer.cs">
<DependentUpon>AbcPreviewHandlerControl.cs</DependentUpon>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="Key.snk" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="AbcPreviewHandlerControl.resx">
<DependentUpon>AbcPreviewHandlerControl.cs</DependentUpon>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\SharpShell\SharpShell.csproj">
<Project>{B5D5F670-BFBA-4D09-91C6-74BB12B7EDD4}</Project>
<Name>SharpShell</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Windows.Forms;
using SharpShell.Diagnostics;
using SharpShell.SharpPreviewHandler;

namespace AbcPreviewHandler
{
/// <summary>
/// A user control that shows the icons in an icon file.
/// </summary>
public partial class AbcPreviewHandlerControl : PreviewHandlerControl
{
/// <summary>
/// Initializes a new instance of the <see cref="AbcPreviewHandlerControl"/> class.
/// </summary>
public AbcPreviewHandlerControl()
{
InitializeComponent();
}


/// <summary>
/// Does the preview.
/// </summary>
/// <param name="selectedFilePath">The selected file path.</param>
public void DoPreview(string selectedFilePath)
{

}

/// <summary>
/// Sets the color of the background, if possible, to coordinate with the windows
/// color scheme.
/// </summary>
/// <param name="color">The color.</param>
protected override void SetVisualsBackgroundColor(Color color)
{
// Set the background color.
//BackColor = color;
}
}
}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("AbcPreviewHandler")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("AbcPreviewHandler")]
[assembly: AssemblyCopyright("Copyright © 2014")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("e15a6c4a-3b3d-4385-bbac-30466a9eee37")]

// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ namespace IconPreviewHandler
[ComVisible(true)]
[COMServerAssociation(AssociationType.ClassOfExtension, ".ico")]
[DisplayName("Icon Preview Handler")]
[Guid("A643C50D-4206-4121-A895-9EA5C919557A")]
[Guid("B643C50D-4206-4121-A895-9EA5C919557A")]
[PreviewHandler(DisableLowILProcessIsolation = false)]
public class IconPreviewHandler : SharpPreviewHandler
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,12 @@
</ItemGroup>
<ItemGroup />
<ItemGroup>
<None Include="Dependencies\IconLib.dll" />
<None Include="Properties\Dependencies\IconLib.dll" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>copy "$(TargetPath)" "$(SolutionDir)..\Build\Samples"</PostBuildEvent>
<PostBuildEvent>copy "$(TargetPath)" "$(SolutionDir)..\Build\Samples"
copy "$(TargetDir)IconLib.dll" "$(SolutionDir)..\Build\Samples"</PostBuildEvent>
</PropertyGroup>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using System.Drawing.IconLib;
using System.Linq;
using System.Windows.Forms;
using SharpShell.Diagnostics;
using SharpShell.SharpPreviewHandler;

namespace IconPreviewHandler
Expand Down
Loading

0 comments on commit b3307c7

Please sign in to comment.