本文整理汇总了C#中EventName.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# EventName.ToString方法的具体用法?C# EventName.ToString怎么用?C# EventName.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EventName
的用法示例。
在下文中一共展示了EventName.ToString方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SendGesture2Finger
private void SendGesture2Finger(EventName message, Gesture gesture)
{
// Sent to user GameObject
if (receiverObject!=null){
if (receiverObject != gesture.pickObject){
receiverObject.SendMessage(message.ToString(), gesture,SendMessageOptions.DontRequireReceiver );
}
}
// Sent to the GameObject who is selected
if ( gesture.pickObject!=null){
gesture.pickObject.SendMessage(message.ToString(), gesture,SendMessageOptions.DontRequireReceiver );
}
// sent to gameobject
else{
SendMessage(message.ToString(), gesture,SendMessageOptions.DontRequireReceiver);
}
}
示例2: FilterDelete
public static Task<CommandReply> FilterDelete(this EventSocket eventSocket, EventName eventName)
{
return eventSocket.FilterDelete("Event-Name", eventName.ToString().ToUpperWithUnderscores());
}
示例3: SendEvent
public static Task<CommandReply> SendEvent(
this EventSocket eventSocket, EventName eventName, IDictionary<string, string> headers = null)
{
return SendEvent(eventSocket, eventName.ToString().ToUpperWithUnderscores(), headers);
}
示例4: AddEventNotify
public void AddEventNotify(EventName Name, EventNotify Event, bool Force)
{
//if(_Owner.IsPlayer())
//Log.Info("AddEventNotify", "[" + (_Owner != null ? _Owner.Name : "") + "] Add de :" + EventName);
List < EventNotify > L;
if (!Force)
{
lock (_Notify)
{
if (!_Notify.TryGetValue(Name.ToString(), out L))
{
L = new List<EventNotify>();
_Notify.Add(Name.ToString(), L);
}
if (!L.Contains(Event))
L.Add(Event);
}
}
else
{
lock (_ForceNotify)
{
if (!_ForceNotify.TryGetValue(Name.ToString(), out L))
{
L = new List<EventNotify>();
_ForceNotify.Add(Name.ToString(), L);
}
if (!L.Contains(Event))
L.Add(Event);
}
}
}
示例5: RemoveEventNotify
public void RemoveEventNotify(EventName Name, EventNotify Event)
{
List<EventNotify> L;
lock (_Notify)
{
if (_Notify.TryGetValue(Name.ToString(), out L))
L.Remove(Event);
}
lock (_ForceNotify)
{
if (_ForceNotify.TryGetValue(Name.ToString(), out L))
L.Remove(Event);
}
}
示例6: LoadQueueFromEvent
public static void LoadQueueFromEvent( EventName EventName )
{
SchedulingController s = new SchedulingController();
ArrayList a = s.GetScheduleByEvent( EventName.ToString(), Globals.ServerName );
for( int i = 0; i < a.Count; i++ )
{
ScheduleHistoryItem scheduleItem = (ScheduleHistoryItem)( a[i] );
if( ! IsInQueue( scheduleItem ) && ! IsInProgress( scheduleItem ) && ! HasDependenciesConflict( scheduleItem ) && scheduleItem.Enabled )
{
scheduleItem.ScheduleSource = ScheduleSource.STARTED_FROM_EVENT;
AddToScheduleQueue( scheduleItem );
}
}
}
示例7: Notify
public void Notify(EventName Name, Object Sender, object Args)
{
// Log.Info("Notify", "[" + (Obj != null ? Obj.Name : "") + "] Appel de :" + EventName);
List<EventNotify> L;
lock (_Notify)
{
if (_Notify.TryGetValue(Name.ToString(), out L))
L.RemoveAll(Event => Event.Invoke(Sender, Args));
}
lock (_ForceNotify)
{
if (_ForceNotify.TryGetValue(Name.ToString(), out L))
L.RemoveAll(Event => Event.Invoke(Sender, Args));
}
}
示例8: RunEventSchedule
public static void RunEventSchedule( EventName EventName )
{
try
{
EventLogController objEventLog = new EventLogController();
LogInfo objEventLogInfo = new LogInfo();
objEventLogInfo.AddProperty( "EVENT", EventName.ToString() );
objEventLogInfo.LogTypeKey = "SCHEDULE_FIRED_FROM_EVENT";
objEventLog.AddLog( objEventLogInfo );
///''''''''''''''''''''''''''''''''''''''''''''''''
//We allow for three threads to run simultaneously.
//As long as we have an open thread, continue.
///''''''''''''''''''''''''''''''''''''''''''''''''
///''''''''''''''''''''''''''''''''''''''''''''''''
//Load the queue to determine which schedule
//items need to be run.
///''''''''''''''''''''''''''''''''''''''''''''''''
LoadQueueFromEvent( EventName );
while( GetScheduleQueueCount() > 0 )
{
SetScheduleStatus( ScheduleStatus.RUNNING_EVENT_SCHEDULE );
///''''''''''''''''''''''''''''''''''''''''''''''''
//Fire off the events that need running.
///''''''''''''''''''''''''''''''''''''''''''''''''
try
{
objQueueReadWriteLock.AcquireReaderLock( ReadTimeout );
try
{
// It is safe for this thread to read from
// the shared resource.
if( GetScheduleQueueCount() > 0 )
{
//FireEvents(False)
FireEvents( true );
}
Interlocked.Increment( ref Reads );
}
finally
{
// Ensure that the lock is released.
objQueueReadWriteLock.ReleaseReaderLock();
}
}
catch( ApplicationException )
{
// The reader lock request timed out.
Interlocked.Increment( ref ReaderTimeouts );
}
if( WriterTimeouts > 20 || ReaderTimeouts > 20 )
{
///''''''''''''''''''''''''''''''''''''''''''''''''
//Wait for 10 minutes so we don't fill up the logs
///''''''''''''''''''''''''''''''''''''''''''''''''
Thread.Sleep( 600000 ); //sleep for 10 seconds
}
else
{
///''''''''''''''''''''''''''''''''''''''''''''''''
//Wait for 10 seconds to avoid cpu overutilization
///''''''''''''''''''''''''''''''''''''''''''''''''
Thread.Sleep( 10000 ); //sleep for 10 seconds
}
if( GetScheduleQueueCount() == 0 )
{
return;
}
}
}
catch( Exception exc )
{
Exceptions.Exceptions.ProcessSchedulerException( exc );
}
}
示例9: RunEventSchedule
public static void RunEventSchedule(EventName eventName)
{
try
{
var log = new LogInfo {LogTypeKey = "SCHEDULE_FIRED_FROM_EVENT"};
log.AddProperty("EVENT", eventName.ToString());
LogController.Instance.AddLog(log);
//We allow for three threads to run simultaneously.
//As long as we have an open thread, continue.
//Load the queue to determine which schedule
//items need to be run.
LoadQueueFromEvent(eventName);
while (GetScheduleQueueCount() > 0)
{
SetScheduleStatus(ScheduleStatus.RUNNING_EVENT_SCHEDULE);
//Fire off the events that need running.
if (GetScheduleQueueCount() > 0)
{
FireEvents();
}
if (_writerTimeouts > 20 || _readerTimeouts > 20)
{
//Wait for 10 minutes so we don't fill up the logs
Thread.Sleep(TimeSpan.FromMinutes(10));
}
else
{
//Wait for 10 seconds to avoid cpu overutilization
Thread.Sleep(TimeSpan.FromSeconds(10));
}
if (GetScheduleQueueCount() == 0)
{
return;
}
}
}
catch (Exception exc)
{
Exceptions.Exceptions.ProcessSchedulerException(exc);
}
}
示例10: LoadQueueFromEvent
public static void LoadQueueFromEvent(EventName eventName)
{
var executingServer = ServerController.GetExecutingServerName();
List<ScheduleItem> schedule = SchedulingController.GetScheduleByEvent(eventName.ToString(), executingServer);
var thisServer = GetServer(executingServer);
bool runningInAGroup = !String.IsNullOrEmpty(thisServer.ServerGroup);
var serverGroupServers = ServerGroupServers(thisServer);
foreach (ScheduleItem scheduleItem in schedule)
{
if (runningInAGroup && String.IsNullOrEmpty(scheduleItem.Servers))
{
scheduleItem.Servers = serverGroupServers;
}
var historyItem = new ScheduleHistoryItem(scheduleItem);
if (!IsInQueue(historyItem) &&
!IsInProgress(historyItem) &&
!HasDependenciesConflict(historyItem) &&
historyItem.Enabled)
{
historyItem.ScheduleSource = ScheduleSource.STARTED_FROM_EVENT;
AddToScheduleQueue(historyItem);
}
}
}
示例11: SendGesture2Finger
private void SendGesture2Finger(EventName message, Gesture gesture)
{
if ((this.receiverObject != null) && (this.receiverObject != gesture.pickObject))
{
this.receiverObject.SendMessage(message.ToString(), gesture, SendMessageOptions.DontRequireReceiver);
}
if (gesture.pickObject != null)
{
gesture.pickObject.SendMessage(message.ToString(), gesture, SendMessageOptions.DontRequireReceiver);
}
else
{
base.SendMessage(message.ToString(), gesture, SendMessageOptions.DontRequireReceiver);
}
}
示例12: LoadQueueFromEvent
public static void LoadQueueFromEvent(EventName eventName)
{
List<ScheduleItem> schedule = SchedulingController.GetScheduleByEvent(eventName.ToString(), ServerController.GetExecutingServerName());
foreach (ScheduleItem scheduleItem in schedule)
{
var historyItem = new ScheduleHistoryItem(scheduleItem);
if (!IsInQueue(historyItem) &&
!IsInProgress(historyItem) &&
!HasDependenciesConflict(historyItem) &&
historyItem.Enabled)
{
historyItem.ScheduleSource = ScheduleSource.STARTED_FROM_EVENT;
AddToScheduleQueue(historyItem);
}
}
}