public static XStateClass GetStateClass(EventName eventName) { switch (eventName) { case (EventName.Подтверждение_тревоги): case (EventName.Смена_пользователя): case (EventName.Вход_пользователя_в_систему): case (EventName.Выход_пользователя_из_системы): case (EventName.Зависание_процесса_отпроса): case (EventName.Отсутствует_лицензия): case (EventName.Лицензия_обнаружена): case (EventName.Ошибка_инициализации_мониторинга): case (EventName.Применение_конфигурации): return XStateClass.Norm; case (EventName.Обновление_ПО_прибора): case (EventName.Запись_конфигурации_в_прибор): case (EventName.Чтение_конфигурации_из_прибора): case (EventName.Синхронизация_времени): case (EventName.Запрос_информации_об_устройсве): case (EventName.Команда_оператора): case (EventName.Отмена_операции): case (EventName.ГК_в_технологическом_режиме): case (EventName.ГК_в_рабочем_режиме): return XStateClass.Info; case (EventName.Ошибка_при_выполнении_команды): case (EventName.Ошибка_при_выполнении_команды_над_устройством): return XStateClass.Failure; default: return XStateClass.Unknown; } }
public void Equals_WhenComparingEquivalentValues_ReturnsTrue() { var left = new EventName(SomeTestEvents.TestRequest); var right = new EventName(SomeTestEvents.TestRequest); bool result = left.Equals(right); Assert.That(result, Is.True); }
public static void StartListening(EventName eventName, Action <EventParam> listener) { if (eventDictionary.ContainsKey(eventName)) { /// Add more events eventDictionary[eventName] += listener; } else { /// Add event to dictionary for the first time eventDictionary.Add(eventName, listener); } }
public void AssociatedMember_creates_event_name_accessor_methods(string parameters, string eventName) { // When parameters are unspecified in an accessor, the generated event is likewise // unspecified. If we have a parameter, we can infer the event type var addon = MethodName.Parse("INotifyPropertyChanged.add_PropertyChanged" + parameters); var remover = MethodName.Parse("INotifyPropertyChanged.remove_PropertyChanged" + parameters); var raiser = MethodName.Parse("INotifyPropertyChanged.raise_PropertyChanged" + parameters); var evt = EventName.Parse(eventName); Assert.Equal(addon, evt.AddMethod); Assert.Equal(remover, evt.RemoveMethod); Assert.Equal(raiser, evt.RaiseMethod); }
public void Notify(EventName name, Object sender, object args) { List <EventNotify> eventNotifies; int i, count; lock (_notify) { if (_notify.TryGetValue((int)name, out eventNotifies)) { for (i = 0; i < eventNotifies.Count; ++i) { EventNotify target = eventNotifies[i]; if (target.Invoke(sender, args)) { if (ReferenceEquals(eventNotifies[i], target)) { eventNotifies.RemoveAt(i); } else { eventNotifies.Remove(target); } --i; } } } } lock (_forceNotify) { if (_forceNotify.TryGetValue((int)name, out eventNotifies)) { for (i = 0; i < eventNotifies.Count; ++i) { EventNotify target = eventNotifies[i]; if (target.Invoke(sender, args)) { if (ReferenceEquals(eventNotifies[i], target)) { eventNotifies.RemoveAt(i); } else { eventNotifies.Remove(target); } --i; } } } } }
public void parse_event_explicit_interface() { var cr = CodeReference.Parse("E:System.Collections.ObjectModel.ObservableCollection`1.System#ComponentModel#INotifyPropertyChanged#PropertyChanged"); Assert.Equal(SymbolType.Event, cr.MetadataName.SymbolType); EventName name = (EventName)cr.MetadataName; Assert.Equal("System.Collections.ObjectModel.ObservableCollection`1::System.ComponentModel.INotifyPropertyChanged.PropertyChanged", name.FullName); Assert.Equal("System.Collections.ObjectModel.ObservableCollection`1", name.DeclaringType.FullName); Assert.Equal("System.ComponentModel.INotifyPropertyChanged.PropertyChanged", name.Name); Assert.Equal("E:System.Collections.ObjectModel.ObservableCollection`1.System#ComponentModel#INotifyPropertyChanged#PropertyChanged", cr.ToString()); }
/// <summary> /// Create an object from the Command class of the DTE /// </summary> /// <param name="DTECommandObj">Command class of the DTE</param> public MonitoredCommandEvent(Command DTECommandObj) { if (DTECommandObj != null) { this.EventName = DTECommandObj.Name; this.Classification = EventName.Split('.')[0]; //use the first part of event name this.Guid = DTECommandObj.Guid; this.EventID = DTECommandObj.ID; } else { throw new ArgumentNullException("DTECommandObj"); } }
/// <summary> /// remove listener from the event specified if exists /// </summary> public static void StopListening(EventName eventName, UnityAction <EventArgs> listener) { if (eventManager == null) { return; } GameEvent thisEvent = null; if (Instance.eventDictionary.TryGetValue(eventName, out thisEvent)) { thisEvent.AddListener(listener); } }
//-------------------------------------------------------------------------- void Start() { if (!isLocalPlayer) { return; } FindComponent(); if (!isServer) { return; } select_event_ = (EventName)Random.Range(0, (int)EventName.EVENT_MAX); is_create_durian_boom_ = MyRandom.RandomBool(); }
public Generated.Event.Types.Name ToDto(EventName evName) { switch (evName) { case EventName.ContestantRegistered: return(Generated.Event.Types.Name.ContestantRegistered); case EventName.TeamAdded: return(Generated.Event.Types.Name.TeamAdded); default: throw new ArgumentOutOfRangeException(nameof(evName), evName, null); } }
public void Write(WorldPacket data) { data.WriteUInt64(EventID); data.WriteUInt8((byte)EventType); data.WritePackedTime(Date); data.WriteUInt32((uint)Flags); data.WriteInt32(TextureID); data.WriteUInt64(EventClubID); data.WritePackedGuid(OwnerGuid); data.WriteBits(EventName.GetByteCount(), 8); data.FlushBits(); data.WriteString(EventName); }
/// <summary> /// <param>Track an event (in EventName list)</param> /// </summary> /// <param name="eventName">Event name</param> /// <param name="data">Internal data</param> /// <param name="eventType">event type</param> /// <param name="customVariables">External data (set in game)</param> public static void TrackEvent(EventName eventName, string data = null, string eventType = null, Dictionary <string, object> customVariables = null) { string customVariablesJson = null; if (customVariables != null) { customVariablesJson = AnalyticsUtil.ConvertDictionaryToCustomVarJson(customVariables); } InternalTrackEvent(eventName.ToString(), data, eventType, customVariablesJson); }
public void Off(EventName eventName, Action <object> callback) { if (events.ContainsKey(eventName)) { events[eventName] -= callback; eventsCount[eventName]--; if (eventsCount[eventName] == 0) { eventsCount.Remove(eventName); events.Remove(eventName); } } }
public string ToString(bool includeaction = false, bool multi = false) // multi means quoting needed for ) as well as comma space { string ret = ""; if (includeaction) { ret += EventName.QuoteString(comma: true) + ", " + Action.QuoteString(comma: true) + ", "; if (ActionVars.Count == 0) { ret += "\"\", "; } else { string v = ActionVars.ToString(); if (v.Contains("\"") || v.Contains(",")) { ret += "\"" + v.Replace("\"", "\\\"") + "\", "; // verified 12/06/2020 } else { ret += v + ", "; } } } for (int i = 0; Fields != null && i < Fields.Count; i++) { if (i > 0) { ret += " " + InnerCondition.ToString() + " "; } if (ConditionEntry.IsNullOperation(Fields[i].MatchCondition)) { ret += "Condition " + ConditionEntry.OperatorNames[(int)Fields[i].MatchCondition]; } else { ret += (Fields[i].ItemName).QuoteString(bracket: multi) + // commas do not need quoting as conditions at written as if always at EOL. " " + ConditionEntry.OperatorNames[(int)Fields[i].MatchCondition]; if (!ConditionEntry.IsUnaryOperation(Fields[i].MatchCondition)) { ret += " " + Fields[i].MatchString.QuoteString(bracket: multi); // commas do not need quoting.. } } } return(ret); }
public static void StopListening(EventName eventName, Action <Dictionary <string, object> > listener) { if (eventManager == null) { return; } Action <Dictionary <string, object> > thisEvent; if (instance.eventDictionary.TryGetValue(eventName, out thisEvent)) { thisEvent -= listener; instance.eventDictionary[eventName] = thisEvent; } }
public void OpenChannels(int id) { if (lifeChannel == null) { lifeChannel = new EventName(Player.LIFE_CHANNEL, id); } if (damageChannel == null) { damageChannel = new EventName(Player.DAMAGE_CHANNEL, id); } EventManager.StartListening(lifeChannel, ReceiveLife); EventManager.StartListening(damageChannel, TakeDamage); }
// Use this for initialization public void Start() { player = GetComponent <Player> (); life = maxLife; dead = false; timer = 0f; lastHitDate = 0f; bloodCanvas = new EventName(BloodCanvas.BLOOD_CANVAS_CHANNEL); lifeBar = new EventName(LifeBar.LIFE_BAR_CHANNEL); nav = GetComponent <UnityEngine.AI.NavMeshAgent> (); // null if human maxLifeInit = maxLife; }
public OlympicEvent Map() { var olympicEvent = new OlympicEvent(); olympicEvent.Id = EventId; olympicEvent.EventName = EventName.AsProperNoun(); olympicEvent.EventTypeId = EventTypeId; olympicEvent.Description = Description?.Trim() ?? string.Empty; olympicEvent.Specification = Specification?.Trim() ?? string.Empty; olympicEvent.DateAdded = EventId == 0 ? DateTime.Now : DateAdded; olympicEvent.IsActive = IsActive; return(olympicEvent); }
public static void StartListening(EventName eventName, UnityAction <BookerMessage> listener) { BookerUnityEvent thisEvent = null; if (instance.eventDictionary.TryGetValue(eventName, out thisEvent)) { thisEvent.AddListener(listener); } else { thisEvent = new BookerUnityEvent(); thisEvent.AddListener(listener); instance.eventDictionary.Add(eventName, thisEvent); } }
/// <summary> /// 正在添加监听 /// </summary> /// <param name="eventName"></param> /// <param name="callBack"></param> private static void OnListerAding(EventName eventName, Delegate callBack) { if (!EventTable.ContainsKey(eventName)) { EventTable.Add(eventName, null); } Delegate d = EventTable[eventName]; if (d != null && d.GetType() != callBack.GetType()) { throw new Exception(string.Format("尝试为事件{0}添加不同类型的委托,当前事件所对应的委托是{1},要添加的委托类型为{2}", eventName, d.GetType(), callBack.GetType())); } }
public static void StartListening(EventName eventName, UnityAction action) { if (instance == null) { Init(); } UnityEvent thisEvent = null; if (eventDictionary.TryGetValue(eventName, out thisEvent)) { thisEvent = new UnityEvent(); thisEvent.AddListener(action); eventDictionary.Add(eventName, thisEvent); } }
void SendExperience(string mess, float xp) { string title = name + " [ " + level + " ] " + mess + " - [ +" + (int)(xp) + " XP]"; //Debug.Log ("Sending xp to : side : " + owners.side + " count : " + owners.players.Count); foreach (Player p in owners.players) { EventName xpEvent = new EventName(Player.XP_CHANNEL, p.id); EventManager.TriggerAction(xpEvent, new object[] { xp }); if (p.isHuman) { EventManager.TriggerAction(playerLogEvent, new object[] { title }); } } }
void Subscribe(EventName eventName, ISubscriber subscriber) { HashSet <ISubscriber> subList; if (eventMap.TryGetValue(eventName, out subList)) { subList.Add(subscriber); } else { subList = new HashSet <ISubscriber>(); subList.Add(subscriber); eventMap.Add(eventName, subList); } }
/// <summary> /// Add listener to the event specified or create new event then add the listener /// </summary> public static void StartListening(EventName eventName, UnityAction <EventArgs> listener) { GameEvent thisEvent = null; if (Instance.eventDictionary.TryGetValue(eventName, out thisEvent)) { thisEvent.AddListener(listener); } else { thisEvent = new GameEvent(); thisEvent.AddListener(listener); Instance.eventDictionary.Add(eventName, thisEvent); } }
public string ToString(int maxLength) { var _temp = ""; if (Count == 0) { _temp = $"Clean"; } else { _temp = $"{Count.ToString().ToFixedColumnRight(5)}"; } return($"{EventName.ToFixedColumnRight(maxLength)} - {_temp}"); }
/// <summary> /// 注册监听事件,如果字典中不存在那么创建 /// </summary> /// <param name="_eventName"></param> /// <param name="_listener"></param> public void StartListening(EventName _eventName, UnityAction _listener) { UnityEvent _thisEvent = null; if (eventDictionary.TryGetValue(_eventName, out _thisEvent)) { _thisEvent.AddListener(_listener); } else { _thisEvent = new UnityEvent(); _thisEvent.AddListener(_listener); eventDictionary.Add(_eventName, _thisEvent); } }
public static void StartListening(EventName eventName, Action <Dictionary <string, object> > listener) { Action <Dictionary <string, object> > thisEvent; if (instance.eventDictionary.TryGetValue(eventName, out thisEvent)) { thisEvent += listener; instance.eventDictionary[eventName] = thisEvent; } else { thisEvent += listener; instance.eventDictionary.Add(eventName, thisEvent); } }
/// <summary> /// Add the specified eventName. /// </summary> /// <param name="eventName">Event name.</param> public UnityEvent AddEvent(EventName eventName) { UnityEvent unityEvent = null; if (!unityEvents.TryGetValue(eventName, out unityEvent)) { if (eventName == EventName.GameOverEvent) { unityEvent = new GameOver(); unityEvents.Add(EventName.GameOverEvent, unityEvent); } } return(unityEvent); }
public override int GetHashCode() { int hashcode = 157; unchecked { if (__isset.eventName) { hashcode = (hashcode * 397) + EventName.GetHashCode(); } if (__isset.eventAmount) { hashcode = (hashcode * 397) + EventAmount.GetHashCode(); } } return(hashcode); }
public static JournalItem AddMessage(EventName name, string userName) { var journalItem = new JournalItem() { SystemDateTime = DateTime.Now, DeviceDateTime = DateTime.Now, JournalItemType = JournalItemType.System, StateClass = XStateClass.Norm, Name = name.ToDescription(), ObjectStateClass = XStateClass.Norm, UserName = userName, SubsystemType = XSubsystemType.System }; Add(journalItem); return journalItem; }
public static void CompleteNotification(EventName eventName, bool completeIfNotActive = false) { if (!NotificationHistory.Any(x => x.EventName == eventName)) { var currentNotification = completeIfNotActive ? Notifications.FirstOrDefault(x => x.EventName == eventName) : Notifications.FirstOrDefault(); if (currentNotification != null && currentNotification.EventName == eventName && (completeIfNotActive || currentNotification.IsReady)) { Notifications.RemoveAll(x => x.EventName == eventName); NotificationHistory.Add(currentNotification); } else if (completeIfNotActive) { NotificationHistory.Add(new NotificationEvent(eventName, $"Pre-completed {eventName}")); } } }
/// <summary> /// Un-subscribes a listener from an event /// </summary> /// <param name="eventName"></param> /// <param name="listener"></param> public static void StopListening(EventName eventName, UnityAction listener) { if (null == private_instance) { return; } UnityEvent thisEvent = null; // If event name exists, populate 'thisEvent' with the event found if (Instance.m_EventDictionary.TryGetValue(eventName, out thisEvent)) { Debug.Log("~~ Removed listener " + listener.Method.Name + " from event: " + eventName.ToString()); thisEvent.RemoveListener(listener); } }
private static string GetEventName(EventName eventName) { switch (eventName) { case EventName.Help: return ""; case EventName.SimpleSend: return "Workshare Protect - Send Clicked"; case EventName.AdvancedSend: return "Advanced Email Security Options - Send Clicked"; case EventName.AdvancedCancel: return "Advanced Email Security Options Cancel"; default: throw new Exception("Invalid event name"); } }
public bool Equals(CSVEvent other) { //Check whether the compared object is null. if (Object.ReferenceEquals(other, null)) { return(false); } //Check whether the compared object references the same data. if (Object.ReferenceEquals(this, other)) { return(true); } return(EventName.GetHashCode() == other.GetHashCode()); }
public static void SendEvent(EventName eventName, Dictionary<string, object> properties = null) { try { var analyticEvent = new AnalyticEvent() { EventName = GetEventName(eventName), EventProperties = properties }; analyticEvent.RaiseEvent(); } catch (Exception ex) { Logger.LogError(ex); } }
public void it_should_parse_event_messages(string input, EventName eventName) { var parser = new Parser(); var rawInput = input.Replace("\r\n", "\n") + "\n\n"; foreach (char c in rawInput) { parser.Append(c); } Assert.True(parser.Completed); var eventMessage = new EventMessage(parser.ExtractMessage()); Assert.NotNull(eventMessage); Assert.Equal(eventName, eventMessage.EventName); Console.WriteLine(eventMessage.ToString()); }
void RandEvent() { if (time_limitter_ == null) return; Debug.Log(game_start_director_.IsStart); Debug.Log(game_start_director_.isLocalPlayer); if (!game_start_director_.IsStart) return; var time = time_limitter_.LimitCount; if (time_ == time) return; if (time == 60) return; if (time <= 0) return; if (time % TIME_BALANCE == 0) { switch (select_event_) { case EventName.DURIAN_BOMB: if (is_create_durian_boom_) { FindObjectOfType<FruitCreater>().DorianCreate(); } break; case EventName.KUDAMON_BOUND: FindObjectOfType<BounceKudamon>().Starter(); break; case EventName.KUDAMON_RUSH: FindObjectOfType<RushEventer>().StartEvent(); break; } time_ = time; } if(time == 50 || time == 30) { if (!isServer) return; var select_event = (EventName)Random.Range(0, (int)EventName.EVENT_MAX); var is_durian_boom = MyRandom.RandomBool(); select_event_ = select_event; is_create_durian_boom_ = is_durian_boom; CmdTellServerSelectEvent(select_event, is_durian_boom); } }
void CmdTellServerSelectEvent(EventName value, bool is_durian_boom) { select_event_ = value; is_create_durian_boom_ = is_durian_boom; }
public void RpcSetSelectEvent(EventName value, bool is_durian_boom) { select_event_ = value; is_create_durian_boom_ = is_durian_boom; }
//-------------------------------------------------------------------------- void Start() { if (!isLocalPlayer) return; FindComponent(); if (!isServer) return; select_event_ = (EventName)Random.Range(0, (int)EventName.EVENT_MAX); is_create_durian_boom_ = MyRandom.RandomBool(); }
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)); } }
private void RaiseEvent(EventName evnt, Gesture gesture){ switch(evnt){ case EventName.On_Cancel: if (On_Cancel!=null) On_Cancel( gesture); break; case EventName.On_Cancel2Fingers: if (On_Cancel2Fingers!=null) On_Cancel2Fingers( gesture ); break; case EventName.On_TouchStart: if (On_TouchStart!=null) On_TouchStart( gesture); break; case EventName.On_TouchDown: if (On_TouchDown!=null) On_TouchDown( gesture); break; case EventName.On_TouchUp: if (On_TouchUp!=null) On_TouchUp( gesture ); break; case EventName.On_SimpleTap: if (On_SimpleTap!=null) On_SimpleTap( gesture); break; case EventName.On_DoubleTap: if (On_DoubleTap!=null) On_DoubleTap(gesture); break; case EventName.On_LongTapStart: if (On_LongTapStart!=null) On_LongTapStart(gesture); break; case EventName.On_LongTap: if (On_LongTap!=null) On_LongTap(gesture); break; case EventName.On_LongTapEnd: if (On_LongTapEnd!=null) On_LongTapEnd(gesture); break; case EventName.On_DragStart: if (On_DragStart!=null) On_DragStart(gesture); break; case EventName.On_Drag: if (On_Drag!=null) On_Drag(gesture); break; case EventName.On_DragEnd: if (On_DragEnd!=null) On_DragEnd(gesture); break; case EventName.On_SwipeStart: if (On_SwipeStart!=null) On_SwipeStart( gesture); break; case EventName.On_Swipe: if (On_Swipe!=null) On_Swipe( gesture); break; case EventName.On_SwipeEnd: if (On_SwipeEnd!=null) On_SwipeEnd(gesture); break; case EventName.On_TouchStart2Fingers: if (On_TouchStart2Fingers!=null) On_TouchStart2Fingers( gesture); break; case EventName.On_TouchDown2Fingers: if (On_TouchDown2Fingers!=null) On_TouchDown2Fingers(gesture); break; case EventName.On_TouchUp2Fingers: if (On_TouchUp2Fingers!=null) On_TouchUp2Fingers(gesture); break; case EventName.On_SimpleTap2Fingers: if (On_SimpleTap2Fingers!=null) On_SimpleTap2Fingers(gesture); break; case EventName.On_DoubleTap2Fingers: if (On_DoubleTap2Fingers!=null) On_DoubleTap2Fingers(gesture); break; case EventName.On_LongTapStart2Fingers: if (On_LongTapStart2Fingers!=null) On_LongTapStart2Fingers(gesture); break; case EventName.On_LongTap2Fingers: if (On_LongTap2Fingers!=null) On_LongTap2Fingers(gesture); break; case EventName.On_LongTapEnd2Fingers: if (On_LongTapEnd2Fingers!=null) On_LongTapEnd2Fingers(gesture); break; case EventName.On_Twist: if (On_Twist!=null) On_Twist(gesture); break; case EventName.On_TwistEnd: if (On_TwistEnd!=null) On_TwistEnd(gesture); break; case EventName.On_Pinch: if (On_Pinch!=null) On_Pinch(gesture); break; case EventName.On_PinchIn: if (On_PinchIn!=null) On_PinchIn(gesture); break; case EventName.On_PinchOut: if (On_PinchOut!=null) On_PinchOut(gesture); break; case EventName.On_PinchEnd: if (On_PinchEnd!=null) On_PinchEnd(gesture); break; case EventName.On_DragStart2Fingers: if (On_DragStart2Fingers!=null) On_DragStart2Fingers(gesture); break; case EventName.On_Drag2Fingers: if (On_Drag2Fingers!=null) On_Drag2Fingers(gesture); break; case EventName.On_DragEnd2Fingers: if (On_DragEnd2Fingers!=null) On_DragEnd2Fingers(gesture); break; case EventName.On_SwipeStart2Fingers: if (On_SwipeStart2Fingers!=null) On_SwipeStart2Fingers(gesture); break; case EventName.On_Swipe2Fingers: if (On_Swipe2Fingers!=null) On_Swipe2Fingers(gesture); break; case EventName.On_SwipeEnd2Fingers: if (On_SwipeEnd2Fingers!=null) On_SwipeEnd2Fingers(gesture); break; case EventName.On_OverUIElement: if (On_OverUIElement!=null){ On_OverUIElement(gesture); } break; case EventName.On_UIElementTouchUp: if (On_UIElementTouchUp!=null){ On_UIElementTouchUp( gesture); } break; } }
private void CreateGesture2Finger(EventName message,Vector2 startPosition,Vector2 position,Vector2 deltaPosition, float actionTime, SwipeType swipe, float swipeLength,Vector2 swipeVector,float twist,float pinch) { //Creating the structure with the required information Gesture gesture = new Gesture(); gesture.touchCount=2; gesture.fingerIndex=-1; gesture.startPosition = startPosition; gesture.position = position; gesture.deltaPosition = deltaPosition; gesture.actionTime = actionTime; if (fingers[twoFinger0]!=null) gesture.deltaTime = fingers[twoFinger0].deltaTime; else if (fingers[twoFinger1]!=null) gesture.deltaTime = fingers[twoFinger1].deltaTime; else gesture.deltaTime=0; gesture.swipe = swipe; gesture.swipeLength = swipeLength; gesture.swipeVector = swipeVector; gesture.deltaPinch = pinch; gesture.twistAngle = twist; if (message!= EventName.On_Cancel2Fingers){ gesture.pickObject = pickObject2Finger; } else { gesture.pickObject = oldPickObject2Finger; } gesture.otherReceiver = receiverObject; if (useBroadcastMessage){ SendGesture2Finger(message,gesture ); } else{ RaiseEvent(message, gesture); } }
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); } }
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); } } }
public static Task<CommandReply> SendEvent( this EventSocket eventSocket, EventName eventName, IDictionary<string, string> headers = null) { return SendEvent(eventSocket, eventName.ToString().ToUpperWithUnderscores(), headers); }
public static Task<CommandReply> FilterDelete(this EventSocket eventSocket, EventName eventName) { return eventSocket.FilterDelete("Event-Name", eventName.ToString().ToUpperWithUnderscores()); }
public static void AddGKMessage(EventName message, string description, XBase xBase, string userName, bool isAdministrator = false) { Guid uid = Guid.Empty; var journalItemType = JournalItemType.System; if (xBase != null) { if (xBase is XDevice) { uid = (xBase as XDevice).UID; journalItemType = JournalItemType.Device; } if (xBase is XZone) { uid = (xBase as XZone).UID; journalItemType = JournalItemType.Zone; } if (xBase is XDirection) { uid = (xBase as XDirection).UID; journalItemType = JournalItemType.Direction; } if (xBase is XDelay) { uid = (xBase as XDelay).UID; journalItemType = JournalItemType.Delay; } if (xBase is XPim) { uid = (xBase as XPim).UID; journalItemType = JournalItemType.Pim; } } var journalItem = new JournalItem() { SystemDateTime = DateTime.Now, DeviceDateTime = DateTime.Now, JournalItemType = journalItemType, StateClass = EventNamesHelper.GetStateClass(message), Name = message.ToDescription(), Description = description, ObjectUID = uid, ObjectStateClass = XStateClass.Norm, UserName = userName, SubsystemType = XSubsystemType.System }; if (xBase != null) { journalItem.ObjectName = xBase.PresentationName; journalItem.GKObjectNo = (ushort)xBase.GKDescriptorNo; } GKDBHelper.Add(journalItem); OnNewJournalItem(journalItem, isAdministrator); var gkCallbackResult = new GKCallbackResult(); gkCallbackResult.JournalItems.Add(journalItem); OnGKCallbackResult(gkCallbackResult); }
private bool CreateGesture(EventName message,Finger finger,float actionTime, SwipeType swipe, float swipeLength, Vector2 swipeVector) { //Creating the structure with the required information Gesture gesture = new Gesture(); gesture.fingerIndex = finger.fingerIndex; gesture.touchCount = finger.touchCount; gesture.startPosition = finger.startPosition; gesture.position = finger.position; gesture.deltaPosition = finger.deltaPosition; gesture.actionTime = actionTime; gesture.deltaTime = finger.deltaTime; gesture.swipe = swipe; gesture.swipeLength = swipeLength; gesture.swipeVector = swipeVector; gesture.deltaPinch = 0; gesture.twistAngle = 0; gesture.pickObject = finger.pickedObject; gesture.otherReceiver = receiverObject; if (useBroadcastMessage){ SendGesture(message,gesture); } if (!useBroadcastMessage || joystickAddon){ RaiseEvent(message, gesture); } return true; }
public void AddEventNotify(EventName Name, EventNotify Event) { AddEventNotify(Name, Event, false); }
private void CreateGesture2Finger(EventName message,Vector2 startPosition,Vector2 position,Vector2 deltaPosition, float actionTime, SwipeDirection swipe, float swipeLength,Vector2 swipeVector,float twist,float pinch, float twoDistance){ bool firingEvent = true; Gesture gesture = new Gesture(); gesture.isOverGui = false; // NGui if (enabledNGuiMode && message == EventName.On_TouchStart2Fingers){ gesture.isOverGui = gesture.isOverGui || ( IsTouchOverNGui(twoFinger.position) && IsTouchOverNGui(twoFinger.position)); } gesture.touchCount=2; gesture.fingerIndex=-1; gesture.startPosition = startPosition; gesture.position = position; gesture.deltaPosition = deltaPosition; gesture.actionTime = actionTime; gesture.deltaTime=Time.deltaTime; gesture.swipe = swipe; gesture.swipeLength = swipeLength; gesture.swipeVector = swipeVector; gesture.deltaPinch = pinch; gesture.twistAngle = twist; gesture.twoFingerDistance = twoDistance; gesture.pickedObject = twoFinger.pickedObject; gesture.pickedCamera = twoFinger.pickedCamera; gesture.isGuiCamera= twoFinger.isGuiCamera; if (autoUpdatePickedObject){ if (message != EventName.On_Drag && message != EventName.On_DragEnd && message != EventName.On_Twist && message != EventName.On_TwistEnd && message != EventName.On_Pinch && message != EventName.On_PinchEnd && message != EventName.On_PinchIn && message != EventName.On_PinchOut){ if (GetTwoFingerPickedObject()){ gesture.pickedObject = pickedObject.pickedObj; gesture.pickedCamera = pickedObject.pickedCamera; gesture.isGuiCamera= pickedObject.isGUI; } else{ twoFinger.ClearPickedObjectData(); } } } gesture.pickedUIElement = twoFinger.pickedUIElement; gesture.isOverGui = twoFinger.isOverGui; if (allowUIDetection && autoUpdatePickedUI){ if (message != EventName.On_Drag && message != EventName.On_DragEnd && message != EventName.On_Twist && message != EventName.On_TwistEnd && message != EventName.On_Pinch && message != EventName.On_PinchEnd && message != EventName.On_PinchIn && message != EventName.On_PinchOut){ if (message == EventName.On_SimpleTap2Fingers) if (GetTwoFingerPickedUIElement()){ gesture.pickedUIElement = pickedObject.pickedObj; gesture.isOverGui = true; } else{ twoFinger.ClearPickedUIData(); } } } // Firing event ? if ((enableUIMode || (enabledNGuiMode && allowUIDetection) ) ){ firingEvent = !gesture.isOverGui; } // Firing event if ( firingEvent){ RaiseEvent(message, gesture); } else if (gesture.isOverGui){ if (message == EventName.On_TouchUp2Fingers){ RaiseEvent(EventName.On_UIElementTouchUp, gesture); } else{ RaiseEvent(EventName.On_OverUIElement, gesture); } } }
private void CreateGesture2Finger(EventName message,Vector2 startPosition,Vector2 position,Vector2 deltaPosition, float actionTime, SwipeType swipe, float swipeLength,Vector2 swipeVector,float twist,float pinch, float twoDistance) { if (message == EventName.On_TouchStart2Fingers){ isStartHoverNGUI = IsTouchHoverNGui(twoFinger1) & IsTouchHoverNGui(twoFinger0); } if (!isStartHoverNGUI){ //Creating the structure with the required information Gesture gesture = new Gesture(); gesture.touchCount=2; gesture.fingerIndex=-1; gesture.startPosition = startPosition; gesture.position = position; gesture.deltaPosition = deltaPosition; gesture.actionTime = actionTime; if (fingers[twoFinger0]!=null) gesture.deltaTime = fingers[twoFinger0].deltaTime; else if (fingers[twoFinger1]!=null) gesture.deltaTime = fingers[twoFinger1].deltaTime; else gesture.deltaTime=0; gesture.swipe = swipe; gesture.swipeLength = swipeLength; gesture.swipeVector = swipeVector; gesture.deltaPinch = pinch; gesture.twistAngle = twist; gesture.twoFingerDistance = twoDistance; if (fingers[twoFinger0] != null){ gesture.pickCamera = fingers[twoFinger0].pickedCamera; gesture.isGuiCamera = fingers[twoFinger0].isGuiCamera; } else if (fingers[twoFinger1] != null){ gesture.pickCamera = fingers[twoFinger1].pickedCamera; gesture.isGuiCamera = fingers[twoFinger1].isGuiCamera; } if (message!= EventName.On_Cancel2Fingers){ gesture.pickObject = pickObject2Finger; } else { gesture.pickObject = oldPickObject2Finger; } gesture.otherReceiver = receiverObject; if (fingers[twoFinger0] != null){ gesture.isHoverReservedArea = IsTouchReservedArea( fingers[twoFinger0].fingerIndex); } if (fingers[twoFinger1] != null){ gesture.isHoverReservedArea = gesture.isHoverReservedArea || IsTouchReservedArea( fingers[twoFinger1].fingerIndex); } if (useBroadcastMessage){ SendGesture2Finger(message,gesture ); } else{ RaiseEvent(message, gesture); } } }
private void CreateGesture(int touchIndex,EventName message,Finger finger, SwipeDirection swipe, float swipeLength, Vector2 swipeVector){ bool firingEvent = true; if (autoUpdatePickedUI && allowUIDetection){ finger.isOverGui = IsScreenPositionOverUI( finger.position ); finger.pickedUIElement = GetFirstUIElementFromCache(); } // NGui if (enabledNGuiMode && message == EventName.On_TouchStart){ finger.isOverGui = finger.isOverGui || IsTouchOverNGui(finger.position); } // firing event ? if ((enableUIMode || enabledNGuiMode)){ firingEvent = !finger.isOverGui; } // The new gesture Gesture gesture = finger.GetGesture(); // Auto update picked object if (autoUpdatePickedObject && autoSelect){ if (message != EventName.On_Drag && message != EventName.On_DragEnd && message != EventName.On_DragStart){ if (GetPickedGameObject(finger)){ gesture.pickedObject = pickedObject.pickedObj; gesture.pickedCamera = pickedObject.pickedCamera; gesture.isGuiCamera = pickedObject.isGUI; } else{ gesture.pickedObject = null; gesture.pickedCamera = null; gesture.isGuiCamera = false; } } } gesture.swipe = swipe; gesture.swipeLength = swipeLength; gesture.swipeVector = swipeVector; gesture.deltaPinch = 0; gesture.twistAngle = 0; // Firing event if ( firingEvent){ RaiseEvent(message, gesture); } else if (finger.isOverGui){ if (message == EventName.On_TouchUp){ RaiseEvent(EventName.On_UIElementTouchUp, gesture); } else{ RaiseEvent(EventName.On_OverUIElement, gesture); } } }
private void RaiseEvent(EventName evnt, Gesture gesture) { //��������ͳһ�ж�UI����¼�������е������Ӧtouch�¼� if (IPointerOverUI.Instance.IsPointerOverUIObject(gesture.position.x, gesture.position.y)) { return; } switch(evnt){ case EventName.On_Cancel: if (On_Cancel!=null) On_Cancel( gesture); break; case EventName.On_Cancel2Fingers: if (On_Cancel2Fingers!=null) On_Cancel2Fingers( gesture ); break; case EventName.On_TouchStart: if (On_TouchStart!=null) On_TouchStart( gesture); break; case EventName.On_TouchDown: if (On_TouchDown!=null) On_TouchDown( gesture); break; case EventName.On_TouchUp: if (On_TouchUp!=null) On_TouchUp( gesture ); break; case EventName.On_SimpleTap: if (On_SimpleTap!=null) On_SimpleTap( gesture); break; case EventName.On_DoubleTap: if (On_DoubleTap!=null) On_DoubleTap(gesture); break; case EventName.On_LongTapStart: if (On_LongTapStart!=null) On_LongTapStart(gesture); break; case EventName.On_LongTap: if (On_LongTap!=null) On_LongTap(gesture); break; case EventName.On_LongTapEnd: if (On_LongTapEnd!=null) On_LongTapEnd(gesture); break; case EventName.On_DragStart: if (On_DragStart!=null) On_DragStart(gesture); break; case EventName.On_Drag: if (On_Drag!=null) On_Drag(gesture); break; case EventName.On_DragEnd: if (On_DragEnd!=null) On_DragEnd(gesture); break; case EventName.On_SwipeStart: if (On_SwipeStart!=null) On_SwipeStart( gesture); break; case EventName.On_Swipe: if (On_Swipe!=null) On_Swipe( gesture); break; case EventName.On_SwipeEnd: if (On_SwipeEnd!=null) On_SwipeEnd(gesture); break; case EventName.On_TouchStart2Fingers: if (On_TouchStart2Fingers!=null) On_TouchStart2Fingers( gesture); break; case EventName.On_TouchDown2Fingers: if (On_TouchDown2Fingers!=null) On_TouchDown2Fingers(gesture); break; case EventName.On_TouchUp2Fingers: if (On_TouchUp2Fingers!=null) On_TouchUp2Fingers(gesture); break; case EventName.On_SimpleTap2Fingers: if (On_SimpleTap2Fingers!=null) On_SimpleTap2Fingers(gesture); break; case EventName.On_DoubleTap2Fingers: if (On_DoubleTap2Fingers!=null) On_DoubleTap2Fingers(gesture); break; case EventName.On_LongTapStart2Fingers: if (On_LongTapStart2Fingers!=null) On_LongTapStart2Fingers(gesture); break; case EventName.On_LongTap2Fingers: if (On_LongTap2Fingers!=null) On_LongTap2Fingers(gesture); break; case EventName.On_LongTapEnd2Fingers: if (On_LongTapEnd2Fingers!=null) On_LongTapEnd2Fingers(gesture); break; case EventName.On_Twist: if (On_Twist!=null) On_Twist(gesture); break; case EventName.On_TwistEnd: if (On_TwistEnd!=null) On_TwistEnd(gesture); break; case EventName.On_PinchIn: if (On_PinchIn!=null) On_PinchIn(gesture); break; case EventName.On_PinchOut: if (On_PinchOut!=null) On_PinchOut(gesture); break; case EventName.On_PinchEnd: if (On_PinchEnd!=null) On_PinchEnd(gesture); break; case EventName.On_DragStart2Fingers: if (On_DragStart2Fingers!=null) On_DragStart2Fingers(gesture); break; case EventName.On_Drag2Fingers: if (On_Drag2Fingers!=null) On_Drag2Fingers(gesture); break; case EventName.On_DragEnd2Fingers: if (On_DragEnd2Fingers!=null) On_DragEnd2Fingers(gesture); break; case EventName.On_SwipeStart2Fingers: if (On_SwipeStart2Fingers!=null) On_SwipeStart2Fingers(gesture); break; case EventName.On_Swipe2Fingers: if (On_Swipe2Fingers!=null) On_Swipe2Fingers(gesture); break; case EventName.On_SwipeEnd2Fingers: if (On_SwipeEnd2Fingers!=null) On_SwipeEnd2Fingers(gesture); break; } }
private void CreateGesture(int touchIndex,EventName message,Finger finger,float actionTime, SwipeType swipe, float swipeLength, Vector2 swipeVector) { if (message == EventName.On_TouchStart || message == EventName.On_TouchUp){ isStartHoverNGUI = IsTouchHoverNGui(touchIndex); } //if (message == EventName.On_Cancel || message == EventName.On_TouchUp){ // isStartHoverNGUI = false; //} if (!isStartHoverNGUI){ //Creating the structure with the required information Gesture gesture = new Gesture(); gesture.fingerIndex = finger.fingerIndex; gesture.touchCount = finger.touchCount; gesture.startPosition = finger.startPosition; gesture.position = finger.position; gesture.deltaPosition = finger.deltaPosition; gesture.actionTime = actionTime; gesture.deltaTime = finger.deltaTime; gesture.swipe = swipe; gesture.swipeLength = swipeLength; gesture.swipeVector = swipeVector; gesture.deltaPinch = 0; gesture.twistAngle = 0; gesture.pickObject = finger.pickedObject; gesture.otherReceiver = receiverObject; gesture.isHoverReservedArea = IsTouchReservedArea( touchIndex); gesture.pickCamera = finger.pickedCamera; gesture.isGuiCamera = finger.isGuiCamera; gesture.hitPoint = finger.hitPoint; //zs if (useBroadcastMessage){ SendGesture(message,gesture); } if (!useBroadcastMessage || isExtension){ RaiseEvent(message, gesture); } } }
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); } }
public override void RunEventSchedule( EventName objEventName ) { if( Enabled ) { Scheduler.CoreScheduler s = new Scheduler.CoreScheduler( Debug, MaxThreads ); Scheduler.CoreScheduler.RunEventSchedule( objEventName ); } }
public void GKAddMessage(EventName name, string description) { if (IsGKAsAService) { } else { GKProcessorManager.AddGKMessage(name, description, null, FiresecManager.CurrentUser.Name, true); } }
public abstract void RunEventSchedule(EventName eventName);
public static void AddGKMessage(EventName message, EventDescription description, XBase xBase, string userName, bool isAdministrator = false) { AddGKMessage(message, description.ToDescription(), xBase, userName, isAdministrator); }