MaxCustomControls::ISerializable Interface Reference


Detailed Description

The interface for serializable objects.

Customizable objects could contain other serializable objects as its members or children. For example, a form's customizationState could contain several customizationState of the controls it contains.

Inheritance diagram for MaxCustomControls::ISerializable:
Inheritance graph
[legend]

List of all members.

Public Member Functions

ICustomizationState  SaveState ()
  This method should save all the states of an object.
bool  LoadState (ICustomizationState stateToLoad)
  This method should restore all the states of an object.

Member Function Documentation

ICustomizationState MaxCustomControls::ISerializable::SaveState ( )

This method should save all the states of an object.

Since an ISerializable objects could contain other ISerializable "children", when saving the states, it could call each of the "children"'s SaveState and then adds the returned ICustomizationState objects to the "CustomizationStates" list of the current ISerializable object's state object.

Client should assign a unique name for each of its child state objects. And use these unique names during LoadState to get the proper child state objects.

Returns:
An object deriving from ICustomizationState interface. If failed, null will be returned.

Implemented in MaxCustomControls::BaseMaterialControls::RichMaterialExplorerControl, MaxCustomControls::ExplorerControl, MaxCustomControls::MaterialBrowserControls::BaseMaterialBrowserContainer, MaxCustomControls::MaterialBrowserControls::RichMaterialBrowserControl, MaxCustomControls::MaterialExplorerControls::MaterialExplorerDialog, MaxCustomControls::MaterialExplorerControls::SceneMaterialExplorerControl, MaxCustomControls::MaterialExplorerControls::SelectedMaterialExplorerControl, MaxCustomControls::MaxForm, and MaxCustomControls::SceneExplorerControls::RichSceneExplorerControl.

bool MaxCustomControls::ISerializable::LoadState ( ICustomizationState  stateToLoad )

This method should restore all the states of an object.

Since an ISerializable objects could contain other ISerializable "children", when loading the states, it could call each of the "children"'s LoadState and pass the corresponding CustomizationState objects in the "CustomizationStates" List.

Client should assign a unique name for each of its child state objects. And use these unique names during LoadState to get the proper child state objects.

Parameters:
stateToLoad An object deriving from ICustomizationState interface.
Returns:
Return true if the object restore its states successfully, false otherwise.

Implemented in MaxCustomControls::BaseMaterialControls::RichMaterialExplorerControl, MaxCustomControls::ExplorerControl, MaxCustomControls::MaterialBrowserControls::BaseMaterialBrowserContainer, MaxCustomControls::MaterialBrowserControls::RichMaterialBrowserControl, MaxCustomControls::MaterialExplorerControls::MaterialExplorerDialog, MaxCustomControls::MaterialExplorerControls::SceneMaterialExplorerControl, MaxCustomControls::MaterialExplorerControls::SelectedMaterialExplorerControl, MaxCustomControls::MaxForm, and MaxCustomControls::SceneExplorerControls::RichSceneExplorerControl.