AGI STK Esri Display 11 Send comments on this topic.
LoadObject Method (IAgEsri3dRendererContext)
See Also  Example
Stream
Stream (must support IStream) containing the serialized object.





Description

Loads an instance of a component in the GIS thread from a object.

Syntax

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

[C#]
public Object LoadObject(
Object Stream
);

[Managed C++]
public: IUnknown^ LoadObject(
IUnknown ^ Stream
);

[Java]
public Object loadObject(
Object Stream
);

[Unmanaged C++]
public: HRESULT LoadObject(
IUnknown * Stream,
IUnknown ** ReturnValue
);

Parameters

Stream
Stream (must support IStream) containing the serialized object.

Return Type

Returns the new object deserialized in the GIS thread for this context.

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