示例#1
0
        async private void PublishRequest_Click(object sender, RoutedEventArgs e)
        {
            if (!CheckConnections())
            {
                return;
            }
            if (!receivedDirectories)
            {
                receivedDirectories = false;
                StatusText          = "Requesting server's directory list...";
                AppendLogger(StatusText);
                shim.PostMessage(HttpMessageBuilder.GetDirectoriesMessage(ServerFullAddress, ThisFullAddress));
                while (!receivedDirectories)
                {
                    await Task.Delay(100);
                }
                StatusText = "Received server's directory list";
                AppendLogger(StatusText);
            }
            PublishRequest pReq = new PublishRequest(serverDirectories);

            if (pReq.ShowDialog().Value)
            {
                shim.PostMessage(HttpMessageBuilder.PublishRequestMessage(ServerFullAddress, ThisFullAddress,
                                                                          pReq.PublishDirectory, pReq.IISPublishCheck, pReq.AutoDownloadCheck));
            }
        }
示例#2
0
        private void AllFiles_DeleteS_Click(object sender, RoutedEventArgs e)
        {
            if (lstAllFiles.SelectedIndex == -1)
            {
                return;
            }
            foreach (var item in lstAllFiles.SelectedItems)
            {
                string filename = item.ToString();

                AppendLogger("Sending delete file (" + filename + ") request to " + ServerFullAddress);
                shim.PostMessage(HttpMessageBuilder.DeleteFileRequestMessage(ServerFullAddress,
                                                                             ThisFullAddress, filename));
                lstAllFiles.Items.RemoveAt(lstAllFiles.SelectedIndex);

                for (int i = 0; i < lstFiles.Items.Count; ++i)
                {
                    if (lstFiles.Items[i].ToString() == filename)
                    {
                        lstFiles.Items.RemoveAt(i);
                        break;
                    }
                }
            }
        }
示例#3
0
        private void GetFileList_Click(object sender, RoutedEventArgs e)
        {
            if (!CheckConnections())
            {
                return;
            }

            if (lstCategories.HasItems && lstCategories.SelectedIndex != -1)
            {
                AppendLogger("Sending Message (Type: GetFileList) to " + ServerFullAddress);
                shim.PostMessage(HttpMessageBuilder.FileListRequestMessage(ServerFullAddress, ThisFullAddress, (string)lstCategories.SelectedItem));
            }
            else if (lstCategories.HasItems)
            {
                MessageBox.Show("Please select category before attempting to get files list",
                                "No Category Selected", MessageBoxButton.OK, MessageBoxImage.Hand);
            }
            else
            {
                if (MessageBox.Show("Category list is empty. Would you like to get category list from Remote Publisher?",
                                    "Empty Category List", MessageBoxButton.YesNo, MessageBoxImage.Question, MessageBoxResult.Yes) == MessageBoxResult.Yes)
                {
                    GetCategories_Click(this, new RoutedEventArgs());
                }
            }
        }
示例#4
0
 private void GetPublishedWebpages_Click(object sender, RoutedEventArgs e)
 {
     if (!CheckConnections())
     {
         return;
     }
     shim.PostMessage(HttpMessageBuilder.GetPublishedMessage(ServerFullAddress, ThisFullAddress));
 }
示例#5
0
 private void GetAllFiles_Click(object sender, RoutedEventArgs e)
 {
     if (!CheckConnections())
     {
         return;
     }
     AppendLogger("Sending Message (Type: GetAllFiles) to " + ServerFullAddress);
     shim.PostMessage(HttpMessageBuilder.AllFilesRequestMessage(ServerFullAddress, ThisFullAddress));
 }
示例#6
0
        private void Files_DownloadS_Click(object sender, RoutedEventArgs e)
        {
            if (lstFiles.SelectedIndex == -1)
            {
                return;
            }
            string filename = lstFiles.Items.GetItemAt(lstFiles.SelectedIndex).ToString();

            AppendLogger("Sending download file (" + filename + ") request to " + ServerFullAddress);
            shim.PostMessage(HttpMessageBuilder.GetFileRequestMessage(ServerFullAddress,
                                                                      ThisFullAddress, filename));
        }
示例#7
0
        private void SendFiles_Click(object sender, RoutedEventArgs e)
        {
            if (!CheckConnections())
            {
                return;
            }
            var selectedFiles = lstLocalFiles.SelectedItems;

            new Thread(() => {
                foreach (var file in selectedFiles)
                {
                    AppendLogger("Sending file \"" + file.ToString() + "\" to " + ServerFullAddress);
                    shim.PostMessage(HttpMessageBuilder.SendFileMessage(ServerFullAddress, ThisFullAddress, file.ToString()));
                }
                Dispatcher.Invoke(new Action(() => { lstLocalFiles.SelectedItems.Clear(); }));
            }).Start();
        }