Ejemplo n.º 1
0
            /// <summary>
            /// Performs the job as a background task
            /// </summary>
            /// <param name="arg"></param>
            public override void ExecuteWork()
            {
                DataDictionary.Util.UnlockAllFiles();

                try
                {
                    if (Dictionary != null)
                    {
                        Dictionary.save();
                    }
                    else
                    {
                        // Save all dictionaries
                        foreach (DataDictionary.Dictionary dictionary in System.Dictionaries)
                        {
                            dictionary.save();
                        }
                    }
                }
                finally
                {
                    DataDictionary.Util.LockAllFiles();
                    System.ShouldSave = false;
                    MainWindow.Invoke((MethodInvoker) delegate
                    {
                        MainWindow.UpdateTitle();
                    });
                }
            }
Ejemplo n.º 2
0
            private void RefreshMainWindow()
            {
                DateTime now  = DateTime.Now;
                TimeSpan span = now - LastRefresh;

                if (span > TimeSpan.FromSeconds(1))
                {
                    MainWindow.Invoke((MethodInvoker) delegate
                    {
                        MainWindow.UpdateTitle();
                    });
                    LastRefresh = now;
                }
            }