The icon on the mountpoint is set in the
IconIdentifier method in the class that implements the
IContentLibraryContext interface. For instance you could have something in there like:
public string IconIdentifier
if (_disconnected) return "disconnected";
The value for
_disconnected you have to set somewhere based on whether your connection is up.
Then to make icons available from a simple to deploy location, I add a few additional methods to the class that implements the
IContentLibrary interface (allowing me to add the icons in the
AddIns folder where the ECL provider DLL resides). These are called from the
GetIconImage method that needs to be implemented by the interface:
private static readonly string IconBasePath = Path.Combine(AddInFolder, "Themes");'
internal static string AddInFolder
string codeBase = Assembly.GetExecutingAssembly().CodeBase;
UriBuilder uri = new UriBuilder(codeBase);
string path = Uri.UnescapeDataString(uri.Path);
internal static byte GetIconImage(string iconIdentifier, int iconSize)
// get icon directly from default theme folder
return HostServices.GetIcon(IconBasePath, "_Default", iconIdentifier, iconSize, out actualSize);
public byte GetIconImage(string theme, string iconIdentifier, int iconSize)
// use static implementation
return GetIconImage(iconIdentifier, iconSize);
So with this code, I can now add a
Themes\_Default\Icons folder to the
AddIns folder and in there place the following icons:
You can see a sample of using custom icons like that in my Flickr ECL provider which is open source code (available on Google code).
Then your next step would be to have the
GetFolderContent methods in the class that implements the
IContentLibraryContext interface to not return items (and folders) anymore, that way you would not have an option to further expand.