예제 #1
0
        public MainViewModel()
        {
            if (Application.Current != null)
            {
                Application.Current.Exit += (sender, args) =>
                {
                    //close connections
                    DisconnectAllUnists();

                    //save speaker library
                    SpeakerMethods.SaveSpeakerlib();

                    //save project settings
                    Properties.Settings.Default.Save();
                }
            }
            ;
            _recentFilesLogic = new RecentFilesLogic(this);

            Thread dispThread = Thread.CurrentThread;

            Dispatcher.FromThread(dispThread);


            _tabs.Add(_comViewModel);


#if DEBUG
            if (IsInDesignMode)
            {
                LibraryData.CreateEmptySystem();
            }
            Open(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + @"\d.esc");
#endif
        }
예제 #2
0
 private void SaveFileTimerElapsed(object sender, ElapsedEventArgs e)
 {
     if (LibraryData.SystemIsOpen)
     {
         _saveFileTimer.Stop();
         var q = new SystemFileBackup();
         q.Save();
         _saveFileTimer.Start();
     }
     SpeakerMethods.SaveSpeakerlib();
 }