Skip to content

Commit

Permalink
re-organized photo repositories
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremyknight-me committed Oct 29, 2023
1 parent 774d04d commit 2072e29
Show file tree
Hide file tree
Showing 29 changed files with 63 additions and 49 deletions.
9 changes: 0 additions & 9 deletions PhotoCollage.Common/Enums/BorderType.cs

This file was deleted.

7 changes: 0 additions & 7 deletions PhotoCollage.Common/Enums/FullScreenMode.cs

This file was deleted.

10 changes: 0 additions & 10 deletions PhotoCollage.Common/Enums/ScreensaverSpeed.cs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using PhotoCollage.Common.Settings;

namespace PhotoCollage.Common.Data;
namespace PhotoCollage.Common.Photos.FileSystem;

public abstract class FileSystemPhotoRepositoryBase : IPhotoRepository
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System.IO;
using PhotoCollage.Common.Settings;

namespace PhotoCollage.Common.Data;
namespace PhotoCollage.Common.Photos.FileSystem;

public sealed class OrderedFileSystemPhotoRepository : FileSystemPhotoRepositoryBase
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
using System.IO;
using System.Linq;
using PhotoCollage.Common.Settings;

namespace PhotoCollage.Common.Data;
namespace PhotoCollage.Common.Photos.FileSystem;

public sealed class RandomFileSystemPhotoRepository : FileSystemPhotoRepositoryBase
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace PhotoCollage.Common;
namespace PhotoCollage.Common.Photos;

public interface IPhotoRepository
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
namespace PhotoCollage.Common.Enums;
namespace PhotoCollage.Common.Settings;

public enum BorderType
{
None,
Border,
BorderHeader,
BorderFooter
}

public static class BorderTypeHelper
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using PhotoCollage.Common.Enums;

namespace PhotoCollage.Common;
namespace PhotoCollage.Common.Settings;

public sealed class CollageSettings
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
namespace PhotoCollage.Common.Enums;
namespace PhotoCollage.Common.Settings;

public enum FullScreenMode
{
Stretched,
Centered
}

public static class FullScreenModeHelper
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace PhotoCollage.Common;
namespace PhotoCollage.Common.Settings;

public interface ISettingsRepository
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
namespace PhotoCollage.Common.Enums;
namespace PhotoCollage.Common.Settings;

public enum ScreensaverSpeed
{
SuperSlow = 20,
ReallySlow = 10,
Slow = 6,
Medium = 4,
Fast = 2
}

