using KGIS.Framework.Utils; using KGIS.Framework.Utils.Helper; using System; using System.IO; using System.Windows; using System.Windows.Xps.Packaging; namespace Kingo.Plugin.General.View { /// /// FrmHelper.xaml 的交互逻辑 /// public partial class FrmHelper : BaseWindow { public FrmHelper() { InitializeComponent(); } private void Window_Loaded(object sender, RoutedEventArgs e) { try { string wyzsDocumentPath = string.Empty; //switch (KGIS.Framework.Platform.Platform.Instance.SystemType) //{ // case SystemTypeEnum.YCLJK: // wyzsDocumentPath = System.IO.Path.Combine(System.Windows.Forms.Application.StartupPath, "工作空间DTBJK", "初始化工程模板", "帮助", "县级单图斑建库系统操作手册.xps"); // break; // case SystemTypeEnum.DTBJK: // wyzsDocumentPath = System.IO.Path.Combine(System.Windows.Forms.Application.StartupPath, "工作空间DTBJK", "初始化工程模板", "帮助", "县级单图斑建库系统操作手册.xps"); // break; // case SystemTypeEnum.WYZS: // wyzsDocumentPath = System.IO.Path.Combine(System.Windows.Forms.Application.StartupPath, "工作空间DTBJK", "初始化工程模板", "帮助", "县级单图斑建库系统操作手册.xps"); // break; //} wyzsDocumentPath = System.IO.Path.Combine(System.Windows.Forms.Application.StartupPath, "工作空间DTBJK", "初始化工程模板", "帮助", "县级单图斑建库系统操作手册.xps"); if (!File.Exists(wyzsDocumentPath)) { MessageHelper.Show("没有找到使用手册:" + wyzsDocumentPath); return; } bgzsdocViewer.Document = new XpsDocument(wyzsDocumentPath, FileAccess.Read).GetFixedDocumentSequence(); bgzsdocViewer.FitToWidth(); } catch (Exception ex) { LogAPI.Debug("文档读取失败:" + ex.Message); MessageHelper.ShowTips("初始化帮助文档失败!"); } } } }