Esempio n. 1
0
        public void SaveFile(string fileName = null, Encoding enc = null)
        {
            var buffer = GetActiveBuffer();

            if (buffer == null)
            {
                return;
            }

            var fi = default(FileInfo);

            if (fileName != null)
            {
                if (!FileUtil.TryGetInfo(fileName, buffer, out fi))
                {
                    return;
                }
            }
            else
            {
                fi = buffer.File;
            }

            OpenFolder(ViewManager.ActiveView, fi.Directory);
            bufferManager.SaveBuffer(buffer, fi, enc ?? buffer.Encoding);
        }