public RecordFileListWindow(SpnvSubSystem system) { this.InitializeComponent(); App app = App.Current as App; if (app.AppBkBrush != null) { Background = app.AppBkBrush; } _subsystem = system; _recording = new RecordingFiles(_subsystem); _recording.LoadRecordingFiles(system.Setting.RecordingFileDir); if (_recording.Files.Count != 0) { lsvFiles.ItemsSource = _recording.Files; } else { lsvFiles.ItemsSource = null; } btnPlay.IsEnabled = false; btnDelete.IsEnabled = false; if (_recording.Files.Count == 0) { btnDeleteAll.IsEnabled = false; } }
protected override void OnStartup(StartupEventArgs e) { base.OnStartup(e); AppDomain.CurrentDomain.UnhandledException += AppDomainUnhandledException; if (!EnsureSingleInstance()) { Shutdown(); return; } LoadSettings(); InitializeModules(); Layout.MainWindow main = new Layout.MainWindow(); SetTheme(_generalSetting.Theme); /* * if (!InitializeLicense()) * { * Shutdown(); * return; * }*/ Systeminfo.HandsetMgr = HandsetMgr; Systeminfo.SIPUA = SIPUA; Systeminfo.ConfigMgr = ConfigManager; Systeminfo.Initialize(1); LoginWindow login = new LoginWindow(); if (login.ShowDialog() != true) { Shutdown(); return; } main.Initialize(); if (_generalSetting.MaxWindow) { main.WindowState = WindowState.Maximized; main.WindowStyle = WindowStyle.None; } main.Show(); //开启定时删除录音文件的时钟 _spnvSubSystem = (SpnvSubSystem)Systeminfo.GetSpnvSubSystem(); if (_spnvSubSystem != null) { _recordingFiles = new RecordingFiles(_spnvSubSystem); _delRecordingsTimer = new System.Timers.Timer(10 * 60 * 1000); _delRecordingsTimer.Elapsed += DelRecordingsAtTwelve; _delRecordingsTimer.Start(); } }
private void BtnDelPreviousRecordings_OnClick(object sender, RoutedEventArgs e) { string content = String.Format("请确认是否删除{0}天之前的所有录音文件?", _supernova.RecordingDelDate); Log.Debug("BtnDelPreviousRecordings_OnClick__MessageWindow.ShowDialog BEFORE"); MessageWindow dialog = new MessageWindow( Properties.Resources.IDS_RECORD_DELETE_ALL_TITLE, content, MessageWindow.ButtonListType.ButtonOkCancel, MessageWindow.IconType.IconWarn) { Owner = this }; if (dialog.ShowDialog() == true) { var _recordingFiles = new RecordingFiles(_system); _recordingFiles.DelPreviousRecordings(); } Log.Debug("BtnDelPreviousRecordings_OnClick__MessageWindow.ShowDialog AFTER"); }