当前位置: 首页>>代码示例>>C#>>正文


C# EventName.ToString方法代码示例

本文整理汇总了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);
        }
    }
开发者ID:sonygod,项目名称:ESPUnity,代码行数:18,代码来源:EasyTouch.cs

示例2: FilterDelete

 public static Task<CommandReply> FilterDelete(this EventSocket eventSocket, EventName eventName)
 {
     return eventSocket.FilterDelete("Event-Name", eventName.ToString().ToUpperWithUnderscores());
 }
开发者ID:bushadam,项目名称:NEventSocket,代码行数:4,代码来源:CommandExtensions.cs

示例3: SendEvent

 public static Task<CommandReply> SendEvent(
     this EventSocket eventSocket, EventName eventName, IDictionary<string, string> headers = null)
 {
     return SendEvent(eventSocket, eventName.ToString().ToUpperWithUnderscores(), headers);
 }
开发者ID:bushadam,项目名称:NEventSocket,代码行数:5,代码来源:CommandExtensions.cs

示例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);
                }
            }
        }
开发者ID:dzikun,项目名称:WarEmu,代码行数:35,代码来源:EventInterface.cs

示例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);
            }
        }
开发者ID:dzikun,项目名称:WarEmu,代码行数:15,代码来源:EventInterface.cs

示例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 );
                    }
                }
            }
开发者ID:huayang912,项目名称:cs-dotnetnuke,代码行数:16,代码来源:Scheduler.cs

示例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));
            }
        }
开发者ID:dzikun,项目名称:WarEmu,代码行数:17,代码来源:EventInterface.cs

示例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 );
                }
            }
开发者ID:huayang912,项目名称:cs-dotnetnuke,代码行数:80,代码来源:Scheduler.cs

示例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);
                }
            }
开发者ID:revellado,项目名称:privateSocialGroups,代码行数:48,代码来源:Scheduler.cs

示例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);
                    }
                }
            }
开发者ID:revellado,项目名称:privateSocialGroups,代码行数:28,代码来源:Scheduler.cs

示例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);
     }
 }
开发者ID:Lessica,项目名称:Something-of-SHIPWAR-GAMES,代码行数:15,代码来源:EasyTouch.cs

示例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);
                    }
                }
            }
开发者ID:biganth,项目名称:Curt,代码行数:18,代码来源:Scheduler.cs


注:本文中的EventName.ToString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。