You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
58 lines
1.8 KiB
58 lines
1.8 KiB
using System; |
|
using System.IO; |
|
using System.Windows; |
|
|
|
namespace Kingo.Plugin.MapView.Views.FeatureAttribute |
|
{ |
|
/// <summary> |
|
/// UCShowFile.xaml 的交互逻辑 |
|
/// </summary> |
|
public partial class UCShowFile : KGIS.Framework.Utils.BaseWindow |
|
{ |
|
public UCShowFile() |
|
{ |
|
InitializeComponent(); |
|
this.Closed += UCShowFile_Closed; |
|
} |
|
|
|
private void UCShowFile_Closed(object sender, EventArgs e) |
|
{ |
|
//try |
|
//{ |
|
// pdfViewer.clo |
|
//} |
|
//catch (Exception) |
|
//{ |
|
//} |
|
} |
|
|
|
public void BindData(string filePath, string extension) |
|
{ |
|
try |
|
{ |
|
switch (extension) |
|
{ |
|
case ".xps": |
|
//Viewer.Visibility = Visibility.Visible; |
|
//pdfViewer.Visibility = Visibility.Collapsed; |
|
//Viewer.Document = new System.Windows.Xps.Packaging.XpsDocument(filePath, FileAccess.Read).GetFixedDocumentSequence(); |
|
//Viewer.FitToWidth(); |
|
break; |
|
case ".pdf": |
|
pdfViewer.OpenDocument(filePath); |
|
pdfViewer.Language = System.Windows.Markup.XmlLanguage.GetLanguage("zh-Hans"); |
|
Viewer.Visibility = Visibility.Collapsed; |
|
pdfViewer.Visibility = Visibility.Visible; |
|
break; |
|
default: |
|
throw new Exception(extension + "扩展文件不支持查看!"); |
|
} |
|
KGIS.Framework.Platform.Helper.ProgressHelper.CloseProcessBar(); |
|
} |
|
catch (Exception ex) |
|
{ |
|
throw ex; |
|
} |
|
} |
|
} |
|
}
|
|
|