本文整理汇总了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));
}
}