Пример #1
0
        protected void SendEvent(string eventName, string data)
        {
            switch (eventName)
            {
            case "update":
                var status = JsonConvert.DeserializeObject <Status>(data);
                OnUpdate?.Invoke(this, new StreamUpdateEventArgs(status));
                break;

            case "notification":
                var notification = JsonConvert.DeserializeObject <Notification>(data);
                OnNotification?.Invoke(this, new StreamNotificationEventArgs(notification));
                break;

            case "delete":
                var statusId = (data);
                OnDelete?.Invoke(this, new StreamDeleteEventArgs(statusId));
                break;

            case "filters_changed":
                OnFiltersChanged?.Invoke(this, new StreamFiltersChangedEventArgs());
                break;

            case "conversation":
                var conversation = JsonConvert.DeserializeObject <Conversation>(data);
                OnConversation?.Invoke(this, new StreamConversationEvenTargs(conversation));
                break;
            }
        }
Пример #2
0
 public void Talk(Character character, List <Conversation> conversations)
 {
     OnConversation?.Invoke(this, character, conversations);
 }