Esempio n. 1
0
        private void CopyToClipboard(JsonPostsRepositoryService.CopyMode copyMode)
        {
            string text = string.Empty;

            switch (copyMode)
            {
            case JsonPostsRepositoryService.CopyMode.JSON:
                text = _service.ParseModelData(ViewObjectToModelConverter.Convert(_selectedJsonPlaceHolder),
                                               JsonPostsRepositoryService.CopyMode.JSON);
                break;

            case JsonPostsRepositoryService.CopyMode.HTML:
                text = _service.ParseModelData(ViewObjectToModelConverter.Convert(_selectedJsonPlaceHolder),
                                               JsonPostsRepositoryService.CopyMode.HTML);
                break;

            default:
                text = _service.ParseModelData(ViewObjectToModelConverter.Convert(_selectedJsonPlaceHolder),
                                               JsonPostsRepositoryService.CopyMode.TEXT);
                break;
            }

            if (!string.IsNullOrWhiteSpace(text))
            {
                Clipboard.SetText(text);
            }
        }
Esempio n. 2
0
 /// <summary>
 /// Display content of the post in HTML, JSON, PlainText
 /// </summary>
 private void RenderPostContentFormat()
 {
     PostContent = _service.ParseModelData(ViewObjectToModelConverter.Convert(_selectedJsonPlaceHolder),
                                           CopyModeConverter.Convert(_copyMode));
 }