public void ToggleFullscreen() { if (ActivationWindow.CheckLicense() == false) { return; } if (!IsFullscreen) { Fullscreen(); } else { ExitFullscreen(); } }
public void TryPrint() { if (ActivationWindow.CheckLicense() == false) { return; } if (NavFrame.CurrentSource.ToString().Contains("TileContentPage")) { TileContentPage.Current.PrintContent(); } else { MessageBox.Show("当前没有可以打印的内容。", DesktopClient.Properties.Resources.AppName, MessageBoxButton.OK, MessageBoxImage.Information); } }
public static void Save() { if (ActivationWindow.CheckLicense() == false) { return; } if (DocumentManager.CurrentDocument.FileName == string.Empty) { SaveAs(); } else { DocumentManager.CurrentDocument.Save(); MessageBox.Show("保存成功。", "提示"); } }
private void Window_Loaded(object sender, RoutedEventArgs e) { NavFrame.Navigated += NavFrame_Navigated; LicenseState = Security.CheckLicense(ActivationWindow.LicenseFile); if (LicenseState == LicenseState.Illegal) { MessageBox.Show("软件许可出现非法状态。程序将马上退出。", "软件许可", MessageBoxButton.OK, MessageBoxImage.Stop); App.Current.Shutdown(); } else if (LicenseState == LicenseState.Trial) { ActivationWindow aw = new ActivationWindow { Owner = this }; aw.ShowDialog(); } this.SetTitle(); }
public static void SaveAs() { if (ActivationWindow.CheckLicense() == false) { return; } Microsoft.Win32.SaveFileDialog sfd = new Microsoft.Win32.SaveFileDialog(); sfd.Filter = "CIIPP Document (*.ciipp)|*.ciipp|数据交换版Excel (*.xlsx)|*.xlsx"; if (sfd.ShowDialog() == true) { if (sfd.FileName.Substring(sfd.FileName.LastIndexOf('.') + 1).ToLower() == "ciipp") { DocumentManager.CurrentDocument.SaveAs(sfd.FileName); MainWindow.Current.SetTitle(); } else if (sfd.FileName.Substring(sfd.FileName.LastIndexOf('.') + 1).ToLower() == "xlsx") { ExportExcel.ExportExcelT(sfd.FileName); MessageBox.Show("已保存!", "提示"); } } }