- SharpShell_Source_Code.zip
- Dependencies
- Apex
- Apex.dll
- Apex.WinForms.dll
- SharpShell
- .nuget
- Info.txt
- packages
- Apex.1.5.0
- Apex.1.5.0.nupkg
- lib
- net35
- Apex.dll
- net40
- Apex.dll
- sl30
- Apex.Silverlight.dll
- sl3-wp
- Apex.WP7.dll
- sl40
- Apex.Silverlight4.dll
- sl4-wp71
- Apex.WP7.dll
- sl50
- Apex.Silverlight.dll
- ILMerge.2.12.0803
- ILMerge.2.12.0803.nupkg
- ILMerge.doc
- ILMerge.exe
- NUnit.2.6.2
- repositories.config
- Samples
- ContextMenu
- CopyDirectoryLocationHandler
- CountLinesExtension
- DllContextMenuExtension
- MultipleExtensionsSample
- DataHandler
- CopyPathDataHandler
- DropHandler
- XsdDropHandler
- IconHandler
- DllIconHandler
- IconOverlayHandler
- LockedFileIconOverlayHandler
- ReadOnlyFileIconOverlayHandler
- InfoTipHandler
- FolderInfoTipHandler
- PreviewHandler
- IconPreviewHandler
- PropertySheet
- FileTimesPropertySheet
- ResourcesPropertySheet
- ThumbnailHandler
- TxtThumbnailHandler
- SharedAssemblyInfo.cs
- SharpShell.sln
- SharpShell
- SharpShellNativeBridge
- Tests
- SharpShell.Tests
- Tools
- ExtensionManager
- Properties
- Resources
- xsd.ico
- ServerInspector
- ServerManager
- ShellExtensionManager
- SharpShell_Core_Library.zip
- SharpShell_Tools.zip
- Apex.WinForms.dll
- ServerManager.exe
- SharpShell.dll
|
using System;
using System.Windows.Forms;
using SharpShell.Attributes;
using IDataObject = System.Runtime.InteropServices.ComTypes.IDataObject;
namespace SharpShell.SharpDataHandler
{
/// <summary>
/// The SharpDataHandler is the base class for SharpShell servers that provide
/// custom Icon Handlers.
/// </summary>
[ServerType(ServerType.ShellDataHandler)]
public abstract class SharpDataHandler : PersistFileServer, IDataObject
{
#region Implementation of IDataObject
int IDataObject.DAdvise(ref System.Runtime.InteropServices.ComTypes.FORMATETC pFormatetc, System.Runtime.InteropServices.ComTypes.ADVF advf, System.Runtime.InteropServices.ComTypes.IAdviseSink adviseSink, out int connection)
{
// Log key events.
Log("IDataObject.DAdvise called.");
// Not needed for Shell Data Handlers.
throw new NotImplementedException();
}
void IDataObject.DUnadvise(int connection)
{
// Log key events.
Log("IDataObject.DUnadvise called.");
// Not needed for Shell Data Handlers.
throw new NotImplementedException();
}
int IDataObject.EnumDAdvise(out System.Runtime.InteropServices.ComTypes.IEnumSTATDATA enumAdvise)
{
// Log key events.
Log("IDataObject.EnumDAdvise called.");
// Not needed for Shell Data Handlers.
throw new NotImplementedException();
}
System.Runtime.InteropServices.ComTypes.IEnumFORMATETC IDataObject.EnumFormatEtc(System.Runtime.InteropServices.ComTypes.DATADIR direction)
{
// Log key events.
Log("IDataObject.EnumFormatEtc called.");
// Not needed for Shell Data Handlers.
throw new NotImplementedException();
}
int IDataObject.GetCanonicalFormatEtc(ref System.Runtime.InteropServices.ComTypes.FORMATETC formatIn, out System.Runtime.InteropServices.ComTypes.FORMATETC formatOut)
{
// Log key events.
Log("IDataObject.GetCanonicalFormatEtc called.");
// Not needed for Shell Data Handlers.
throw new NotImplementedException();
}
void IDataObject.GetData(ref System.Runtime.InteropServices.ComTypes.FORMATETC format, out System.Runtime.InteropServices.ComTypes.STGMEDIUM medium)
{
// Log key events.
Log("IDataObject.GetData called.");
// Not needed for Shell Data Handlers.
throw new NotImplementedException();
}
void IDataObject.GetDataHere(ref System.Runtime.InteropServices.ComTypes.FORMATETC format, ref System.Runtime.InteropServices.ComTypes.STGMEDIUM medium)
{
// Log key events.
Log("IDataObject.GetDataHere called.");
// Not needed for Shell Data Handlers.
throw new NotImplementedException();
}
int IDataObject.QueryGetData(ref System.Runtime.InteropServices.ComTypes.FORMATETC format)
{
// Log key events.
Log("IDataObject.QueryGetData called.");
// Not needed for Shell Data Handlers.
throw new NotImplementedException();
}
void IDataObject.SetData(ref System.Runtime.InteropServices.ComTypes.FORMATETC formatIn, ref System.Runtime.InteropServices.ComTypes.STGMEDIUM medium, bool release)
{
// Log key events.
Log("IDataObject.SetData called.");
try
{
// Let the derived class provide data.
var itemData = GetData();
// Set the data.
((IDataObject)itemData).SetData(ref formatIn, ref medium, release);
}
catch (Exception exception)
{
LogError("An exception occured getting data for the item " + SelectedItemPath, exception);
}
}
#endregion
/// <summary>
/// Gets the data for the selected item. The selected item's path is stored in the SelectedItemPath property.
/// </summary>
/// <returns>The data for the selected item, or null if there is none.</returns>
protected abstract DataObject GetData();
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.