本文整理匯總了C#中BaseEvent.Invoke方法的典型用法代碼示例。如果您正苦於以下問題:C# BaseEvent.Invoke方法的具體用法?C# BaseEvent.Invoke怎麽用?C# BaseEvent.Invoke使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類BaseEvent
的用法示例。
在下文中一共展示了BaseEvent.Invoke方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: InvokeOriginalEvent
// this method provides a workaround for issue #437, it may be possible to remove it in the future
public static void InvokeOriginalEvent(BaseEvent e)
{
if (e is WrappedEvent)
{
WrappedEvent wrappedEvent = e as WrappedEvent;
wrappedEvent.InvokeOriginalEvent();
}
else
{
e.Invoke();
}
}
示例2: InvokeEvent
/*
* UIPartActionMenuPatcher actions
*/
private static void InvokeEvent(BaseEvent baseEvent, bool ignoreDelay)
{
// note: this gets called when the event is invoked through:
// RemoteTech.FlightComputer.UIPartActionMenuPatcher.Wrapper.Invoke()
var v = FlightGlobals.ActiveVessel;
if (v == null || v.isEVA || RTCore.Instance == null)
{
baseEvent.Invoke();
return;
}
VesselSatellite vs = null;
if (RTCore.Instance != null)
{
vs = RTCore.Instance.Satellites[v];
}
if (vs == null || vs.HasLocalControl)
{
baseEvent.Invoke();
}
else if (EventWhiteList.Contains(baseEvent.name))
{
baseEvent.Invoke();
}
else if (vs.FlightComputer != null && vs.FlightComputer.InputAllowed)
{
if (ignoreDelay)
{
baseEvent.Invoke();
}
else
{
vs.SignalProcessor.FlightComputer.Enqueue(EventCommand.Event(baseEvent));
}
}
else if (baseEvent.listParent.part.Modules.OfType<IAntenna>().Any() &&
!baseEvent.listParent.part.Modules.OfType<ModuleRTAntennaPassive>().Any() &&
RTSettings.Instance.ControlAntennaWithoutConnection)
{
baseEvent.Invoke();
}
else
{
ScreenMessages.PostScreenMessage(new ScreenMessage("No connection to send command on.", 4.0f, ScreenMessageStyle.UPPER_LEFT));
}
}