コード例 #1
0
        internal void Collab_click(object sender, RoutedEventArgs e)
        {
            Button b = (Button)sender;

            BackendConnect.Get_messages_class file = (BackendConnect.Get_messages_class)b.Tag;

            Collabspace collabspace_page = new Collabspace(current_User.Chat_id, file.Id);

            collabspace_page.Show();
        }
コード例 #2
0
        /// <summary>
        /// The Download_click
        /// </summary>
        /// <param name="sender">The sender<see cref="object"/></param>
        /// <param name="e">The e<see cref="RoutedEventArgs"/></param>
        internal void Download_click(object sender, RoutedEventArgs e)
        {
            Button b = (Button)sender;

            BackendConnect.Get_messages_class file = (BackendConnect.Get_messages_class)b.Tag;

            SaveFileDialog dialog = new SaveFileDialog()
            {
                Filter   = "All(*.*)|*",
                FileName = file.File_name
            };

            if (dialog.ShowDialog() == true)
            {
                WebClient Client = new WebClient();
                var       Source = BackendConnect.server + "file/" + current_User.Chat_id + '/' + file.File_id;;
                Client.DownloadFile(Source, dialog.FileName);
            }
        }