Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

ResXFileRef Class

Represents a link to an external resource.

System.Object
  System.Resources.ResXFileRef

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

[SerializableAttribute]
[TypeConverterAttribute(typeof(ResXFileRef.Converter))]
[PermissionSetAttribute(SecurityAction.InheritanceDemand, Name = "FullTrust")]
[PermissionSetAttribute(SecurityAction.LinkDemand, Name = "FullTrust")]
public class ResXFileRef

The ResXFileRef type exposes the following members.

  NameDescription
Public methodResXFileRef(String, String)Creates a new instance of the ResXFileRef class that references the specified file.
Public methodResXFileRef(String, String, Encoding)Initializes a new instance of the ResXFileRef class that references the specified file.
Top

  NameDescription
Public propertyFileNameGets the file name specified in the current ResXFileRef constructor.
Public propertyTextFileEncodingGets the encoding specified in the current ResXFileRef constructor.
Public propertyTypeNameGets the type name specified in the current ResXFileRef constructor.
Top

  NameDescription
Public methodEquals(Object)Determines whether the specified object is equal to the current object. (Inherited from Object.)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodGetHashCodeServes as the default hash function. (Inherited from Object.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodToStringGets the text representation of the current ResXFileRef object. (Overrides Object.ToString().)
Top

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

In a data entry in a .resx file, the type is ResXFileRef, and the value is the path location on disk. When the resource manager deserializes the object, the 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>
 <data name="mailbackground" type="System.Resources.ResXFileRef, System.Windows.Forms">
  <value>mailbackground.bmp;System.Drawing.Bitmap, System.Drawing</value>
 </data>
 <data name="xplogo" type="System.Resources.ResXFileRef, System.Windows.Forms">
  <value>xplogo.png;System.Drawing.Bitmap, System.Drawing</value>
 </data>

To add a ResXFileRef object to a .resx file programmatically, you call the ResXDataNode.ResXDataNode(String, ResXFileRef) constructor to instantiate a ResXDataNode object. You then pass this ResXDataNode object to the ResXResourceWriter.AddResource 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.

.NET Framework

Supported in: 4.5.3, 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

  • InheritanceDemand 

    for full trust for inheritors. This class cannot be inherited by partially trusted code.

  • LinkDemand 

    for full trust for the immediate caller. This class cannot be used by partially trusted code.

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Show:
© 2014 Microsoft