예제 #1
0
        private void btnDeleteFile_Click(object sender, EventArgs e)
        {
            if (lvFiles.SelectedItems.Count == 0)
            {
                return;
            }

            string fileName = lvFiles.SelectedItems[0].Text;

            CryptoServiceClient cloudProxy = new CryptoServiceClient();

            bool deleteSuccessfull = cloudProxy.DeleteFile(fileName);

            if (deleteSuccessfull)
            {
                MessageBox.Show("File successfully deleted.", "Delete successfull", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                MessageBox.Show("Error while deleting file.", "Delete error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }

            cloudProxy.Close();

            showCloudFiles();
        }