private void DoClearCache()
        {
            var confirmation = new ConditionalConfirmation
            {
                Title   = "Refresh locally cached Commerce Manager texts".Localize(),
                Content = "Are you sure you want to clear all locally cached Commerce Manager texts?".Localize()
            };

            CommonConfirmRequest.Raise(confirmation,
                                       async xx =>
            {
                if (xx.Confirmed)
                {
                    ShowLoadingAnimation = true;
                    try
                    {
                        await Task.Run(() =>
                        {
                            _elementRepository.Clear();

                            // force Elements re-caching
                            _elementRepository.Elements();

                            _elementRepository.SetStatusDate();

                            // force values update
                            LocalizationManager.UpdateValues();

                            // update available languages menu
                            SendCulturesToShell();
                        });

                        var notification = new Notification();
                        // notification.Title = "Done";
                        notification.Content = "All locally cached texts were removed. You may need to restart this application for the changes to take effect."
                                               .Localize();
                        CommonNotifyRequest.Raise(notification);
                    }
                    finally
                    {
                        ShowLoadingAnimation = false;
                    }
                }
            });
        }
Пример #2
0
 public void Clear()
 {
     inner.Clear();
     CachedElements.Clear();
 }
 /// <summary>
 /// Clears this instance.
 /// </summary>
 public void Clear()
 {
     _innerRepository.Clear();
     _cachedElements.Clear();
 }
Пример #4
0
        /// <summary>
        /// Clears this instance.
        /// </summary>
        public void Clear()
        {
            // don't delete anything from real DB.

            _cacheRepository.Clear();
        }