AGI STK VGT 11Send comments on this topic.
CreateEventEpoch Method (IAgCrdnEventFactory)
See Also  Example
Name
Description
Windows






Windows & Linux

Description

Creates an event set at a specified date/time.

Syntax

[Visual Basic .NET]
Public Function CreateEventEpoch( _
   ByVal Name As String, _
   ByVal Description As String _
) As IAgCrdnEvent
[C#]
public IAgCrdnEvent CreateEventEpoch(
   string Name,
   string Description
);
[Managed C++]
public: IAgCrdnEvent^ CreateEventEpoch(
   String __gc ^ Name,
   String __gc ^ Description
);
[Java]
public IAgCrdnEvent createEventEpoch(
   String Name,
   String Description
);
[Unmanaged C++]
public: HRESULT CreateEventEpoch(
   BSTR Name,
   BSTR Description,
   IAgCrdnEvent ** ReturnValue
);

Parameters

Name
Description

Remarks

Spaces and most punctuation ( except for "-_().") cannot be used as a part of a component name when creating new components via VGT API.

Example

Create and configure fixed epoch event.
[C#]Copy Code
IAgCrdnEvent timeEvent = provider.Events.Factory.CreateEventEpoch("MyEventFixed""MyDescription"); 
IAgCrdnEventEpoch asEpoch = timeEvent as IAgCrdnEventEpoch; 
 
// Epoch can be set explicitly (Uses current DateTime unit preference, this code snippet assumes UTCG) 
asEpoch.Epoch = "1 May 2016 04:00:00.000"
 
// Epoch can also be set with the epoch of another event 
IAgCrdnEventFindOccurrenceResult startTime = provider.Events["AvailabilityStartTime"].FindOccurrence(); 
asEpoch.Epoch = startTime.Epoch; 
 
IAgCrdnEventFindOccurrenceResult occurrence = timeEvent.FindOccurrence(); 
if (occurrence.IsValid) 

    Console.WriteLine("Event occurred at: " + occurrence.Epoch); 

 

Create and configure fixed epoch event.
[Visual Basic .NET]Copy Code
Dim timeEvent As IAgCrdnEvent = provider.Events.Factory.CreateEventEpoch("MyEventFixed", "MyDescription")
Dim asEpoch As IAgCrdnEventEpoch = TryCast(timeEvent, IAgCrdnEventEpoch)

' Epoch can be set explicitly (Uses current DateTime unit preference, this code snippet assumes UTCG)
asEpoch.Epoch = "1 May 2016 04:00:00.000"

' Epoch can also be set with the epoch of another event
Dim startTime As IAgCrdnEventFindOccurrenceResult = provider.Events("AvailabilityStartTime").FindOccurrence()
asEpoch.Epoch = startTime.Epoch

Dim occurrence As IAgCrdnEventFindOccurrenceResult = timeEvent.FindOccurrence()
If occurrence.IsValid Then
    Console.WriteLine("Event occurred at: " + occurrence.Epoch)
End If

See Also

© 2019 Analytical Graphics, Inc. All Rights Reserved.