Пример #1
0
        public void DownloadSync()
        {
            SyncDialog dialog = new SyncDialog(new SyncInfo(Resources.FeedbackDirectory, "Feedback/", SyncJobType.DownloadFeedback));
            dialog.ShowDialog();

            FileHandler.SortFiles();
        }
Пример #2
0
 public void UploadSyncExit()
 {
     if (_deletedFiles.Count > 0)
     {
         DialogResult result =
             MessageBox.Show(@"Would you like to synchronise your deleted feedback with the server before exiting?",
                             @"Confirm", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button3);
         if (result == DialogResult.Yes)
         {
             SyncDialog dialog = new SyncDialog(new SyncInfo(Resources.FeedbackDirectory, "Feedback/", SyncJobType.DeleteFeedback));
             dialog.ShowDialog();
         }
     }
 }
Пример #3
0
 /// <summary>
 /// Initialises an FTP uploader to synchronise the remote server directory with the local working folder.
 /// </summary>
 private void toolStripSync_Click(object sender, EventArgs e)
 {
     LogGenerator.CreateContentLog();
     var ftpDialog = new SyncDialog(new SyncInfo(Resources.ContentDirectory, "Content/", SyncJobType.Upload));
     ftpDialog.ShowDialog();
 }
Пример #4
0
 /// <summary>
 /// Called when the main window is first shown.
 /// 
 /// Creates an FTP downloader to sync the working directory with the webserver. Also initialises
 /// files in the listview.
 /// </summary>
 private void MainWindow_Shown(object sender, EventArgs e)
 {
     if (_hasConnection)
     {
         var ftpDialog = new SyncDialog(new SyncInfo(Resources.ContentDirectory, "Content/", SyncJobType.Download));
         ftpDialog.ShowDialog();
     }
     _controller.InitialiseListView();
 }
Пример #5
0
        /// <summary>
        /// Called when the form is closing.
        /// 
        /// Prompts the user for synchronisation. Creates an FTP uploader to sync the webserver with the working directory.
        /// </summary>
        private void MainWindow_FormClosing(object sender, FormClosingEventArgs e)
        {
            string uri;
            _hasConnection = ConnectionExists(out uri);
            if (!_hasConnection)
            {
                MessageBox.Show(string.Format("Could not connect to {0}", uri), "Error");
                return;
            }
            // Promp user.
            DialogResult result =
                MessageBox.Show(
                    @"Would you like to synchronise your content with the distribution server before exiting?",
                    @"Confirm", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question, MessageBoxDefaultButton.Button3);

            // Sync at user behest.
            if (result == DialogResult.Yes)
            {
                LogGenerator.CreateContentLog();
                var ftpDialog = new SyncDialog(new SyncInfo(Resources.ContentDirectory, "Content/", SyncJobType.Upload));
                ftpDialog.ShowDialog();
            }

            // Cancel if this was all a horrible mistake.
            if (result == DialogResult.Cancel)
                e.Cancel = true;
        }
Пример #6
0
 /// <summary>
 /// Opens a sync dialog to download necessary files.
 /// </summary>
 public void DownloadSync()
 {
     SyncDialog dialog = new SyncDialog(new SyncInfo(Resources.GameDirectory, "Game/", SyncJobType.Download));
     dialog.ShowDialog();
 }
Пример #7
0
        /// <summary>
        /// Opens a sync dialog to upload necessary files.
        /// </summary>
        public void UploadSync()
        {
            LogGenerator.CreateGameLog();

            SyncDialog dialog = new SyncDialog(new SyncInfo(Resources.GameDirectory, "Game/", SyncJobType.Upload));
            dialog.ShowDialog();
        }