- SharpShell_Source.zip
- sharpshell
- Dependencies
- Apex
- Apex.WinForms.dll
- SharpShell
- Samples
- ContextMenu
- CountLinesExtension
- DllContextMenuExtension
- DataHandler
- CopyPathDataHandler
- DropHandler
- XsdDropHandler
- IconHandler
- DllIconHandler
- IconOverlayHandler
- LockedFileIconOverlayHandler
- ReadOnlyFileIconOverlayHandler
- InfoTipHandler
- FolderInfoTipHandler
- PreviewHandler
- IconPreviewHandler
- PropertySheet
- DrivePropertySheet
- ResourcesPropertySheet
- TextFilePropertySheet
- SharedAssemblyInfo.cs
- SharpShell.sln
- SharpShell.Tests
- SharpShell
- SharpShellNativeBridge
- Tests
- SharpShell.Tests
- Todo.txt
- Tools
- ServerInspector
- ServerManager
- ShellExtensionManager
- SharpShell_Tools.zip
- SharpShell Tools
- Apex.dll
- Apex.WinForms.dll
- ServerInspector.exe
- ServerManager.exe
- SharpShell.dll
- SharpShell_Core_Library.zip
|
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.