public void GenerateContent() { try { Microsoft.Win32.SaveFileDialog dlg = new Microsoft.Win32.SaveFileDialog { Filter = "Rich Text Format (*.rtf)|*.rtf|Tout les fichiers (*.*)|*.*" }; if (dlg.ShowDialog() == true) { MessageBox.Show("Veuillez patienter pendant que le programme genère votre fichier.", "Information", MessageBoxButton.OK, MessageBoxImage.Warning); CheckFinal checkFinalResult = new CheckFinal(this); checkFinalResult.LoadText(this.CurrentFile.FileImplementationsValue, this.CurrentFile.BaseModel.Content); FileStream fileStream = new FileStream(dlg.FileName, FileMode.Create); TextRange range = new TextRange(checkFinalResult.rtbEditor.Document.ContentStart, checkFinalResult.rtbEditor.Document.ContentEnd); range.Save(fileStream, DataFormats.Rtf); fileStream.Close(); checkFinalResult.Close(); MessageBox.Show("Fichier Génerée avec succès", "Opération Terminé !"); MainMenu Main = new MainMenu(); Main.Show(); this.Close(); } } catch (Exception ex) { MessageBox.Show("[SmartGenerator] Error. Cannot save file, error: " + ex.Message); } }
private void checkdata_Click(object sender, RoutedEventArgs e) { CheckFinal cf = new CheckFinal(ruc, rct1, rct2); cf.SetSerialPort = EncoderPlcPort; this.main.Children.Clear(); this.main.Children.Add(cf); }
private void LoadView() { try { CheckFinal checkFinalResult = new CheckFinal(this); checkFinalResult.LoadText(this.CurrentFile.FileImplementationsValue, this.CurrentFile.BaseModel.Content); checkFinalResult.Show(); } catch (Exception e) { System.Windows.Forms.MessageBox.Show(e.Message); } }
private void Mainwindow_Loaded(object sender, RoutedEventArgs e) { // this.WindowState = System.Windows.WindowState.Normal; // this.WindowStyle = System.Windows.WindowStyle.None; //this.ResizeMode = System.Windows.ResizeMode.NoResize; this.Left = 0.0; this.Top = 0.0; this.Width = System.Windows.SystemParameters.PrimaryScreenWidth; this.Height = System.Windows.SystemParameters.PrimaryScreenHeight; show(); if (this.cf == null) { this.main.Children.Add(cf = new CheckFinal(ruc, rct1, rct2)); cf.SetSerialPort = EncoderPlcPort; } else { this.main.Children.Add(cf); } this.user.Content = "当前登录用户:" + SystData.userInfo.user.username; // l = new Login(this); //this.main.Children.Clear(); //this.main.Children.Add(l); ew = new editerWrench(); List <systemcheckset> ls = new List <systemcheckset>(); try { ls = SerializeXML <systemcheckset> .Getlist(); if (ls != null && ls.Count > 0) { if (ls.FirstOrDefault().noticeshow) { //this.taskbarNotifier.Show(); //this.taskbarNotifier.NotifyContent.Clear(); //this.taskbarNotifier.NotifyContent.Add(new NotifyObject(GetWrenchList(Convert.ToInt32(ls.FirstOrDefault().noticedays)))); //WinWrenchRepair WinWrenchRepair = new WinWrenchRepair(GetWrenchList(Convert.ToInt32(ls.FirstOrDefault().noticedays))); //WinWrenchRepair.Show(); } } } catch { } }