Knowledge Base

ShellBrowser .NET Components



Hallo und herzlich Willkommen in unserer Wissensdatenbank.
Unsere Fachexperten liefern hier Antworten auf die häufigsten Fragen unserer Kunden.
Beginnen Sie Ihre Informationssuche hier, um schnell und einfach auch Ihre Antwort zu finden.
Geben Sie bitte einen Suchbegriff ein oder wählen Sie eine der obenstehenden Kategorien aus.



Alle Einträge (Seite 1 / 3)

I have the source code version of ShellBrowser.NET and want to build the sources. What do I have to do?
  • Create a new folder to your project, e.g. "ShellBrowser"
  • Create subfolders: CommonControls, Controls, Core, Resources and Design
  • From the "Source" subfolder of the ShellBrowser.NET installation directory, add all source files (and resources) to the respective folders
  • In addition, add the Resources.Designer.cs and Resources.resx from the "Source" subfolder  
  • Remove references to ShellBrowser.dll and ShellBrowser.Core.dll from your project

We use a build server. Do we have to install ShellBrowser.NET on it to build our projects there?

You do not need to install ShellBrowser.NET on the build server.

Instead, you can add the ShellBrowser assemblies (ShellBrowser.dll and ShellBrowser.Core.dll) as files to your project and replace the assemblies in the project references by the copied dlls.

Make sure to deploy the ShellBrowser dlls to the build server with your project.

This also gives you full control when updating ShellBrowser.NET to a new version. 

Is there a WPF Edition Edition of ShellBrowser.NET components or are the ShellBrowser.NET components compatible with WPF?

Yes, there is a separate WPFEdition of ShellBrowser components.

When I run my project from Visual Studio pdf, msg or sometimes txt files cannot be previewed in the ShellFilePreview component.

Depending on .NET Framework and Visual Studio version the Visual Studio hosting process might interfere with certain registered PreviewHandlers.


This behavior will not occur if Visual Studio is either not running or the hosting process is not enabled.


Try running your project with Visual Studio completely closed, or disable the hosting process in Visual Studio (In "Project\Properties\Debug" uncheck the option "Enable the Visual Studio hosting process".


 

I'm trying to preview .msg files with the ShellFilePreview component. This doesn't work or I can only see the header of the files.

Make sure that your application has visual styles enabled. You can do this by calling Application.EnabledVisualStyles() or by adjusting your application manifest.


 

What's the purpose of "JamDesign.dll"?

The file is necessary to develop software with the ShellBrowser controls but not to run them. "JamDesign.dll" must not be delivered together with the software that is using the ShellBrowser controls.

How can I prevent the selected path to be changed by the user?

Assign the PathChanged event for a ShellList and the BeforeSelect event for a ShellTreeView. If only want to allow the Windows folder, the code could look like this:


private const string cAllowedPath = "C:\\Windows";
private void shellListView1_PathChanged(object sender, EventArgs e)
{
 // Note: PathCollection also can check if the new Path is a subpath, by calling PathCollection.IsSubPathOf(string, string)
 if (!Jam.Shell.PathCollection.SamePath(shellListView1.Path, cAllowedPath))
  shellListView1.Path = cAllowedPath;
}


private void shellTreeView1_BeforeSelect(object sender, TreeViewCancelEventArgs e)
{
 if (!Jam.Shell.PathCollection.SamePath(((ShellTreeNode)e.Node)
.FullPath, cAllowedPath))
  e.Cancel = true;
}

The forward/backward buttons in the ShellHistoryToolStrip don't work. What's wrong?

Because the history functionality is contained in ShellControlConnector, you need to attach one to the ShellHistoryToolStrip Control by setting the property of the same name.

How can I prevent an item to be activated when the default activation action is executed in the ShellListView? I don't want the file to be opened, I only want to select the item.

Have a look at the JamExplorer example, here a MessageBox is shown to ask the user whether he really wants to open a file. The event is called BeforeInvokeCommandOnSelected.

Why is the use of the property ListViewItem.Caption discouraged?

Depending on the Windows Settings this property might not contain the complete file name but one with the extension cut off.
Instead, use the ShellListItem.FullPath property, it contains the full path to the file represented by the item.
The function Path.GetFileName(string path) gets you the full and pure file name and omits the path.

I'm setting the Path property of e.g. the ShellListView to a constant value like "C:\windows" when developing my application, is there a better way?

In general it is better to use only the SpecialFolder to explicitly set a path. The Path property is meant to be used to set the displayed path dynamically when the application is running on the system it is deployed on.
It can't be assumed that throughout different systems there's always an existing path "c:\" for example.

Clicking check boxes in a ShellFileList the first time is very slow. Is there any explanation for this behaviour?

For folders containing many files and subfolders the process of collecting file information (e.g. overall size) can take a while. If you'd like to suppress the scan, you can set the CalculateSelectedFiles property in the SelectionList to false.
This will suppress fetching the overall filesize, etc.