本文整理汇总了C#中EventTypes类的典型用法代码示例。如果您正苦于以下问题:C# EventTypes类的具体用法?C# EventTypes怎么用?C# EventTypes使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
EventTypes类属于命名空间,在下文中一共展示了EventTypes类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MainEvent
public MainEvent()
{
InitializeComponent();
List<string> hours = new List<string>();
for (int i = 0; i < 24; i++)
{
hours.Add(i.ToString("00"));
}
cbFromHour.ItemsSource = hours;
cbFromHour.SelectedIndex = 0;
cbUntilHour.ItemsSource = hours;
cbUntilHour.SelectedIndex = 0;
List<string> minutes = new List<string>();
for (int i = 0; i < 12; i++)
{
minutes.Add((i * 5).ToString("00"));
}
cbFromMin.ItemsSource = minutes;
cbFromMin.SelectedIndex = 0;
cbUntilMin.ItemsSource = minutes;
cbUntilMin.SelectedIndex = 0;
dpFromDate.SelectedDate = DateTime.Now.Date;
dpUntilDate.SelectedDate = DateTime.Now.AddHours(1).Date;
mEventTypes = new EventTypes();
cbEventTypes.ItemsSource = mEventTypes;
}
示例2: RaiseEventMessage
public static void RaiseEventMessage(object sender, string Message, EventTypes type)
{
if (EventMessage != null)
{
EventMessage(sender, Message, type);
}
}
示例3: IOWatcher
public IOWatcher(IntPtr fd, EventTypes types, Loop loop, Action<IOWatcher, EventTypes> callback)
: base(loop)
{
this.fd = fd;
this.callback = callback;
watcher_ptr = manos_io_watcher_create (fd.ToInt32 (), types, watcherCallback, GCHandle.ToIntPtr (gc_handle));
}
示例4: Unsubscribe
//unsubscribe this event from event matching eventType
public void Unsubscribe(IObserver listener, EventTypes eventType)
{
if (listenerTable.Keys.Contains(eventType))
{
listenerTable[eventType].Remove(listener);
}
}
示例5: AttachEvent
public int AttachEvent(VlcEventManagerInstance eventManagerInstance, EventTypes eventType, EventCallback callback)
{
if (eventManagerInstance == IntPtr.Zero)
throw new ArgumentException("Event manager instance is not initialized.");
if (callback == null)
throw new ArgumentException("Callback for event is not initialized.");
return GetInteropDelegate<AttachEvent>().Invoke(eventManagerInstance, eventType, callback, IntPtr.Zero);
}
示例6: Subscribe
/*
Subscribers/listeners register with the event system
*/
public void Subscribe(IObserver listener, EventTypes eventType)
{
if (!listenerTable.Keys.Contains(eventType))
{
listenerTable[eventType] = new HashSet<IObserver>();
}
listenerTable[eventType].Add(listener);
}
示例7: UniEvent
public UniEvent(EventTypes type)
{
Type = type;
Actions = new List<UniAction>();
Options = new JSONObject();
Options.AddField("type", Type.ToString());
}
示例8: GetEventTypeName
public string GetEventTypeName(EventTypes eventType)
{
#if !NET20
return GetInteropDelegate<GetEventTypeName>().Invoke(eventType).ToStringAnsi();
#else
return IntPtrExtensions.ToStringAnsi(GetInteropDelegate<GetEventTypeName>().Invoke(eventType));
#endif
}
示例9: IOWatcher
public IOWatcher(IntPtr fd, EventTypes types, LibEvLoop loop, IOWatcherCallback callback)
: base(loop)
{
this.fd = fd;
this.callback = callback;
watcher_ptr = manos_io_watcher_create(fd.ToInt32(), types | EventTypes.EV__IOFDSET,
watcherCallback, GCHandle.ToIntPtr(gc_handle));
}
示例10: StaticCallback
private static void StaticCallback(IntPtr loop, IntPtr watcher, EventTypes revents)
{
UnmanagedPrepareWatcher iow = (UnmanagedPrepareWatcher) Marshal.PtrToStructure (watcher, typeof (UnmanagedPrepareWatcher));
GCHandle gchandle = GCHandle.FromIntPtr (iow.data);
PrepareWatcher w = (PrepareWatcher) gchandle.Target;
w.callback (w.Loop, w, revents);
}
示例11: StaticCallback
private static void StaticCallback(IntPtr data, EventTypes revents)
{
try {
var handle = GCHandle.FromIntPtr (data);
var watcher = (IOWatcher) handle.Target;
watcher.callback (watcher, revents);
} catch (Exception e) {
Console.Error.WriteLine ("Error handling IO readyness event: {0}", e.Message);
Console.Error.WriteLine (e.StackTrace);
}
}
示例12: StaticCallback
static void StaticCallback(IntPtr data, EventTypes revents)
{
Error.Log.Call<System.Exception>(() =>
{
var handle = GCHandle.FromIntPtr(data);
var watcher = (IOWatcher)handle.Target;
watcher.callback(watcher, revents);
}, e =>
{
Console.Error.WriteLine("Error handling IO readyness event: {0}", e.Message);
Console.Error.WriteLine(e.StackTrace);
});
}
示例13: GetEventHandlerAttr
// all event handler attribute accessors should eventually call these
public static string GetEventHandlerAttr(mdr.DObject obj, EventTypes type, string name)
{
#if ENABLE_RR
if (RecordReplayManager.Instance != null && RecordReplayManager.Instance.RecordEnabled)
{
mwr.RecordReplayManager.Instance.Record("Element", null, "GetEventHandlerAttr", false, obj, type, name);
}
#endif
var targetElement = obj.FirstInPrototypeChainAs<HTMLElement>();
var s = targetElement.PrimGetEventHandlerAttr(type);
Debug.WriteLine("GetEventHandlerAttr({0}) = '{1}'", name, s);
return s;
}
示例14: EventIsActive
public bool EventIsActive(Bands b, int c, EventTypes e)
{
if (e == EventTypes.BEAT)
{
return bandData[bandOffsets[c, (int) b]].Beat;
}
else if (e == EventTypes.VIBRATION)
{
return bandData[bandOffsets[c, (int) b]].Vibration;
}
return false;
}
示例15: FetchFromRedis
/// <summary>
/// Gets event list models by event type
/// </summary>
/// <param name="eventType">Event type to get by</param>
/// <returns>An event list model</returns>
private EventListModel FetchFromRedis(EventTypes eventType)
{
try
{
var redisClient = new RedisClient("localhost");
var eventClient = redisClient.As<EventListModel>();
return eventClient.GetById((int)eventType);
}
catch (Exception)
{
return new EventListModel();
}
}