AGI STK Esri Display 11 Send comments on this topic.
SaveObject Method (IAgEsri3dRendererContext)
See Also  Example
Object
The object to serialize (must support  IPersistStream).





Description

Saves an instance of a component into a object in the GIS thread.

Syntax

[Visual Basic .NET]
Public Function SaveObject( _
   ByVal Object As Object _
) As Object

[C#]
public Object SaveObject(
Object Object
);

[Managed C++]
public: IUnknown^ SaveObject(
IUnknown ^ Object
);

[Java]
public Object saveObject(
Object Object
);

[Unmanaged C++]
public: HRESULT SaveObject(
IUnknown * Object,
IUnknown ** ReturnValue
);

Parameters

Object
The object to serialize (must support  IPersistStream).

Return Type

A stream (supporting IStream) containing the serialized object.

Remarks

The LoadObject and SaveObject methods allow you to serialize objects in the GIS thread, then deserialize them back into objects. Any object that supports IPersistStream can be saved and loaded using these methods. These methods allow you to copy objects between apartments.

Example

[C#] Copy Code
// Popup AddDataCommand 
ICommand addDataCommand = new ESRI.ArcGIS.Controls.ControlsAddDataCommand(); 
AddDataCommandHook hook = new AddDataCommandHook(m_AxAgUiAxVOCntrl.Handle); 
addDataCommand.OnCreate(hook as object); 
addDataCommand.OnClick(); 
 
// Get the new map from the hook and load it into the GIS thread 
object obj = m_Renderer.Context.SaveObject(hook.MapDocument.ActiveView.FocusMap); 
IMap newMap = m_Renderer.Context.LoadObject(obj) as IMap; 
 
// Begin Map Editing Session 
m_Renderer.StartMapEditing(AgESTKesriCallOptions.eEsri3dBlocking); 
 
// Add new layers to current map 
IMap map = m_Renderer.MapDocument.ActiveView.FocusMap; 
map.AddLayers(newMap.get_Layers(nullfalse), false); 
 
// End Map Editing Session 
m_Renderer.StopMapEditing(false);

See Also

© 2016 Analytical Graphics, Inc. All Rights Reserved.

STK Programming Interface 11.0.1