Exemplo n.º 1
0
        private void CopiesFile(SimpleFile file, ConnectionInfo inf)
        {
            string path = Directory.GetCurrentDirectory() + @"\Dir";

            DirectoryInfo info = Directory.CreateDirectory(path);

            info.Attributes = info.Attributes & ~FileAttributes.ReadOnly;
            try
            {
                var fi = file.CopyToPath(path);

                if (Copied(path, fi.FullPath) && !Deleted())
                {
                    condition = true;
                }

                fi.Delete();
                fi.Dispose();
                file.Delete();
            }
            finally
            {
                Directory.Delete(path, true);
            }
        }
Exemplo n.º 2
0
        private void DeletesFile(SimpleFile file, ConnectionInfo inf)
        {
            file.Delete();

            if (Deleted())
            {
                condition = true;
            }
        }
Exemplo n.º 3
0
        private void CopiesAndOverwries(SimpleFile file, ConnectionInfo inf)
        {
            string path = Directory.GetCurrentDirectory() + @"\Dir";

            Directory.CreateDirectory(path);
            file.CopyToPath(path, OverwriteFile: true).Dispose();
            var fi = file.CopyToPath(path, OverwriteFile: true);

            if (Copied(path, fi.FullPath) && !Deleted())
            {
                condition = true;
            }

            fi.Delete();
            fi.Dispose();
            file.Delete();

            Directory.Delete(path, true);
        }
Exemplo n.º 4
0
 private void ServerFileRecieve(SimpleFile file, ConnectionInfo inf)
 {
     files++;
     file.Delete();
 }
Exemplo n.º 5
0
 private void ClientFileReceive(SimpleFile file)
 {
     files++;
     file.Delete();
 }