当前位置: 首页>>代码示例>>C#>>正文


C# SaveFileDialog.GetType方法代码示例

本文整理汇总了C#中System.Windows.Controls.SaveFileDialog.GetType方法的典型用法代码示例。如果您正苦于以下问题:C# SaveFileDialog.GetType方法的具体用法?C# SaveFileDialog.GetType怎么用?C# SaveFileDialog.GetType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Windows.Controls.SaveFileDialog的用法示例。


在下文中一共展示了SaveFileDialog.GetType方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: OnDownloadCommand

        private void OnDownloadCommand()
        {
            saveFileDialog = new SaveFileDialog();
            saveFileDialog.Filter = "All Files|*.*";
            saveFileDialog.GetType().GetMethod("set_DefaultFileName").Invoke(saveFileDialog, new object[] { this.FileName });

            bool? dialogResult = saveFileDialog.ShowDialog();
            if (dialogResult != true) return;

            WebClient client = new WebClient();
            Uri uri = new Uri(FileUrl, UriKind.RelativeOrAbsolute);
            client.OpenReadCompleted += new OpenReadCompletedEventHandler(OpenReadCompleted);
            client.DownloadProgressChanged += new DownloadProgressChangedEventHandler(DownloadProgressChanged);
            client.OpenReadAsync(uri);
            DownLoading = Visibility.Visible;
        }
开发者ID:YHTechnology,项目名称:ProjectManager,代码行数:16,代码来源:PlanOutlineFileEntity.cs

示例2: OnDownloadCommand

 private void OnDownloadCommand()
 {
     //MessageBox.Show(FileUrl);
     if (FileUrl == null)
     {
         string manufactureNumberTemp = manufactureNumber.TrimEnd();
         string rmanufactureNumberTemp = "";
         if (!String.IsNullOrEmpty(rmanufactureNumber))
         {
             rmanufactureNumberTemp = rmanufactureNumber.TrimEnd();
         }
         FileUrl = (CustomUri.GetAbsoluteUrl(String.IsNullOrEmpty(rmanufactureNumber) ? manufactureNumberTemp : rmanufactureNumberTemp) + "/" + fileName);
         //FileUrl = (CustomUri.GetAbsoluteUrl(String.IsNullOrEmpty(rmanufactureNumber) ? manufactureNumber.TrimEnd() : rmanufactureNumber.TrimEnd()) + "/" + fileName);
     }
     //MessageBox.Show(FileUrl);
     try
     {
         saveFileDialog = new SaveFileDialog();
         saveFileDialog.Filter = "All Files|*.*";
         saveFileDialog.GetType().GetMethod("set_DefaultFileName").Invoke(saveFileDialog, new object[] { this.FileName });
         //MessageBox.Show("3");
         bool? dialogResult = saveFileDialog.ShowDialog();
         if (dialogResult != true) return;
         //MessageBox.Show("4");
         WebClient client = new WebClient();
         Uri uri = new Uri(FileUrl, UriKind.RelativeOrAbsolute);
         client.OpenReadCompleted += new OpenReadCompletedEventHandler(OpenReadCompleted);
         client.DownloadProgressChanged += new DownloadProgressChangedEventHandler(DownloadProgressChanged);
         client.OpenReadAsync(uri);
         DownLoading = Visibility.Visible;
     }
     catch (System.Exception ex)
     {
         //MessageBox.Show(ex.Message);
         MessageBox.Show(ex.StackTrace);
     }
 }
开发者ID:YHTechnology,项目名称:ProjectManager,代码行数:37,代码来源:ProjectFilesEntity.cs

示例3: OnDownloadTempCommand

        private void OnDownloadTempCommand()
        {
            String FileUrl = CustomUri.GetAbsoluteUrl("ProductmanagerFileTemp/产品导入模版.xls");

            try
            {
                saveFileDialog = new SaveFileDialog();
                saveFileDialog.Filter = "All Files|*.*";
                saveFileDialog.GetType().GetMethod("set_DefaultFileName").Invoke(saveFileDialog, new object[] { "产品导入模版.xls" });
                bool? dialogResult = saveFileDialog.ShowDialog();
                if (dialogResult != true) return;
                WebClient client = new WebClient();
                Uri uri = new Uri(FileUrl, UriKind.RelativeOrAbsolute);
                client.OpenReadCompleted += new OpenReadCompletedEventHandler(OpenReadCompleted);
                client.OpenReadAsync(uri);
            }
            catch (System.Exception ex)
            {
                NotifyWindow notifyWindow = new NotifyWindow("下载错误", ex.Message);
                notifyWindow.Show();
            }
        }
