Пример #1
0
        /// <summary>
        /// Save a file and set text of json editor
        /// </summary>
        /// <param name="editor"></param>
        public static void SaveFile(this ICodeEditor editor, string lastFile)
        {
            var content = editor.JsonContent;

            if (!string.IsNullOrWhiteSpace(content))
            {
                if (!string.IsNullOrWhiteSpace(editor.CurrentFileName))
                {
                    WriteFile(editor.CurrentFileName, content);
                }
                else
                {
                    editor.SaveAsFile(lastFile);
                }
            }

            return;
        }