Пример #1
0
        private string GetTableText(string address)
        {
            var content = MultiTypeResponse.GetContent(address);

            switch (content)
            {
            case Content.Triggers:
                return(base.GetResponseText(ref address));

            case Content.Channels:
                return(new ChannelResponse(channels).GetResponseText(ref address));

            case Content.Notifications:
                return(new NotificationActionResponse(new NotificationActionItem("301"), new NotificationActionItem("302")).GetResponseText(ref address));

            default:
                throw new NotImplementedException($"Unknown content '{content}' requested from {nameof(NotificationTriggerResponse)}");
            }
        }
Пример #2
0
        public override string GetResponseText(ref string address)
        {
            var function = MultiTypeResponse.GetFunction(address);

            switch (function)
            {
            case nameof(XmlFunction.TableData):
                return(GetTableText(address));

            case nameof(HtmlFunction.ChannelEdit):
                return(new ChannelResponse(channels).GetResponseText(ref address));

            case nameof(HtmlFunction.EditNotification):
                return(new NotificationActionResponse(new NotificationActionItem()).GetResponseText(ref address));

            default:
                throw new NotImplementedException($"Unknown function '{function}' passed to {nameof(NotificationTriggerResponse)}");
            }
        }