ResourceSet.Close Method
[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]
Closes and releases any resources used by this ResourceSet.
Assembly: mscorlib (in mscorlib.dll)
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). |
The following code example uses the Close method to release all resources used by the calling ResourceSet instance.
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(); } }
Show:
Note: