ResXFileRef Class

ResXFileRef Class

 

Represents a link to an external resource.

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

System.Object
  System.Resources.ResXFileRef

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

NameDescription
System_CAPS_pubmethodResXFileRef(String, String)

Creates a new instance of the ResXFileRef class that references the specified file.

System_CAPS_pubmethodResXFileRef(String, String, Encoding)

Initializes a new instance of the ResXFileRef class that references the specified file.

NameDescription
System_CAPS_pubpropertyFileName

Gets the file name specified in the current ResXFileRef constructor.

System_CAPS_pubpropertyTextFileEncoding

Gets the encoding specified in the current ResXFileRef constructor.

System_CAPS_pubpropertyTypeName

Gets the type name specified in the current ResXFileRef constructor.

NameDescription
System_CAPS_pubmethodEquals(Object)

Determines whether the specified object is equal to the current object.(Inherited from Object.)

System_CAPS_protmethodFinalize()

Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.(Inherited from Object.)

System_CAPS_pubmethodGetHashCode()

Serves as the default hash function. (Inherited from Object.)

System_CAPS_pubmethodGetType()

Gets the Type of the current instance.(Inherited from Object.)

System_CAPS_protmethodMemberwiseClone()

Creates a shallow copy of the current Object.(Inherited from Object.)

System_CAPS_pubmethodToString()

Gets the text representation of the current ResXFileRef object.(Overrides Object.ToString().)

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.

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.

.NET Framework
Available since 1.1

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

Return to top
Show:
© 2016 Microsoft