Class DocumentManager
Provides access to documents in local and remote locations.
Namespace: ABB.Robotics.RobotStudio.Documents
Assembly: ABB.Robotics.RobotStudio.Documents.dll
Syntax
public static class DocumentManager
Properties
View SourceProviderTypes
Returns a list of all registered DocumentProvider types.
Declaration
public static Collection<Type> ProviderTypes { get; }
Property Value
| Type | Description |
|---|---|
| Collection<Type> |
Providers
Returns a DocumentProviderCollection containing all registered DocumentProviders.
Declaration
public static DocumentProviderCollection Providers { get; }
Property Value
| Type | Description |
|---|---|
| DocumentProviderCollection |
UrlSubstitutions
Returns a list of all registered UrlSubstitutions.
Declaration
public static Collection<UrlSubstitution> UrlSubstitutions { get; }
Property Value
| Type | Description |
|---|---|
| Collection<UrlSubstitution> |
Methods
View SourceBeginBrowse(BrowseSpec)
Starts an asynchronous browse.
Declaration
public static void BeginBrowse(BrowseSpec spec)
Parameters
| Type | Name | Description |
|---|---|---|
| BrowseSpec | spec |
Remarks
This method returns immediately, and BrowseComplete is raised when the operation completes.
BeginSearch(SearchSpec)
Starts an asynchronous search.
Declaration
public static void BeginSearch(SearchSpec spec)
Parameters
| Type | Name | Description |
|---|---|---|
| SearchSpec | spec |
Remarks
This method returns immediately, and SearchComplete is raised when the operation completes.
BrowseAsync(BrowseSpec, Action<FolderInfo>, Action<DocumentInfo>)
Executes an asynchronous browse.
Declaration
public static Task BrowseAsync(BrowseSpec spec, Action<FolderInfo> folderResult, Action<DocumentInfo> documentResult)
Parameters
| Type | Name | Description |
|---|---|---|
| BrowseSpec | spec | |
| Action<FolderInfo> | folderResult | Called when a folder is found. |
| Action<DocumentInfo> | documentResult | Called when a document is found. |
Returns
| Type | Description |
|---|---|
| Task | A Task that completes when the operation is completed. |
Remarks
FolderResult, DocumentResult and BrowseComplete are not raised when calling this.
BrowseSync(BrowseSpec)
Executes a synchronous browse.
Declaration
public static void BrowseSync(BrowseSpec spec)
Parameters
| Type | Name | Description |
|---|---|---|
| BrowseSpec | spec |
BrowseSync(BrowseSpec, Action<FolderInfo>, Action<DocumentInfo>)
Executes a synchronous browse.
Declaration
public static void BrowseSync(BrowseSpec spec, Action<FolderInfo> folderResult, Action<DocumentInfo> documentResult)
Parameters
| Type | Name | Description |
|---|---|---|
| BrowseSpec | spec | |
| Action<FolderInfo> | folderResult | Called when a folder is found. |
| Action<DocumentInfo> | documentResult | Called when a document is found. |
Remarks
FolderResult, DocumentResult and BrowseComplete are not raised when calling this.
ExportProviders(string, IEnumerable<DocumentProvider>)
Exports providers to an XML file.
Declaration
public static void ExportProviders(string fileName, IEnumerable<DocumentProvider> providers)
Parameters
| Type | Name | Description |
|---|---|---|
| string | fileName | Path to XML file. |
| IEnumerable<DocumentProvider> | providers | Providers to export. |
FindDocument(string)
Finds a document given it's full URL (provider URL + folder separator + document URL), or path to local copy.
Declaration
public static DocumentInfo FindDocument(string documentUrl)
Parameters
| Type | Name | Description |
|---|---|---|
| string | documentUrl |
Returns
| Type | Description |
|---|---|
| DocumentInfo | DocumentInfo, or null if not found. |
FindReverseSubstitution(string)
Replaces an Id from UrlSubstitutions at the start of an URL.
Declaration
public static string FindReverseSubstitution(string urlWithSubstitution)
Parameters
| Type | Name | Description |
|---|---|---|
| string | urlWithSubstitution |
Returns
| Type | Description |
|---|---|
| string | Empty string is no substitution was found. |
FindSubstitution(string)
Replaces the start of an URL with an Id from UrlSubstitutions
Declaration
public static string FindSubstitution(string originalUrl)
Parameters
| Type | Name | Description |
|---|---|---|
| string | originalUrl |
Returns
| Type | Description |
|---|---|
| string | Empty string is no substitution was found. |
GetLocalCopy(DocumentInfo)
Downloads (if needed) a document.
Declaration
public static string GetLocalCopy(DocumentInfo documentInfo)
Parameters
| Type | Name | Description |
|---|---|---|
| DocumentInfo | documentInfo | The document info of the file to download. |
Returns
| Type | Description |
|---|---|
| string | Path to the local copy of the file. |
GetLocalCopyAsync(DocumentInfo)
Asynchronously downloads (if needed) a document.
Declaration
public static Task<string> GetLocalCopyAsync(DocumentInfo documentInfo)
Parameters
| Type | Name | Description |
|---|---|---|
| DocumentInfo | documentInfo | The document info of the file to download. |
Returns
| Type | Description |
|---|---|
| Task<string> | Path to the local copy of the file. |
GetLocalCopyAsync(DocumentInfo, IProgressCallback2)
Asynchronously downloads (if needed) a document, with progress and cancellation if supported by the provider.
Declaration
public static Task<string> GetLocalCopyAsync(DocumentInfo documentInfo, IProgressCallback2 progress)
Parameters
| Type | Name | Description |
|---|---|---|
| DocumentInfo | documentInfo | The document info of the file to download. |
| IProgressCallback2 | progress |
Returns
| Type | Description |
|---|---|
| Task<string> | Path to the local copy of the file. |
Exceptions
| Type | Condition |
|---|---|
| OperationCanceledException | The download was canceled. |
GetLocalCopyInfo(string)
Returns a DocumentInfo corresponding to a local copy.
Declaration
public static DocumentInfo GetLocalCopyInfo(string localPath)
Parameters
| Type | Name | Description |
|---|---|---|
| string | localPath | Path to the local copy of the document. |
Returns
| Type | Description |
|---|---|
| DocumentInfo | Null if no document corresponding to the local copy was found. |
GetLocalCopyStatus(DocumentInfo)
Returns the status of the local copy of a document.
Declaration
public static LocalCopyStatus GetLocalCopyStatus(DocumentInfo docInfo)
Parameters
| Type | Name | Description |
|---|---|---|
| DocumentInfo | docInfo |
Returns
| Type | Description |
|---|---|
| LocalCopyStatus |
GetLocalCopyStatus(string)
Returns the status of the local copy of a document.
Declaration
public static LocalCopyStatus GetLocalCopyStatus(string localPath)
Parameters
| Type | Name | Description |
|---|---|---|
| string | localPath | Path to the local copy of the document. |
Returns
| Type | Description |
|---|---|
| LocalCopyStatus |
Initialize()
Initializes this instance.
Declaration
public static void Initialize()
Remarks
Note that provider configurations may be dependant on externally configured UrlSubstitutions, which must be set before Initialize is called.
LoadProviders(string)
Loads providers from an XML file, but does not add them to the Providers collection.
Declaration
public static IEnumerable<DocumentProvider> LoadProviders(string fileName)
Parameters
| Type | Name | Description |
|---|---|---|
| string | fileName | Path to XML file. |
Returns
| Type | Description |
|---|---|
| IEnumerable<DocumentProvider> |
RaiseDocumentActivated(DocumentActivatedEventArgs)
Raises the DocumentActivated event.
Declaration
public static void RaiseDocumentActivated(DocumentActivatedEventArgs eventArgs)
Parameters
| Type | Name | Description |
|---|---|---|
| DocumentActivatedEventArgs | eventArgs |
SearchAsync(SearchSpec, Action<DocumentInfo>)
Executes an asynchronous search.
Declaration
public static Task SearchAsync(SearchSpec spec, Action<DocumentInfo> documentResult)
Parameters
| Type | Name | Description |
|---|---|---|
| SearchSpec | spec | |
| Action<DocumentInfo> | documentResult | Called when a matching document is found. |
Returns
| Type | Description |
|---|---|
| Task | A Task that completes when the operation is completed. |
Remarks
DocumentResult and SearchComplete are not raised when calling this.
Shutdown()
ABB internal use
Declaration
public static void Shutdown()
Events
View SourceBrowseComplete
Raised when a browse operation is complete.
Declaration
public static event EventHandler<ResultEventArgs> BrowseComplete
Event Type
| Type | Description |
|---|---|
| EventHandler<ResultEventArgs> |
DocumentActivated
Raised when a document is activated (e.g. double-clicked) in a GUI.
Declaration
public static event EventHandler<DocumentActivatedEventArgs> DocumentActivated
Event Type
| Type | Description |
|---|---|
| EventHandler<DocumentActivatedEventArgs> |
DocumentResult
Raised when a mathcing document is found during a search or browse operation.
Declaration
public static event EventHandler<DocumentEventArgs> DocumentResult
Event Type
| Type | Description |
|---|---|
| EventHandler<DocumentEventArgs> |
Error
Raised when a DocumentProvider causes an exception.
Declaration
public static event EventHandler<ExceptionEventArgs> Error
Event Type
| Type | Description |
|---|---|
| EventHandler<ExceptionEventArgs> |
FolderResult
Raised when a folder is found during a browse operation.
Declaration
public static event EventHandler<FolderEventArgs> FolderResult
Event Type
| Type | Description |
|---|---|
| EventHandler<FolderEventArgs> |
Progress
Raised during a search operation to indicate the folder being searched.
Declaration
public static event EventHandler<FolderEventArgs> Progress
Event Type
| Type | Description |
|---|---|
| EventHandler<FolderEventArgs> |
SearchComplete
Raised when a search operation is complete.
Declaration
public static event EventHandler<ResultEventArgs> SearchComplete
Event Type
| Type | Description |
|---|---|
| EventHandler<ResultEventArgs> |