开发者ID:YHTechnology,项目名称:ProjectManager,代码行数:22,代码来源:ImportProductWindowViewModel.cs

示例4: onOpenDownloadTempFile

        private void onOpenDownloadTempFile()
        {
            /*DownloadTempFiles donwLoadTempFiles = new DownloadTempFiles();
            donwLoadTempFiles.Show();*/

            TempSaveFileDialog = new SaveFileDialog();
            TempSaveFileDialog.GetType().GetMethod("set_DefaultFileName").Invoke(TempSaveFileDialog, new object[] { "专票申请表模板.xls" });

            bool? saveResult = TempSaveFileDialog.ShowDialog();

            if (saveResult.HasValue)
            {
                if (saveResult.Value == true)
                {
                    string appstr = System.Windows.Application.Current.Host.Source.AbsoluteUri;

                    WebClient client = new WebClient();
                    Uri uri = new Uri(getAbsPath("TempFiles/申报表_模板.xls"), UriKind.RelativeOrAbsolute);

                    client.OpenReadCompleted += client_OpenReadCompleted;
                    client.OpenReadAsync(uri);
                }
            }
        }
开发者ID:YHTechnology,项目名称:DocumentManager,代码行数:24,代码来源:StandBookZPViewModel.cs

示例5: onDownload

        private void onDownload()
        {
            if (fileUrl == null)
            {
                if (TaxPayerIsLink.GetValueOrDefault(false))
                {
                    fileUrl = (CustomUri.GetAbsoluteUrl("upload/" + TaxPayerLinkId.Value) + "/" + TaxPayerDocumentName);
                }
                else
                {
                    fileUrl = (CustomUri.GetAbsoluteUrl("upload/" + TaxPayerId.Value) + "/" + TaxPayerDocumentName);
                }
            }

            try
            {
                saveFileDialog = new SaveFileDialog();
                saveFileDialog.Filter = "All Files|*.*";
                saveFileDialog.GetType().GetMethod("set_DefaultFileName").Invoke(saveFileDialog, new object[] { TaxPayerDocumentName });
                bool? dialogResult = saveFileDialog.ShowDialog();
                if (dialogResult != true) return;
                WebClient client = new WebClient();
                Uri uri = new Uri(fileUrl, UriKind.RelativeOrAbsolute);
                client.OpenReadCompleted += new OpenReadCompletedEventHandler(OpenReadCompleted);
                client.DownloadProgressChanged += new DownloadProgressChangedEventHandler(DownloadProgressChanged);
                client.OpenReadAsync(uri);
                DownLoading = Visibility.Visible;
            }
            catch (System.Exception ex)
            {
                MessageBox.Show(ex.StackTrace);
            }
        }
开发者ID:YHTechnology,项目名称:DocumentManager,代码行数:33,代码来源:TaxPayerDocumentEntity.cs

示例6: SaveFileTolocal

        private void SaveFileTolocal()
        {
            if (SelectedTempFileEntity == null)
            {
                return;
            }

            m_SaveFileDialog = new SaveFileDialog();
            m_SaveFileDialog.GetType().GetMethod("set_DefaultFileName").Invoke(m_SaveFileDialog, new object[] { SelectedTempFileEntity.DefaultFileName });

            bool? saveResult = m_SaveFileDialog.ShowDialog();

            if (saveResult == null)
            {
                return;
            }

            if (saveResult == false)
            {
                return;
            }

            string appstr = System.Windows.Application.Current.Host.Source.AbsoluteUri;

            WebClient client = new WebClient();
            Uri uri = new Uri(getAbsPath(SelectedTempFileEntity.FileServerPath), UriKind.RelativeOrAbsolute);

            client.OpenReadCompleted += client_OpenReadCompleted;
            client.OpenReadAsync(uri);
        }
开发者ID:YHTechnology,项目名称:DocumentManager,代码行数:30,代码来源:DownLoadTemplateViewModel.cs


注:本文中的System.Windows.Controls.SaveFileDialog.GetType方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。