Exemplo n.º 1
0
        public async Task RenameAsync(string newName)
        {
            var newFile = new SmbFile(_file.GetParent());
            await _file.RenameToAsync(newFile);

            if (_file.Exists())
            {
                throw new Exception("Файл не переименован.");
            }

            if (!newFile.Exists())
            {
                throw new Exception("Файл не переименован.");
            }

            _file = newFile;
        }