Description
Returns a service object that can be accessed at runtime. The method returns null if no service object is associated with the specified service type.
Syntax
Parameters
See Also
Example
Enumerate all 3D (Globe) windows and print their scene identifiers.
[C#] |
---|
foreach (IAgUiWindow window in application.Windows)
{
object oSvc = window.GetServiceByType(AgEWindowService.eWindowService3DWindow);
IAgUiWindowGlobeObject globeObject = oSvc as IAgUiWindowGlobeObject;
if (globeObject != null)
{
Console.WriteLine("Window Title: {0}, scene ID: {1}", window.Caption, globeObject.SceneID);
}
}
|
|
Enumerate all 2D (Map) windows and print their map identifiers.
[C#] |
---|
foreach (IAgUiWindow window in application.Windows)
{
object oSvc = window.GetServiceByType(AgEWindowService.eWindowService2DWindow);
IAgUiWindowMapObject mapObject = oSvc as IAgUiWindowMapObject;
if (mapObject != null)
{
Console.WriteLine("Window Title: {0}, scene ID: {1}", window.Caption, mapObject.MapID);
}
}
|
|
Enumerate all 3D (Globe) windows and print their scene identifiers.
[Visual Basic .NET] |
---|
For Each window As IAgUiWindow In application.Windows
Dim oSvc As Object = window.GetServiceByType(AgEWindowService.eWindowService3DWindow)
Dim globeObject As IAgUiWindowGlobeObject = TryCast(oSvc, IAgUiWindowGlobeObject)
If globeObject IsNot Nothing Then
Console.WriteLine("Window Title: {0}, scene ID: {1}", window.Caption, globeObject.SceneID)
End If
Next
|
|
Enumerate all 2D (Map) windows and print their map identifiers.
[Visual Basic .NET] |
---|
For Each window As IAgUiWindow In application.Windows
Dim oSvc As Object = window.GetServiceByType(AgEWindowService.eWindowService2DWindow)
Dim mapObject As IAgUiWindowMapObject = TryCast(oSvc, IAgUiWindowMapObject)
If mapObject IsNot Nothing Then
Console.WriteLine("Window Title: {0}, scene ID: {1}", window.Caption, mapObject.MapID)
End If
Next
|
|