ResourceSet.Close Method
Microsoft Silverlight will reach end of support after October 2021. Learn more.
Closes and releases any resources used by this ResourceSet.
Namespace: System.Resources
Assembly: mscorlib (in mscorlib.dll)
Syntax
'Declaration
Public Overridable Sub Close
public virtual void Close()
Remarks
All calls to methods on the ResourceSet after a call to this method might fail.
Close can be safely called multiple times.
Note: |
---|
The current implementation of Close calls Dispose (true). |
Examples
The following code example uses the Close method to release all resources used by the calling ResourceSet instance.
Imports System.Resources
Imports System.Collections
Class Example
Public Shared Sub Demo(ByVal outputBlock As System.Windows.Controls.TextBlock)
' Create a ResourceSet for the file items.resources.
Dim rs As New ResourceSet("items.resources")
' Create an IDictionaryEnumerator to read the data in the ResourceSet.
Dim id As IDictionaryEnumerator = rs.GetEnumerator()
' Iterate through the ResourceSet and display the contents.
While id.MoveNext()
outputBlock.Text += String.Format(ControlChars.NewLine + "[{0}] " + ControlChars.Tab + "{1}", id.Key, id.Value) & vbCrLf
End While
rs.Close()
End Sub
End Class
using System;
using System.Resources;
using System.Collections;
class Example
{
public static void Demo(System.Windows.Controls.TextBlock outputBlock)
{
// Create a ResourceSet for the file items.resources.
ResourceSet rs = new ResourceSet("items.resources");
// Create an IDictionaryEnumerator to read the data in the ResourceSet.
IDictionaryEnumerator id = rs.GetEnumerator();
// Iterate through the ResourceSet and display the contents.
while (id.MoveNext())
outputBlock.Text += String.Format("\n[{0}] \t{1}", id.Key, id.Value) + "\n";
rs.Close();
}
}
Version Information
Silverlight
Supported in: 5, 4, 3
Silverlight for Windows Phone
Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0
XNA Framework
Supported in: Xbox 360, Windows Phone OS 7.0
Platforms
For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.