本文整理汇总了C#中IEventListener类的典型用法代码示例。如果您正苦于以下问题:C# IEventListener类的具体用法?C# IEventListener怎么用?C# IEventListener使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IEventListener类属于命名空间,在下文中一共展示了IEventListener类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: RemoveListener
//searches ALL lists and removes listener from all of them.
//pretty slow op; remove from individual lists if you can
public static void RemoveListener(IEventListener listener)
{
foreach (EventType type in eventListenerMap.Keys)
{
eventListenerMap[type].Remove(listener);
}
}
开发者ID:eliot2,项目名称:kopykat-ggj14,代码行数:9,代码来源:EventManager.cs
示例2: AddEventListener
public void AddEventListener(IEventListener eventListener)
{
if (!(m_EventListeners.Contains(eventListener)))
{
m_EventListeners.Add(eventListener);
}
}
开发者ID:BackupTheBerlios,项目名称:puzzle-svn,代码行数:7,代码来源:ObservableMixin.cs
示例3: Initialize
public static void Initialize(IEventListener touchEventListener)
{
if (_initialized)
return;
/// Lack of constructors in native code, forces to
/// initialize TouchPanel before we initialize event sink.
/// We have only one touch panel right now.
/// But this is to keep the options open for future.
_activeTouchPanel = new TouchPanel();
_activeTouchPanel.Enabled = true;
/// Add a touch event processor.
Microsoft.SPOT.EventSink.AddEventProcessor(EventCategory.Touch, new TouchEventProcessor());
/// Start the event sink process. This will pump
/// events neatly out of the other world.
Microsoft.SPOT.EventSink.AddEventListener(EventCategory.Touch, touchEventListener);
/// Also add generic for Gesture stuff.
Microsoft.SPOT.EventSink.AddEventListener(EventCategory.Gesture, touchEventListener);
_initialized = true;
}
开发者ID:koson,项目名称:.NETMF_for_LPC17xx,代码行数:25,代码来源:Touch.cs
示例4: WeakEventListenerWrapper
public WeakEventListenerWrapper(IEventListener listener)
{
if (listener.IsWeak)
_item = listener;
else
_item = ToolkitExtensions.GetWeakReference(listener);
}
开发者ID:dbeattie71,项目名称:MugenMvvmToolkit,代码行数:7,代码来源:WeakEventListenerWrapper.cs
示例5: AddListener
///////////////////////////////////////////////////////////
/**
* Add a listener to the event manager that will receive any events of the
* supplied event name.
*/
public static bool AddListener(IEventListener listener, string eventName)
{
if (!appQuitting) {
if (listener == null || eventName == null) {
Debug.Log("[EVENTMANAGER]: Failed to add listener: listener["+(listener == null ? "listener argument cannot be null" : listener.GetType().ToString())+"] eventName["+(eventName == null ? "eventName argument cannot be null" : eventName)+"]");
return false;
}
EventManager em = EventManager.getInstance();
if (!em.listenerTable.ContainsKey(eventName)) {
//Debug.Log("adding listener for event ["+eventName+"]. listener ["+listener+"]");
em.listenerTable.Add(eventName, new ArrayList());
}
ArrayList listenerList = em.listenerTable[eventName] as ArrayList;
if (listenerList.Contains(listener)) {
Debug.Log("[EVENTMANAGER]: listener["+(listener.GetType().ToString())+"] is already in list for eventName["+eventName+"]");
return false;
}
// Debug.Log("[EVENTMANAGER]: Added listener["+(listener.GetType().ToString())+"]");
listenerList.Add(listener);
}
/*
else {
Debug.Log("[EVENTMANAGER]: Addition of listener["+(listener.GetType().ToString())+"] skipped since app is quitting");
}
*/
return false;
}
开发者ID:jamiltron,项目名称:ggj2014,代码行数:35,代码来源:EventManager.cs
示例6: DetachListener
/**
* Remove a listener from the specified event.
*/
public static bool DetachListener(IEventListener listener, string eventName)
{
if (!appQuitting) {
EventManager em = EventManager.getInstance();
if (!em.listenerTable.ContainsKey(eventName)) {
return false;
}
ArrayList listenerList = em.listenerTable[eventName] as ArrayList;
if (!listenerList.Contains(listener)) {
return false;
}
//Debug.Log("[EVENTMANAGER]: Removed listener["+(listener.GetType().ToString())+"]");
listenerList.Remove(listener);
}
/*
else {
Debug.Log("[EVENTMANAGER]: Removal of listener["+(listener.GetType().ToString())+"] skipped since app is quitting");
}
*/
return true;
}
开发者ID:jamiltron,项目名称:ggj2014,代码行数:28,代码来源:EventManager.cs
示例7: RemoveListener
public static void RemoveListener(IEventListener listener)
{
if (listeners.Contains(listener))
{
listeners.Remove(listener);
}
}
开发者ID:yurijdvornyk,项目名称:mathproblemsolver,代码行数:7,代码来源:AppEventManager.cs
示例8: GetNext
protected override ImporterConverterAbstract GetNext(IEventListener iel, CancellationToken iCancellationToken)
{
try
{
IMccDescompactor Sex = Context.RarManager.InstanciateExctractor(_FN, iel, Context);
if (Sex == null)
return null;
bool exportsuccess = false;
using (Sex)
{
exportsuccess = Sex.Extract(iel, iCancellationToken);
}
OutPutFiles = Sex.DescompactedFiles;
if (iCancellationToken.IsCancellationRequested)
{
return null;
}
if (exportsuccess==false)
return null;
return new XMLImporter(Sex.RootXML, _ImportAllMetaData, Context.Folders.File) { Rerooter = Sex.Rerooter};
}
catch (Exception e)
{
iel.Report(new UnknownRarError(_FN));
Trace.WriteLine("Decompressing problem " + e.ToString());
return null;
}
}
开发者ID:David-Desmaisons,项目名称:MusicCollection,代码行数:34,代码来源:MccImporter.cs
示例9: AddListener
public static void AddListener(int type, IEventListener listener, IEventDispatcher source = null)
{
if (!listeners.ContainsKey(type))
listeners.Add(type, new List<ListenerData>());
listeners[type].Add(new ListenerData(listener, source));
}
开发者ID:Coolperson,项目名称:BomberWoman,代码行数:7,代码来源:EventManager.cs
示例10: SharedObjectMessage
/// <summary>
/// Initializes a new instance of the SharedObjectMessage class with given listener, name, version and persistence flag.
/// </summary>
/// <param name="source">Event listener.</param>
/// <param name="name">Event name.</param>
/// <param name="version">Shared object version.</param>
/// <param name="persistent">Indicates whether shared object is persistent.</param>
internal SharedObjectMessage(IEventListener source, string name, int version, bool persistent)
: base(EventType.SHARED_OBJECT, Constants.TypeSharedObject, source)
{
_name = name;
_version = version;
_persistent = persistent;
}
开发者ID:apakian,项目名称:fluorinefx,代码行数:14,代码来源:SharedObjectMessage.cs
示例11: GetNext
protected override ImporterConverterAbstract GetNext(IEventListener iel, CancellationToken iCancellationToken)
{
string dp = Path.GetFileName(_FileName);
iel.Report(new ExtractProgessEventArgs(dp));
ImporterConverterAbstract next = null;
try
{
IRarDescompactor Sex = Context.RarManager.InstanciateExctractorWithPassword(_FileName, iel);
if (Sex == null)
{
return next;
}
using (Sex)
{
if (iCancellationToken.IsCancellationRequested)
return null;
Sex.DescompactedFiles = _ExtractedFiles;
bool res = Sex.Extract(iel, iCancellationToken);
_RarFileNames =Sex.ArchiveNames;
if (iCancellationToken.IsCancellationRequested)
return null;
if (res)
{
NonRecursiveFolderInspector nfr = new NonRecursiveFolderInspector(_IInternalMusicSession,_ExtractedFiles, Sex.Helper, iel);
ImporterConverterAbstract[] Importers = nfr.Importers;
if (Importers.Length == 0)
{
iel.Report(new NoMusicImportErrorEventArgs(Sex.Helper.DisplayName));
}
else if (Importers.Length > 1)
{
Trace.WriteLine("Unhandled configuration in a rar file");
iel.Report(new UnhandledRarFile(Sex.Helper.DisplayName));
}
else
next = Importers[0];
}
}
}
catch(Exception e)
{
iel.Report(new UnknownRarError(dp));
Trace.WriteLine("Decompressing problem " + e.ToString());
next = null;
}
return next;
}
开发者ID:David-Desmaisons,项目名称:MusicCollection,代码行数:60,代码来源:RarImporter.cs
示例12: AddEventListener
public void AddEventListener(IEventListener listener)
{
if (Equals(listener, null))
throw new ArgumentNullException("listener");
Listeners.Add(listener);
}
开发者ID:dbarrera,项目名称:steag,代码行数:7,代码来源:EventDispatcher.cs
示例13: NonRecursiveFolderInspector
internal NonRecursiveFolderInspector(IInternalMusicSession iIMusicConverter, IEnumerable<string> Files, IImportHelper Clue, IEventListener iel)
{
_IMusicConverter = iIMusicConverter;
_Files = Files;
_ClueName = Clue;
_IEL = iel;
}
开发者ID:David-Desmaisons,项目名称:MusicCollection,代码行数:7,代码来源:NonRecursiveFolderInspector.cs
示例14: AttachEventListener
/// <summary>
/// 挂载一个消息监听器到当前的消息节点上
/// </summary>
/// <param name="key">消息ID</param>
/// <param name="listener">消息监听器</param>
/// <returns>当前消息节点已经挂载了这个消息监听器那么返回false</returns>
public bool AttachEventListener(int key, IEventListener listener)
{
if (listener == null)
{
return false;
}
if (!mListeners.ContainsKey(key))
{
mListeners.Add(key, new List<IEventListener>() { listener });
return true;
}
if (mListeners[key].Contains(listener))
{
return false;
}
int pos = 0;
for (int i = 0; i < mListeners[key].Count; i++)
{
if (listener.EventPriority() > mListeners[key][i].EventPriority())
break;
pos++;
}
mListeners[key].Insert(pos, listener);
return true;
}
开发者ID:zuig,项目名称:MessageMechanism,代码行数:31,代码来源:EventNode.cs
示例15: RemoveListener
public void RemoveListener(IEventListener listener)
{
try
{
listerners.Remove(listener);
}
catch { }
}
开发者ID:mokth,项目名称:merpV2Production,代码行数:8,代码来源:EventManager.cs
示例16: EventListenerRegistration
/// <summary>
/// Initializes a new instance.
/// </summary>
/// <param name="eventType"></param>
/// <param name="listener"></param>
/// <param name="capture"></param>
public EventListenerRegistration(string eventType,IEventListener listener, bool capture )
{
Contract.Requires<ArgumentNullException>(!string.IsNullOrWhiteSpace(eventType));
Contract.Requires<ArgumentNullException>(listener != null);
this.eventType = eventType;
this.listener = listener;
this.capture = capture;
}
开发者ID:nxkit,项目名称:nxkit,代码行数:15,代码来源:EventListenerRegistration.cs
示例17: FolderInspector
internal FolderInspector(IInternalMusicSession iMusicConverter, DirectoryInfo DI, IEventListener iel)
{
_IMusicConverter = iMusicConverter;
_RootDir = DI;
_IEL = iel;
string DirName = Path.GetDirectoryName(DI.FullName);
_SkipDir = (DirName == null) ? DI.FullName.Length : DirName.Length;
_SkipDir++;
}
开发者ID:David-Desmaisons,项目名称:MusicCollection,代码行数:9,代码来源:FolderInspector.cs
示例18: RemoveEventFilter
public static void RemoveEventFilter(EventCategory eventCategory, IEventListener eventFilter)
{
EventInfo eventInfo = GetEventInfo(eventCategory);
if (eventInfo.EventFilter == eventFilter)
{
eventInfo.EventFilter = null;
}
}
开发者ID:jakesays,项目名称:Glide,代码行数:9,代码来源:EventSink.cs
示例19: RegisterEventListener
/// <summary>
/// Connects an event listener to our message bus
/// </summary>
/// <param name = "listener">The event listener, which will be marshalled from another AppDomain</param>
/// <param name = "context">Run context event raiser</param>
/// <remarks>
/// We cannot pass the message bus instance to the event listener, since the listener may be in a remote AppDomain
/// </remarks>
private static void RegisterEventListener(IEventListener listener, IRunContextEvents context)
{
context.OnRunStarted += (s, e) => listener.RunStarted();
context.OnRunFinished += (s, e) => listener.RunFinished();
context.OnFeatureStarted += (s, e) => listener.FeatureStarted(e.EventInfo);
context.OnFeatureFinished += (s, e) => listener.FeatureFinished(e.EventInfo);
context.OnScenarioStarted += (s, e) => listener.ScenarioStarted(e.EventInfo.Title);
context.OnScenarioFinished += (s, e) => listener.ScenarioFinished(e.EventInfo);
}
开发者ID:smhabdoli,项目名称:NBehave,代码行数:17,代码来源:NBehaveInitializer.cs
示例20: PrimaryListener
public PrimaryListener(IEventListener eventListener)
{
m_EventListener = eventListener;
if (m_EventListener != null) {
//EventThread.SetApartmentState(ApartmentState.MTA);
EventThread.Priority = ThreadPriority.BelowNormal;
EventThread.IsBackground = true;
EventThread.Start(this);
}
}
开发者ID:Beetle-ru,项目名称:NucleusCollaborative,代码行数:10,代码来源:Listener.cs
注:本文中的IEventListener类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论