System.Resources.ResXFileRef Class

Represents a link to an external resource.

See Also: ResXFileRef Members


public class ResXFileRef


The System.Resources.ResXFileRef class is used to include references to files in an XML resource (.resx) file. A System.Resources.ResXFileRef object represents a link to an external resource in an XML resource (.resx) file. You add the System.Resources.ResXFileRef object to a .resx file by calling the ResXResourceWriter.AddResource(ResXDataNode) method.

In a data entry in a .resx file, the type is System.Resources.ResXFileRef, and the value is the path location on disk. When the resource manager deserializes the object, the System.Resources.ResXFileRef performs the I/O to get the file. The following is an example of a .resx file.


 <data name="iconclip" type="System.Resources.ResXFileRef, System.Windows.Forms">
  <value>lookout.bmp;System.Drawing.Bitmap, System.Drawing</value>
 <data name="mailbackground" type="System.Resources.ResXFileRef, System.Windows.Forms">
  <value>mailbackground.bmp;System.Drawing.Bitmap, System.Drawing</value>
 <data name="xplogo" type="System.Resources.ResXFileRef, System.Windows.Forms">
  <value>xplogo.png;System.Drawing.Bitmap, System.Drawing</value>

To add a System.Resources.ResXFileRef object to a .resx file programmatically, you call the ResXDataNode.#ctor(string, ResXFileRef) constructor to instantiate a System.Resources.ResXDataNode object. You then pass this System.Resources.ResXDataNode object to the ResXResourceWriter.AddResource(ResXDataNode) method.

When you compile a .resx file with Resgen.exe (Resource File Generator), the resources specified in the .resx file are embedded in the resulting document resource file.


Namespace: System.Resources
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Assembly Versions: 1.0.5000.0,