C# / .Net API Library Reference  4.3.2-74-ge1d4cca
Public Functions | Properties
IResourceManager Interface Reference

The IResourceManager interface provides methods for publishing and managing resources (binary objects) that are addressable by path. The data, which is stored on the service machine, can be anything that the service can copy as a byte array. This feature is commonly used in collaborative sessions, when multiple users are connected to the same PureWeb session. IResourceManager is primarily intended to facilitate the transfer of service-side data to the client. Data storage and retrieval is based on the unique identifier (GUID) key, which the store function automatically assigns to each resource.

Public Functions

void Clear ()
 
bool Contains (Guid key)
 
bool Remove (Guid key)
 
ContentInfo Retrieve (Guid key)
 
Guid Store (ContentInfo resource)
 
void Store (Guid key, ContentInfo resource)
 
bool TryRetrieve (Guid key, out ContentInfo content)
 

Properties

int Count [get]
 

Usage Description

void Clear ( )

Clears all stored resources.

Implemented in ResourceManager.

bool Contains ( Guid  key)

Indicates whether an item with the specifed key already exists. Returns true if it does, or false otherwise.

Implemented in ResourceManager.

bool Remove ( Guid  key)

Attempts to remove the specified key. If the key exists, will return true and remove the resource. Otherwise, returns false.

Implemented in ResourceManager.

ContentInfo Retrieve ( Guid  key)

Retrieves the resource currently stored at the specified key. If there are no resource at that key, will return an empty ContentInfo object.

Implemented in ResourceManager.

Guid Store ( ContentInfo  resource)

Adds the specified resource, returning a key that can be used later to retrieve it. Before you can use this method, the resource must have already been saved as a ContentInfo object.

You can use the store function to save the same data in several different formats. This would be useful, for instance, to handle operating system differences. Consider for example the case of a collaborative text editing application. Let's say that you need to save a Windows-targeted .docx file, and a .pages file for iOS-based clients. Using ResourceManager, you would call the store method twice, once for each format, and this way each format of the file would be assigned its own GUID key.

Implemented in ResourceManager.

void Store ( Guid  key,
ContentInfo  resource 
)

Stores the specified resource using the specified key. Any existing resource at that key will be replaced.

Parameters
keyThe key.
resourceThe resource. >

Implemented in ResourceManager.

bool TryRetrieve ( Guid  key,
out ContentInfo  content 
)

Attempts to retrieve the specified resource. If the resource exists, will return true and retrieve the resource. Otherwise, returns false.

Implemented in ResourceManager.

Property Documentation

int Count
get

Returns the number of items currently stored in ResourceManager.