Esempio n. 1
0
        public string ToJson()
        {
            var jsonDic = new Dictionary <string, object>
            {
                { "Subject", Subject },
                { "Text", Text },
                { "MediaAttachment", _mediaAttachment == null ? "" : _mediaAttachment.ToJson() }
            };

            return(GSJson.Serialize(jsonDic));
        }
Esempio n. 2
0
        public string ToJson()
        {
            var json = new Dictionary <string, object>
            {
                { "Text", _text },
                { "ButtonTitle", _buttonTitle },
                { "ButtonAction", _buttonAction },
                { "Action", _action == null ? "" : _action.ToJson() },
                { "MediaAttachment", _mediaAttachment == null ? "" : _mediaAttachment.ToJson() }
            };

            return(GSJson.Serialize(json));
        }
        public string ToJson()
        {
            var json = new Dictionary <string, object>
            {
                { "Title", _title },
                { "Text", _text },
                { "Action", _action == null ? "" : _action.ToJson() },
                { "Template", _templateName },
                { "TemplatePlaceholders", _templatePlaceholders },
                { "MediaAttachment", _mediaAttachment == null ? "" : _mediaAttachment.ToJson() },
                { "ActionButtons", _actionButtons.ConvertAll(item => item.ToJson()) },
                { "Customization", _customization == null ? "" : _customization.ToJson() },
                { "Badge", _badge == null ? "" : _badge.ToJson() }
            };

            return(GSJson.Serialize(json));
        }