本文整理汇总了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;
}
示例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);
}
}
示例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();
}
}
示例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);
}
}
}
示例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);
}
}
示例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);
}