Skip to content

Commit

Permalink
Bug fixes, updates
Browse files Browse the repository at this point in the history
  • Loading branch information
Ruben2776 committed Aug 18, 2019
1 parent 8150126 commit 7680441
Show file tree
Hide file tree
Showing 51 changed files with 514 additions and 486 deletions.
10 changes: 5 additions & 5 deletions PicView/Drag and Drop/DragAndDrop.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
using System.Reflection;
using System.Threading.Tasks;
using System.Windows;
using static PicView.Helpers.Variables;
using static PicView.Image_Logic.ImageManager;
using static PicView.Image_Logic.Navigation;
using static PicView.Interface_Logic.Interface;
using static PicView.Variables;
using static PicView.ImageManager;
using static PicView.Navigation;
using static PicView.Interface;

namespace PicView.Drag_and_Drop
namespace PicView
{
internal static class DragAndDrop
{
Expand Down
27 changes: 13 additions & 14 deletions PicView/Error Handling/Error_Handling.cs
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
using PicView.Helpers;
using PicView.PreLoading;
using PicView.PreLoading;
using System;
using System.IO;
using System.Windows.Media.Imaging;
using static PicView.File_Logic.DeleteFiles;
using static PicView.File_Logic.FileLists;
using static PicView.Helpers.Helper;
using static PicView.Helpers.Variables;
using static PicView.Image_Logic.ImageManager;
using static PicView.Image_Logic.Navigation;
using static PicView.Image_Logic.Resize_and_Zoom;
using static PicView.Image_Logic.Rotate_and_Flip;
using static PicView.Interface_Logic.Interface;

namespace PicView.Error_Handling
using static PicView.DeleteFiles;
using static PicView.FileLists;
using static PicView.Helper;
using static PicView.Variables;
using static PicView.ImageManager;
using static PicView.Navigation;
using static PicView.Resize_and_Zoom;
using static PicView.Rotate_and_Flip;
using static PicView.Interface;

namespace PicView
{
internal static class Error_Handling
{
Expand Down Expand Up @@ -50,7 +49,7 @@ internal static bool PicErrorFix(int x)
}
else if (x < 0)
{
var img = RenderToBitmapSource(PicPath, Path.GetExtension(PicPath));
var img = RenderToBitmapSource(PicPath);
if (img != null)
{
Pic(PicPath);
Expand Down
10 changes: 5 additions & 5 deletions PicView/File Logic/ArchiveExtraction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
using System.Diagnostics;
using System.IO;
using System.Threading.Tasks;
using static PicView.Error_Handling.Error_Handling;
using static PicView.File_Logic.DeleteFiles;
using static PicView.Helpers.Variables;
using static PicView.Interface_Logic.Interface;
using static PicView.Error_Handling;
using static PicView.DeleteFiles;
using static PicView.Variables;
using static PicView.Interface;

namespace PicView.File_Logic
namespace PicView
{
internal static class ArchiveExtraction
{
Expand Down
16 changes: 8 additions & 8 deletions PicView/File Logic/Copy_Paste.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Media.Imaging;
using static PicView.Error_Handling.Error_Handling;
using static PicView.File_Logic.FileFunctions;
using static PicView.File_Logic.FileLists;
using static PicView.Helpers.Variables;
using static PicView.Image_Logic.Navigation;
using static PicView.Interface_Logic.Interface;

namespace PicView.File_Logic
using static PicView.Error_Handling;
using static PicView.FileFunctions;
using static PicView.FileLists;
using static PicView.Variables;
using static PicView.Navigation;
using static PicView.Interface;

namespace PicView
{
internal static class Copy_Paste
{
Expand Down
13 changes: 6 additions & 7 deletions PicView/File Logic/DeleteFiles.cs
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
using Microsoft.VisualBasic.FileIO;
using System;
using System.IO;
using System.Text.RegularExpressions;
using static PicView.Error_Handling.Error_Handling;
using static PicView.Helpers.Helper;
using static PicView.Helpers.Variables;
using static PicView.Image_Logic.Navigation;
using static PicView.Interface_Logic.Interface;
using static PicView.Error_Handling;
using static PicView.Helper;
using static PicView.Interface;
using static PicView.Navigation;
using static PicView.Variables;


namespace PicView.File_Logic
namespace PicView
{
internal static class DeleteFiles
{
Expand Down
43 changes: 0 additions & 43 deletions PicView/File Logic/FileAssociation.cs

This file was deleted.

21 changes: 6 additions & 15 deletions PicView/File Logic/FileFunctions.cs
Original file line number Diff line number Diff line change
@@ -1,23 +1,14 @@
using PicView.PreLoading;
using System;
using System.Diagnostics;
using System;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using static PicView.Error_Handling.Error_Handling;
using static PicView.File_Logic.FileLists;
using static PicView.Helpers.Helper;
using static PicView.Helpers.Variables;
using static PicView.Image_Logic.Navigation;
using static PicView.Interface_Logic.Interface;

namespace PicView.File_Logic
using static PicView.Helper;
using static PicView.Navigation;
using static PicView.Variables;

namespace PicView
{
class FileFunctions
{
Expand Down
32 changes: 17 additions & 15 deletions PicView/File Logic/FileLists.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using static PicView.File_Logic.ArchiveExtraction;
using static PicView.Helpers.Variables;
using static PicView.ArchiveExtraction;
using static PicView.Variables;
using static PicView.Error_Handling;

namespace PicView.File_Logic
namespace PicView
{
internal static class FileLists
{
Expand Down Expand Up @@ -262,29 +263,31 @@ internal static Task GetValues(string path)
{
// Make a backup of FolderIndex and PicPath
if (FolderIndex > -1)
{
xFolderIndex = FolderIndex;
}

if (!string.IsNullOrWhiteSpace(PicPath))
{
xPicPath = PicPath;
}

// Start at first file
FolderIndex = 0;

// Add zipped files as recent file
RecentFiles.SetZipped(path);

// Set extracted files to Pics
if (Directory.Exists(TempZipPath))
{
// Start at first file
FolderIndex = 0;

// Add zipped files as recent file
RecentFiles.SetZipped(path);

var directory = Directory.GetDirectories(TempZipPath);
if (directory.Length > 0)
TempZipPath = directory[0];

Pics = FileList(TempZipPath);
if (Pics.Count > 0)
PicPath = Pics[0];
else
Reload(true);
}
else Reload(true);
}
else
{
Expand All @@ -293,9 +296,8 @@ internal static Task GetValues(string path)
if (Pics == null)
return;
FolderIndex = Pics.IndexOf(path);
PicPath = path;
}

PicPath = path;
});
}
}
Expand Down
12 changes: 6 additions & 6 deletions PicView/File Logic/Open_Save.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
using System;
using System.Diagnostics;
using System.IO;
using static PicView.Error_Handling.Error_Handling;
using static PicView.Helpers.Variables;
using static PicView.Image_Logic.ImageManager;
using static PicView.Image_Logic.Navigation;
using static PicView.Interface_Logic.Interface;
using static PicView.Error_Handling;
using static PicView.Variables;
using static PicView.ImageManager;
using static PicView.Navigation;
using static PicView.Interface;

namespace PicView.File_Logic
namespace PicView
{
internal static class Open_Save
{
Expand Down
2 changes: 1 addition & 1 deletion PicView/File Logic/RecentFiles.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using System.Collections.Generic;
using System.IO;

namespace PicView.File_Logic
namespace PicView
{
/// <summary>
/// Class to handle Most Recently Used files
Expand Down
5 changes: 2 additions & 3 deletions PicView/File Logic/Wallpaper.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
using Microsoft.Win32;
using PicView.Image_Logic;
using PicView.Native;
using System;
using System.ComponentModel;
using System.IO;
using System.Threading.Tasks;
using System.Timers;
using static PicView.Helpers.Variables;
using static PicView.Variables;

namespace PicView.File_Logic
namespace PicView
{
public static class Wallpaper // Taken from a Microsoft sample...
{
Expand Down
2 changes: 1 addition & 1 deletion PicView/Helpers/AnimationHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace PicView.Helpers
namespace PicView
{
internal static class AnimationHelper
{
Expand Down
9 changes: 5 additions & 4 deletions PicView/Helpers/Helper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
using System.Diagnostics;
using System.IO;
using System.Windows;
using static PicView.Helpers.Variables;
using static PicView.Variables;

namespace PicView.Helpers
namespace PicView
{
internal static class Helper
{
Expand Down Expand Up @@ -92,11 +92,12 @@ internal static void Print(string path)
p.Start();
}

internal static void SetWindowBorderColor()
internal static void UpdateColor()
{
Application.Current.Resources["ChosenColor"] = AnimationHelper.GetPrefferedColorOver();

if (Properties.Settings.Default.WindowBorderColorEnabled)
{
Application.Current.Resources["ChosenColor"] = AnimationHelper.GetPrefferedColorOver();
var bgBrush = Application.Current.Resources["WindowBackgroundColorBrush"] as System.Windows.Media.SolidColorBrush;
bgBrush.Color = AnimationHelper.GetPrefferedColorOver();
}
Expand Down
Loading

0 comments on commit 7680441

Please sign in to comment.