Class GenericExteralPreviewApplication
This is a simple generic external preview application that launches the associated or specified application for the preview file. Then when this object is disposed or the launched process exits the temp file is deleted.
Inheritance
Implements
Inherited Members
Namespace: SdlSdl.FileTypeSupportFrameworkPreviewControls
Assembly: Sdl.FileTypeSupport.Framework.PreviewControls.dll
Syntax
public class GenericExteralPreviewApplication : AbstractFileTypeDefinitionComponent, IFileTypeDefinitionAware, ISingleFilePreviewApplication, IAbstractPreviewApplication, IAbstractPreviewController, ISingleFilePreviewController, IDisposable
Constructors
GenericExteralPreviewApplication()
Constructor.
Declaration
public GenericExteralPreviewApplication()
Properties
ApplicationPath
The path of the external app to preview the generated file (or null for default associated app)
Declaration
public string ApplicationPath { get; set; }
Property Value
Type | Description |
---|---|
string |
MonitorApplicationExit
Indicates if the application should be monitored when exiting. This will perform some tidy up if set to true
Declaration
public bool MonitorApplicationExit { get; set; }
Property Value
Type | Description |
---|---|
bool |
PreviewFile
Default implementation is accessor for member field.
Declaration
public virtual TempFileManager PreviewFile { get; set; }
Property Value
Type | Description |
---|---|
TempFileManager |
Methods
Dispose()
Calls Dispose(bool).
Declaration
public void Dispose()
Dispose(bool)
Dispose of resources used by this object. Implementation attempts to close the preview application and delete the temp file.
Declaration
protected virtual void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
bool | disposing |
~GenericExteralPreviewApplication()
Calls Dispose(bool).
Declaration
protected ~GenericExteralPreviewApplication()
Launch()
Display the file in the external application.
Declaration
public virtual void Launch()
LaunchApplicationForFile(TempFileManager)
Launch a process to view the file. If an application path has been set it is used to launch the application with the preview file as a parameter. If not the file is launched using the default application associated with it (if any).
Declaration
protected virtual Process LaunchApplicationForFile(TempFileManager managedTempFile)
Parameters
Type | Name | Description |
---|---|---|
TempFileManager | managedTempFile |
Returns
Type | Description |
---|---|
Process |
NotifyCanClose()
Default implementation sends a close message to the process main window, if it is open.
Declaration
public virtual void NotifyCanClose()
OnPreviewClosed(object, PreviewClosedEventArgs)
Raise the PreviewClosed event.
Declaration
public virtual void OnPreviewClosed(object sender, PreviewClosedEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
object | sender | |
PreviewClosedEventArgs | args |
Events
PreviewClosed
Raised when the launched application terminates.
Declaration
public event EventHandler<PreviewClosedEventArgs> PreviewClosed
Event Type
Type | Description |
---|---|
EventHandlerPreviewClosedEventArgs |