WorkflowDesignerLoader.Dispose Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Releases all resources used by the WorkflowDesignerLoader.
public:
override void Dispose();
public override void Dispose ();
override this.Dispose : unit -> unit
Public Overrides Sub Dispose ()
Examples
The following example demonstrates an implementation of the Dispose method. In this implementation, various services that have been added to the LoaderHost object are removed in preparation for closing the application. This example is from the Tracking Profile Designer SDK sample. For more information, see Tracking Profile Designer Sample.
public override void Dispose()
{
try
{
IDesignerLoaderHost host = LoaderHost;
if (host != null)
{
host.RemoveService(typeof(IIdentifierCreationService));
host.RemoveService(typeof(IMenuCommandService));
host.RemoveService(typeof(IToolboxService));
host.RemoveService(typeof(ITypeProvider), true);
host.RemoveService(typeof(IWorkflowCompilerOptionsService));
host.RemoveService(typeof(IEventBindingService));
}
}
finally
{
base.Dispose();
}
}
Public Overrides Sub Dispose()
Try
Dim host As IDesignerLoaderHost = LoaderHost
If host IsNot Nothing Then
host.RemoveService(GetType(IIdentifierCreationService))
host.RemoveService(GetType(IMenuCommandService))
host.RemoveService(GetType(IToolboxService))
host.RemoveService(GetType(ITypeProvider), True)
host.RemoveService(GetType(IWorkflowCompilerOptionsService))
host.RemoveService(GetType(IEventBindingService))
End If
Finally
MyBase.Dispose()
End Try
End Sub
Remarks
Dispose releases all services used by the designer host, but it does not write pending changes to the designer loader. If you want to save any pending changes prior to releasing all resources, call Flush before you call Dispose.
Applies to
Σχόλια
https://aka.ms/ContentUserFeedback.
Σύντομα διαθέσιμα: Καθ' όλη τη διάρκεια του 2024 θα καταργήσουμε σταδιακά τα ζητήματα GitHub ως μηχανισμό ανάδρασης για το περιεχόμενο και θα το αντικαταστήσουμε με ένα νέο σύστημα ανάδρασης. Για περισσότερες πληροφορίες, ανατρέξτε στο θέμα:Υποβολή και προβολή σχολίων για