/// <summary>
        /// Calls <see cref="ClientInterestArea.OnItemUnsubscribed">ClientInterestArea.OnItemUnsubscribed</see> and sends event <see cref="ItemUnsubscribed"/> to the client.
        /// </summary>
        /// <param name="item">
        /// The mmo item.
        /// </param>
        protected override void OnItemUnsubscribed(Item item)
        {
            base.OnItemUnsubscribed(item);

            var unsubscribeEvent = new ItemUnsubscribed { ItemId = item.Id, ItemType = item.Type, InterestAreaId = this.Id };
            var eventData = new EventData((byte)EventCode.ItemUnsubscribed, unsubscribeEvent);
            this.Peer.SendEvent(eventData, new SendParameters { ChannelId = Settings.ItemEventChannel });
        }
예제 #2
0
        public void AddEvent()
        {
            var connectionString = "Endpoint=sb://socialboards.servicebus.windows.net/;SharedAccessKeyName=Sender;SharedAccessKey=742kzJxgwFmy9xh8MIfVQeiqapiXqKh9GEXcR6Pm3NI=";

            var client = EventHubClient.CreateFromConnectionString(connectionString,"filtered");

            var message = new Message
            {
                ResponseInMinutes = Random.Next(0, 45),
                Tenant = "DnB"
            };
            var json = _serializer.ToJson(message, SerializationOptions);
            var body = Encoding.UTF8.GetBytes(json);
            var eventData = new EventData(body);
            client.Send(eventData);
        }
        /// <summary>
        /// Calls <see cref="ClientInterestArea.OnItemSubscribed">ClientInterestArea.OnItemSubscribed</see> and sends event <see cref="ItemSubscribed"/> to the client.
        /// </summary>
        /// <param name="snapshot">
        /// The item snapshot.
        /// </param>
        protected override void OnItemSubscribed(ItemSnapshot snapshot)
        {
            base.OnItemSubscribed(snapshot);

            var mmoSnapshot = (MmoItemSnapshot)snapshot;
            var item = snapshot.Source;

            var subscribeEvent = new ItemSubscribed
                {
                    ItemId = item.Id,
                    ItemType = item.Type,
                    Position = mmoSnapshot.Coordinate,
                    PropertiesRevision = snapshot.PropertiesRevision,
                    InterestAreaId = this.Id,
                    Rotation = mmoSnapshot.Rotation
                };

            var eventData = new EventData((byte)EventCode.ItemSubscribed, subscribeEvent);
            this.Peer.SendEvent(eventData, new SendParameters { ChannelId = Settings.ItemEventChannel });
        }
        /// <summary>
        /// Calls <see cref="ClientInterestArea.OnItemSubscribed">ClientInterestArea.OnItemSubscribed</see> and sends event <see cref="ItemSubscribed"/> to the client.
        /// </summary>
        /// <param name="snapshot">
        /// The item snapshot.
        /// </param>
        protected override void OnItemSubscribed(ItemSnapshot snapshot)
        {
            base.OnItemSubscribed(snapshot);

            var mmoSnapshot = (MmoItemSnapshot)snapshot;
            var item = snapshot.Source;

            var subscribeEvent = new ItemSubscribed
                {
                    ItemId = item.Id,
                    ItemType = item.Type,
                    Position = mmoSnapshot.Coordinate,
                    PropertiesRevision = snapshot.PropertiesRevision,
                    InterestAreaId = this.Id,
                    Rotation = mmoSnapshot.Rotation

                };

            #region PopBloop

            var mmoItem = (MmoItem)item;

            if (mmoItem != null)
            {
                subscribeEvent.AvatarName = mmoItem.AvatarName;
                subscribeEvent.Animation = mmoItem.Animation;
                subscribeEvent.AnimationSpeed = mmoItem.AnimationSpeed;
                subscribeEvent.AnimationWrap = mmoItem.AnimationWrap;
            }
            else
            {
                subscribeEvent.AvatarName = "Unknown";
            }

            #endregion

            var eventData = new EventData((byte)EventCode.ItemSubscribed, subscribeEvent);
            this.Peer.SendEvent(eventData, new SendParameters { ChannelId = Settings.ItemEventChannel });
        }
        private void OnSubmit(object obj)
        {
            var module1EventData = new EventData("Module1",new EventData(CaseID));

            eventAggregator.GetEvent<SubmitButtonEvent>().Publish(module1EventData);
        }
        private void OnSubmit(object obj)
        {
            var eventData = new EventData("Module2");

            eventAggregator.GetEvent<Module2ButtonPressed>().Publish(eventData);
        }
예제 #7
0
        /********************************************* Private *********************************************/
        // check if event is to be ignored
        private bool IsEventToIgnore(EventData evt)
        {
            foreach (IgnoreEvent ie in EventsToIgnore)
            {
                string logEvent = ie.LogEvent == string.Empty ? ie.LogEvent : evt.LogEvent;
                string logSubEvent = ie.LogSubEvent == string.Empty ? ie.LogSubEvent : evt.LogSubEvent;
                string logMessage = ie.LogMessage == string.Empty ? ie.LogMessage : evt.LogMessage;
                string processedLogMessage = ie.LogMessage == string.Empty ? ie.LogMessage : evt.Name;

                // if not equal leave.
                if (logEvent != ie.LogEvent) continue;

                // if not equal leave.
                if (logSubEvent != ie.LogSubEvent) continue;

                if ( logMessage.Contains(ie.LogMessage) || processedLogMessage.Contains(ie.LogMessage))
                    return true;
            }

            return false;
        }