Skip to content

Commit

Permalink
chore: change namespaces
Browse files Browse the repository at this point in the history
  • Loading branch information
sandre58 committed Apr 29, 2024
1 parent 1a0d703 commit e66912f
Show file tree
Hide file tree
Showing 41 changed files with 24 additions and 72 deletions.
12 changes: 0 additions & 12 deletions src/MyNet.UI/Dialogs/DialogManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ public static async Task ShowAsync<T>(Action<T>? closeAction = null) where T : c
/// <summary>
/// Displays a modal dialog.
/// </summary>
/// <param name="typeViewModel">The view to include in workspace dialog.</param>
public static async Task ShowAsync(Type typeViewModel, Action<IDialogViewModel>? closeAction = null)
{
var vm = GetViewModel<IDialogViewModel>(typeViewModel);
Expand All @@ -78,7 +77,6 @@ public static async Task ShowAsync(Type typeViewModel, Action<IDialogViewModel>?
/// <summary>
/// Displays a message dialog.
/// </summary>
/// <param name="viewModel">The view to include in workspace dialog.</param>
public static async Task ShowAsync<T>(T viewModel, Action<T>? closeAction = null) where T : IDialogViewModel
{
if (_dialogService is null) return;
Expand Down Expand Up @@ -136,37 +134,29 @@ public static async Task<MessageBoxResult> ShowSuccessAsync(string message, stri
/// <summary>
/// Displays a message dialog.
/// </summary>
/// <param name="message">Message.</param>
/// <param name="buttons">Buttons of window.</param>
public static async Task<MessageBoxResult> ShowInformationAsync(string message, string? title = null,
MessageBoxResultOption buttons = MessageBoxResultOption.Ok) => await ShowMessageAsync(message, title ?? UiResources.Information, buttons, MessageSeverity.Information, MessageBoxResult.OK).ConfigureAwait(false);

/// <summary>
/// Displays a message dialog.
/// </summary>
/// <param name="message">Message.</param>
/// <param name="buttons">Buttons of window.</param>
public static async Task<MessageBoxResult> ShowErrorAsync(string message, string? title = null,
MessageBoxResultOption buttons = MessageBoxResultOption.Ok) => await ShowMessageAsync(message, title ?? UiResources.Error, buttons, MessageSeverity.Error, MessageBoxResult.OK).ConfigureAwait(false);

/// <summary>
/// Displays a message dialog.
/// </summary>
/// <param name="message">Message.</param>
/// <param name="buttons">Buttons of window.</param>
public static async Task<MessageBoxResult> ShowWarningAsync(string message, string? title = null,
MessageBoxResultOption buttons = MessageBoxResultOption.Ok) => await ShowMessageAsync(message, title ?? UiResources.Warning, buttons, MessageSeverity.Warning, MessageBoxResult.OK).ConfigureAwait(false);

/// <summary>
/// Displays a message dialog.
/// </summary>
/// <param name="message">Message.</param>
public static async Task<MessageBoxResult> ShowQuestionAsync(string message, string? title = null) => await ShowMessageAsync(message, title ?? UiResources.Question, MessageBoxResultOption.YesNo, MessageSeverity.Question, MessageBoxResult.Yes).ConfigureAwait(false);

/// <summary>
/// Displays a message dialog.
/// </summary>
/// <param name="message">Message.</param>
public static async Task<MessageBoxResult> ShowQuestionWithCancelAsync(string message, string? title = null) => await ShowMessageAsync(message, title ?? UiResources.Question, MessageBoxResultOption.YesNoCancel, MessageSeverity.Question, MessageBoxResult.Yes).ConfigureAwait(false);

/// <summary>
Expand Down Expand Up @@ -211,7 +201,6 @@ public static async Task<MessageBoxResult> ShowMessageAsync(
/// Displays a message box that has a message, title bar caption, button, and icon; and
/// that accepts a default message box result and returns a result.
/// </summary>
/// <param name="settings">The settings for the message box dialog.</param>
/// <returns>
/// A <see cref="MessageBoxResult"/> value that specifies which message box button is
/// clicked by the user.
Expand All @@ -232,7 +221,6 @@ public static async Task<MessageBoxResult> ShowMessageBoxAsync(IMessageBox viewM
/// <summary>
/// Displays the <see cref="OpenFileDialog"/>.
/// </summary>
/// <param name="settings">The settings for the open file dialog.</param>
/// <returns>
/// If the user clicks the OK button of the dialog that is displayed, true is returned;
/// otherwise false.
Expand Down
1 change: 0 additions & 1 deletion src/MyNet.UI/Dialogs/IDialogService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ public interface IDialogService
/// Displays a message box that has a message, title bar caption, button, and icon; and
/// that accepts a default message box result and returns a result.
/// </summary>
/// <param name="settings">The settings for the message box dialog.</param>
/// <returns>
/// A <see cref="MessageBoxResult"/> value that specifies which message box button is
/// clicked by the user.
Expand Down
6 changes: 0 additions & 6 deletions src/MyNet.UI/Extensions/BusyExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,16 @@ public static class BusyExtensions
/// <summary>
/// Show busy control during action.
/// </summary>
/// <typeparam name="TBusy"></typeparam>
/// <param name="action"></param>
public static async Task WaitIndeterminateAsync(this IBusyService busyService, Action<IndeterminateBusy> action) => await busyService.WaitAsync(action);

/// <summary>
/// Show busy control during action.
/// </summary>
/// <typeparam name="TBusy"></typeparam>
/// <param name="action"></param>
public static async Task WaitIndeterminateAsync(this IBusyService busyService, Action action) => await busyService.WaitAsync<IndeterminateBusy>(_ => action());

/// <summary>
/// Show busy control during action.
/// </summary>
/// <typeparam name="TBusy"></typeparam>
/// <param name="action"></param>
public static async Task WaitDeterminateAsync(this IBusyService busyService, Action<DeterminateBusy> action) => await busyService.WaitAsync(action);
}
}
6 changes: 3 additions & 3 deletions src/MyNet.UI/Extensions/IViewResolverExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ public static class IViewResolverExtensions
/// <summary>
/// Resolves a view by the view model and the registered <see cref="IResolver.NamingConventions" />.
/// </summary>
/// <typeparam name="TView">The type of the view model.</typeparam>
/// <param name="viewModelLocator">The view locator.</param>
/// <typeparam name="TViewModel">The type of the view model.</typeparam>
/// <param name="viewResolver">The view locator.</param>
/// <returns>The resolved view or <c>null</c> if the view could not be resolved.</returns>
/// <exception cref="ArgumentNullException">The <paramref name="viewModelLocator" /> is <c>null</c>.</exception>
/// <exception cref="ArgumentNullException">The <paramref name="viewResolver" /> is <c>null</c>.</exception>
/// <remarks>Keep in mind that all results are cached. The cache itself is not automatically cleared when the
/// <see cref="IResolver.NamingConventions" /> are changed. If the <see cref="IResolver.NamingConventions" /> are changed,
/// the cache must be cleared manually.</remarks>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,10 @@
using MyNet.Observable;
using MyNet.UI.Commands;
using MyNet.UI.ViewModels.FileHistory;
using MyNet.UI.ViewModels.Filters;
using MyNet.UI.ViewModels.List;
using MyNet.UI.ViewModels.List.Filtering;
using MyNet.UI.ViewModels.List.Filtering.Filters;
using MyNet.UI.ViewModels.List.Sorting;
using MyNet.UI.ViewModels.Sorting;
using MyNet.Utilities.Comparaison;

namespace MyNet.UI.Services.Providers
Expand Down
1 change: 0 additions & 1 deletion src/MyNet.UI/Toasting/ToasterManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ public static void Show(INotification notification,
/// <summary>
/// Hide a toast.
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="toast"></param>
public static void Hide(INotification toast) => _toasterService?.Hide(toast);

Expand Down
8 changes: 4 additions & 4 deletions src/MyNet.UI/ViewModels/IListViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@

using System;
using System.Collections;
using MyNet.UI.ViewModels.Filters;
using MyNet.UI.ViewModels.Grouping;
using MyNet.UI.ViewModels.Paging;
using MyNet.UI.ViewModels.Sorting;
using MyNet.UI.ViewModels.List;
using MyNet.UI.ViewModels.List.Filtering;
using MyNet.UI.ViewModels.List.Grouping;
using MyNet.UI.ViewModels.List.Sorting;

namespace MyNet.UI.ViewModels
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
using System.Collections.Generic;
using System.Collections.ObjectModel;
using MyNet.UI.Commands;
using MyNet.UI.ViewModels.Filters;
using MyNet.Utilities;

namespace MyNet.UI.ViewModels.List.Filtering
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

using MyNet.Observable;
using MyNet.Observable.Translatables;
using MyNet.UI.ViewModels.Filters;
using MyNet.Utilities.Comparaison;

namespace MyNet.UI.ViewModels.List.Filtering
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
using System.Reactive.Linq;
using DynamicData;
using MyNet.Observable.Translatables;
using MyNet.UI.ViewModels.Filters;
using MyNet.Utilities;
using PropertyChanged;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

using System;
using MyNet.Observable.Translatables;
using MyNet.UI.ViewModels.Filters;

namespace MyNet.UI.ViewModels.List.Filtering
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
using System.Linq;
using DynamicData.Binding;
using MyNet.Observable;
using MyNet.UI.ViewModels.Filters;
using PropertyChanged;

namespace MyNet.UI.ViewModels.List.Filtering.Filters
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using System;
using System.Collections.Generic;

namespace MyNet.UI.ViewModels.Filters
namespace MyNet.UI.ViewModels.List.Filtering
{
public class FiltersChangedEventArgs(IEnumerable<ICompositeFilterViewModel> filters) : EventArgs
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
using System.Collections.Generic;
using System.Linq;
using MyNet.Observable.Collections;
using MyNet.UI.ViewModels.Filters;

namespace MyNet.UI.ViewModels.List.Filtering
{
Expand Down
1 change: 0 additions & 1 deletion src/MyNet.UI/ViewModels/List/Filtering/FiltersViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
using MyNet.Observable;
using MyNet.Observable.Attributes;
using MyNet.UI.Commands;
using MyNet.UI.ViewModels.Filters;
using MyNet.Utilities;
using MyNet.Utilities.Comparaison;
using MyNet.Utilities.Deferring;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using MyNet.Utilities;
using MyNet.Utilities.Comparaison;

namespace MyNet.UI.ViewModels.Filters
namespace MyNet.UI.ViewModels.List.Filtering
{
public interface ICompositeFilterViewModel : IWrapper<IFilterViewModel>, INotifyPropertyChanged, ICloneable
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using MyNet.Observable.Collections.Filters;
using MyNet.Utilities;

namespace MyNet.UI.ViewModels.Filters
namespace MyNet.UI.ViewModels.List.Filtering
{
public interface IFilterViewModel : IFilter, INotifyPropertyChanged, ICloneable, ISettable, ISimilar<IFilterViewModel>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

using System;

namespace MyNet.UI.ViewModels.Filters
namespace MyNet.UI.ViewModels.List.Filtering
{
public interface IFiltersViewModel
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
using System.Collections.ObjectModel;
using System.Linq;
using MyNet.Observable;
using MyNet.UI.ViewModels.Filters;
using MyNet.Utilities.Comparaison;
using PropertyChanged;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

using System.Collections.Generic;
using System.Linq;
using MyNet.UI.ViewModels.Filters;

namespace MyNet.UI.ViewModels.List.Filtering
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
using System.Linq;
using DynamicData;
using MyNet.Observable.Attributes;
using MyNet.UI.ViewModels.Grouping;

namespace MyNet.UI.ViewModels.List.Grouping
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using System;
using System.Collections.Generic;

namespace MyNet.UI.ViewModels.Grouping
namespace MyNet.UI.ViewModels.List.Grouping
{
public class GroupingChangedEventArgs(IEnumerable<IGroupingPropertyViewModel> groupProperties) : EventArgs
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
using System.Collections.Generic;
using System.Linq;
using MyNet.Observable.Collections;
using MyNet.UI.ViewModels.Grouping;

namespace MyNet.UI.ViewModels.List.Grouping
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

using MyNet.Observable;
using MyNet.Observable.Translatables;
using MyNet.UI.ViewModels.Grouping;

namespace MyNet.UI.ViewModels.List.Grouping
{
Expand Down
1 change: 0 additions & 1 deletion src/MyNet.UI/ViewModels/List/Grouping/GroupingViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
using MyNet.Observable;
using MyNet.Observable.Attributes;
using MyNet.UI.Commands;
using MyNet.UI.ViewModels.Grouping;
using MyNet.Utilities;
using MyNet.Utilities.Deferring;
using PropertyChanged;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using System;
using System.ComponentModel;

namespace MyNet.UI.ViewModels.Grouping
namespace MyNet.UI.ViewModels.List.Grouping
{
public interface IGroupingPropertyViewModel : INotifyPropertyChanged, ICloneable
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using System;
using System.ComponentModel;

namespace MyNet.UI.ViewModels.Grouping
namespace MyNet.UI.ViewModels.List.Grouping
{
public interface IGroupingViewModel : INotifyPropertyChanged
{
Expand Down
7 changes: 3 additions & 4 deletions src/MyNet.UI/ViewModels/List/IListParametersProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
// See the LICENSE file in the project root for more information.

using MyNet.UI.ViewModels;
using MyNet.UI.ViewModels.Filters;
using MyNet.UI.ViewModels.Grouping;
using MyNet.UI.ViewModels.Paging;
using MyNet.UI.ViewModels.Sorting;
using MyNet.UI.ViewModels.List.Filtering;
using MyNet.UI.ViewModels.List.Grouping;
using MyNet.UI.ViewModels.List.Sorting;

namespace MyNet.UI.ViewModels.List
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using System.ComponentModel;
using MyNet.UI.Commands;

namespace MyNet.UI.ViewModels.Paging
namespace MyNet.UI.ViewModels.List
{
public interface IPagingViewModel : INotifyPropertyChanged
{
Expand Down
4 changes: 0 additions & 4 deletions src/MyNet.UI/ViewModels/List/ListParametersProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@
using System.ComponentModel;
using System.Linq;
using MyNet.UI.ViewModels;
using MyNet.UI.ViewModels.Filters;
using MyNet.UI.ViewModels.Grouping;
using MyNet.UI.ViewModels.Paging;
using MyNet.UI.ViewModels.Sorting;
using MyNet.UI.ViewModels.Display;
using MyNet.UI.ViewModels.List.Filtering;
using MyNet.UI.ViewModels.List.Grouping;
Expand Down
5 changes: 1 addition & 4 deletions src/MyNet.UI/ViewModels/List/ListViewModelBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,9 @@
using MyNet.UI.Dialogs;
using MyNet.UI.Dialogs.Models;
using MyNet.UI.Resources;
using MyNet.UI.ViewModels.Filters;
using MyNet.UI.ViewModels.Grouping;
using MyNet.UI.ViewModels.List.Filtering;
using MyNet.UI.ViewModels.List.Grouping;
using MyNet.UI.ViewModels.List.Sorting;
using MyNet.UI.ViewModels.Paging;
using MyNet.UI.ViewModels.Sorting;
using MyNet.UI.ViewModels.Workspace;
using MyNet.Utilities;
using PropertyChanged;
Expand Down
1 change: 0 additions & 1 deletion src/MyNet.UI/ViewModels/List/Paging/PagingViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
using MyNet.Observable;
using MyNet.Observable.Collections;
using MyNet.UI.Commands;
using MyNet.UI.ViewModels.Paging;
using MyNet.Utilities;

namespace MyNet.UI.ViewModels.List.Paging
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

using System;

namespace MyNet.UI.ViewModels.Paging
namespace MyNet.UI.ViewModels.List
{
public class PagingChangedEventArgs(int page, int pageSize) : EventArgs
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) Stéphane ANDRE. All Right Reserved.
// See the LICENSE file in the project root for more information.

namespace MyNet.UI.ViewModels.Paging
namespace MyNet.UI.ViewModels.List
{
public readonly struct PagingResponse
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
using System.Linq;
using DynamicData;
using MyNet.Observable.Attributes;
using MyNet.UI.ViewModels.Sorting;

namespace MyNet.UI.ViewModels.List.Sorting
{
Expand Down
Loading

0 comments on commit e66912f

Please sign in to comment.