public static class ScreensaverSpeedHelper
{
Expand Down
2 changes: 1 addition & 1 deletion PhotoCollageScreensaver/Collage/CollageImage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Media.Imaging;
using PhotoCollage.Common.Enums;
using PhotoCollage.Common.Settings;
using PhotoCollageScreensaver.Collage.Presenters;

namespace PhotoCollageScreensaver.Collage;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Windows.Controls;
using PhotoCollage.Common.Settings;
using PhotoCollageScreensaver.Collage.Presenters;

namespace PhotoCollageScreensaver.Collage.Imaging;
Expand All @@ -17,7 +18,7 @@ public override void Position()
{
if (this.Presenter.Configuration.IsFullScreen)
{
if (this.Presenter.Configuration.PhotoFullScreenMode == PhotoCollage.Common.Enums.FullScreenMode.Stretched)
if (this.Presenter.Configuration.PhotoFullScreenMode == FullScreenMode.Stretched)
{
Canvas.SetLeft(this.Control, 0);
Canvas.SetTop(this.Control, 0);
Expand Down
1 change: 1 addition & 0 deletions PhotoCollageScreensaver/Collage/Imaging/ImageProcessor.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System.Windows.Media;
using System.Windows.Media.Imaging;
using PhotoCollage.Common.Settings;

namespace PhotoCollageScreensaver.Collage.Imaging;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System.Windows.Media;
using System.Windows.Media.Imaging;
using PhotoCollage.Common.Settings;

namespace PhotoCollageScreensaver.Collage.Imaging;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System.Linq;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using PhotoCollage.Common.Settings;

namespace PhotoCollageScreensaver.Collage.Imaging;

Expand Down Expand Up @@ -91,7 +92,7 @@ private TransformedBitmap GetFullScreenScaledImage(BitmapSource original, IColla
{
var scaledHeight = view.WindowActualHeight / original.Height;
var scaledWidth = view.WindowActualWidth / original.Width;
if (this.Configuration.PhotoFullScreenMode == PhotoCollage.Common.Enums.FullScreenMode.Centered)
if (this.Configuration.PhotoFullScreenMode == FullScreenMode.Centered)
{
scaledHeight = view.WindowActualHeight / original.Height;
scaledWidth = view.WindowActualWidth / original.Width;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
using System.Windows.Media;
using System.Windows.Threading;
using PhotoCollage.Common.Photos;
using PhotoCollage.Common.Settings;
using PhotoCollageScreensaver.Collage.Imaging;

namespace PhotoCollageScreensaver.Collage.Presenters;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using System.Collections.Concurrent;
using PhotoCollage.Common.Photos;
using PhotoCollage.Common.Settings;
using PhotoCollageScreensaver.Collage.Imaging;

namespace PhotoCollageScreensaver.Collage.Presenters;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using System.Collections.Concurrent;
using PhotoCollage.Common.Photos;
using PhotoCollage.Common.Settings;
using PhotoCollageScreensaver.Collage.Imaging;

namespace PhotoCollageScreensaver.Collage.Presenters;
Expand Down
4 changes: 3 additions & 1 deletion PhotoCollageScreensaver/DependencyInjectionHelper.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
using System.IO;
using Microsoft.Extensions.DependencyInjection;
using PhotoCollage.Common.Data;
using PhotoCollage.Common.Photos;
using PhotoCollage.Common.Photos.FileSystem;
using PhotoCollage.Common.Settings;
using PhotoCollageScreensaver.Collage.Presenters;
using PhotoCollageScreensaver.Logging;
using PhotoCollageScreensaver.Setup;
Expand Down
3 changes: 2 additions & 1 deletion PhotoCollageScreensaver/ErrorHandler.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using PhotoCollageScreensaver.Logging;
using PhotoCollage.Common.Settings;
using PhotoCollageScreensaver.Logging;

namespace PhotoCollageScreensaver;

Expand Down
1 change: 1 addition & 0 deletions PhotoCollageScreensaver/FileSystemSettingsRepository.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System.IO;
using System.Text.Json;
using PhotoCollage.Common.Settings;

namespace PhotoCollageScreensaver;

Expand Down
2 changes: 1 addition & 1 deletion PhotoCollageScreensaver/Setup/SetupViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using System.Runtime.CompilerServices;
using System.Windows.Forms;
using System.Windows.Input;
using PhotoCollage.Common.Enums;
using PhotoCollage.Common.Settings;
using PhotoCollageScreensaver.Collage.Presenters;
using PhotoCollageScreensaver.Commands;

Expand Down
2 changes: 1 addition & 1 deletion PhotoCollageWeb/Client/Pages/Collage.razor
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@page "/collage"
@using Microsoft.AspNetCore.SignalR.Client
@using PhotoCollage.Common
@using PhotoCollage.Common.Enums
@using PhotoCollage.Common.Settings
@using PhotoCollageWeb.Client.Extensions
@using PhotoCollageWeb.Client.Models
@using PhotoCollageWeb.Shared
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using PhotoCollage.Common;
using PhotoCollage.Common.Data;
using PhotoCollage.Common.Photos;
using PhotoCollage.Common.Photos.FileSystem;
using PhotoCollage.Common.Settings;
using PhotoCollageWeb.Server.Workers;

namespace PhotoCollageWeb.Server.Extensions
Expand Down
2 changes: 1 addition & 1 deletion PhotoCollageWeb/Server/Hubs/CollageHub.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Microsoft.AspNetCore.SignalR;
using Microsoft.Extensions.Options;
using PhotoCollage.Common;
using PhotoCollage.Common.Settings;

namespace PhotoCollageWeb.Server.Hubs
{
Expand Down
2 changes: 1 addition & 1 deletion PhotoCollageWeb/Server/Hubs/ICollageClient.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using PhotoCollage.Common;
using PhotoCollage.Common.Settings;
using PhotoCollageWeb.Shared;

namespace PhotoCollageWeb.Server.Hubs
Expand Down
3 changes: 2 additions & 1 deletion PhotoCollageWeb/Server/Workers/CollageWorker.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
using System.Collections.Concurrent;
using Microsoft.AspNetCore.SignalR;
using Microsoft.Extensions.Options;
using PhotoCollage.Common;
using PhotoCollage.Common.Photos;
using PhotoCollage.Common.Settings;
using PhotoCollageWeb.Server.Hubs;
using PhotoCollageWeb.Shared;

Expand Down

0 comments on commit 2072e29

Please sign in to comment.