예제 #1
0
        /// <summary>
        /// Reset to default state
        /// </summary>
        internal static void Unload()
        {
            ConfigureWindows.GetMainWindow.TitleText.ToolTip = ConfigureWindows.GetMainWindow.TitleText.Text = Application.Current.Resources["NoImage"] as string;
            ConfigureWindows.GetMainWindow.Title             = Application.Current.Resources["NoImage"] as string + " - " + UILogic.SetTitle.AppName;
            CanNavigate = false;
            ConfigureWindows.GetMainWindow.MainImage.Source = null;
            FreshStartup = true;
            if (Pics != null)
            {
                Pics.Clear();
            }

            Preloader.Clear();
            GalleryFunctions.Clear();
            ConfigureWindows.GetMainWindow.MainImage.Width      = ConfigureWindows.GetMainWindow.Scroller.Width = ConfigureWindows.GetMainWindow.Scroller.Height =
                ConfigureWindows.GetMainWindow.MainImage.Height = double.NaN;
            ScaleImage.xWidth = ScaleImage.xHeight = 0;

            if (!string.IsNullOrWhiteSpace(ArchiveExtraction.TempZipPath))
            {
                DeleteTempFiles();
                ArchiveExtraction.TempZipPath = string.Empty;
            }

            SystemIntegration.Taskbar.NoProgress();
        }
예제 #2
0
        /// <summary>
        /// Reset to default state
        /// </summary>
        internal static void Unload()
        {
            mainWindow.Bar.ToolTip = mainWindow.Bar.Text = NoImage;
            mainWindow.Title       = NoImage + " - " + AppName;
            canNavigate            = false;
            mainWindow.img.Source  = null;
            freshStartup           = true;
            if (Pics != null)
            {
                Pics.Clear();
            }

            PreloadCount = 0;
            Preloader.Clear();
            FolderIndex               = 0;
            mainWindow.img.Width      = mainWindow.Scroller.Width = mainWindow.Scroller.Height =
                mainWindow.img.Height = double.NaN;
            xWidth          = xHeight = 0;
            prevPicResource = null;

            if (!string.IsNullOrWhiteSpace(TempZipPath))
            {
                DeleteTempFiles();
                TempZipPath = string.Empty;
            }

            NoProgress();
            AnimationHelper.Fade(ajaxLoading, 0, TimeSpan.FromSeconds(.2));
        }
 public async void Show(Article article)
 {
     Article = article;
     Pics.Clear();
     if (Article.Pictures != null)
     {
         foreach (var pic in article.Pictures)
         {
             AddPic(pic);
         }
     }
     DialogTitle = article.Id == 0 ? $"{Translate.Keys["Add"]} {Translate.Keys["Article"]}" : $"{Translate.Keys["Update"]}: {article.Title}";
     StateHasChanged();
     await JsRuntime.InvokeAsync <object>("ShowModal", "articleModal");
 }
예제 #4
0
        /// <summary>
        /// Clears data, to free objects no longer necessary to store in memory and allow changing folder without error.
        /// </summary>
        internal static void ChangeFolder(bool backup = false)
        {
            if (Pics.Count > 0 && backup)
            {
                // Make a backup of xPicPath and FolderIndex
                if (!string.IsNullOrWhiteSpace(Pics[FolderIndex]))
                {
                    BackupPath = Pics[FolderIndex];
                }
            }

            Pics.Clear();
            GalleryFunctions.Clear();
            Preloader.Clear();
            FreshStartup = true;
            DeleteTempFiles();
        }
예제 #5
0
        /// <summary>
        /// Clears data, to free objects no longer necessary to store in memory and allow changing folder without error.
        /// </summary>
        internal static void ChangeFolder(bool backup = false)
        {
            if (backup)
            {
                // Make a backup of xPicPath and FolderIndex
                if (!string.IsNullOrWhiteSpace(Pics[FolderIndex]))
                {
                    xPicPath = Pics[FolderIndex];
                }
            }

            Pics.Clear();
            Preloader.Clear();
            DeleteTempFiles();
            PreloadCount = 0;
            freshStartup = true;

            if (Properties.Settings.Default.PicGallery > 0)
            {
                PicGalleryLogic.Clear();
            }
        }