Class SharedNativeResourceFactory
Inheritance
Namespace: IronSoftware.Shared
Assembly: IronWord.dll
Syntax
public abstract class SharedNativeResourceFactory : Object
Sharing one native resource handle across the Iron Software libraries in a process runs through SharedNativeResourceFactory. It keeps a small registry of native pointers under string keys, so several Iron components running side by side reuse a single underlying handle instead of each loading its own. Most application code never touches it directly; it backs the cross-product resource sharing that keeps memory and native-library loading in check when, for example, IronWord and another Iron library run together.
The surface is two static methods. Set(string Name, IntPtr Value) stores a native pointer under a name, and Get(string Name) retrieves the pointer registered under that name, returning IntPtr.Zero when nothing is registered. The class is abstract with a protected constructor, so it is used through these static entry points rather than instantiated. Because the values are raw IntPtr handles, the owning component is responsible for the lifetime of whatever each pointer references; the factory only brokers lookup by name.
The document element tutorial and the Word to PDF how-to show the higher-level IronWord APIs that sit above this shared layer.
Constructors
SharedNativeResourceFactory()
Declaration
protected SharedNativeResourceFactory()
Methods
Get(String)
Declaration
public static IntPtr Get(string Name)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | Name |
Returns
| Type | Description |
|---|---|
| System.IntPtr |
Set(String, IntPtr)
Declaration
public static void Set(string Name, IntPtr Value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | Name | |
| System.IntPtr | Value |