mirror of
https://github.com/claunia/romrepomgr.git
synced 2025-12-16 19:24:51 +00:00
Move models to core.
This commit is contained in:
35
RomRepoMgr.Core/EventArgs/RomSetsEventArgs.cs
Normal file
35
RomRepoMgr.Core/EventArgs/RomSetsEventArgs.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
/******************************************************************************
|
||||
// RomRepoMgr - ROM repository manager
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// --[ License ] --------------------------------------------------------------
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright © 2020 Natalia Portillo
|
||||
*******************************************************************************/
|
||||
|
||||
using System.Collections.Generic;
|
||||
using RomRepoMgr.Core.Models;
|
||||
|
||||
namespace RomRepoMgr.Core.EventArgs
|
||||
{
|
||||
public sealed class RomSetEventArgs : System.EventArgs
|
||||
{
|
||||
public List<RomSetModel> RomSets { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -23,7 +23,7 @@
|
||||
// Copyright © 2020 Natalia Portillo
|
||||
*******************************************************************************/
|
||||
|
||||
namespace RomRepoMgr.Models
|
||||
namespace RomRepoMgr.Core.Models
|
||||
{
|
||||
public sealed class AssemblyModel
|
||||
{
|
||||
@@ -23,7 +23,7 @@
|
||||
// Copyright © 2020 Natalia Portillo
|
||||
*******************************************************************************/
|
||||
|
||||
namespace RomRepoMgr.Models
|
||||
namespace RomRepoMgr.Core.Models
|
||||
{
|
||||
public class RomSetModel
|
||||
{
|
||||
@@ -29,7 +29,8 @@ using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Controls.ApplicationLifetimes;
|
||||
using Avalonia.Markup.Xaml;
|
||||
using RomRepoMgr.Models;
|
||||
using RomRepoMgr.Core.EventArgs;
|
||||
using RomRepoMgr.Core.Models;
|
||||
using RomRepoMgr.ViewModels;
|
||||
using RomRepoMgr.Views;
|
||||
|
||||
@@ -56,7 +57,7 @@ namespace RomRepoMgr
|
||||
base.OnFrameworkInitializationCompleted();
|
||||
}
|
||||
|
||||
void OnGotRomSets(object sender, SplashWindowViewModel.RomSetEventArgs e) => _romSets = e.RomSets;
|
||||
void OnGotRomSets(object sender, RomSetEventArgs e) => _romSets = e.RomSets;
|
||||
|
||||
void OnSplashFinished(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="Models\" />
|
||||
<Compile Update="**\*.xaml.cs">
|
||||
<DependentUpon>%(Filename)</DependentUpon>
|
||||
</Compile>
|
||||
|
||||
@@ -33,7 +33,7 @@ using System.Threading.Tasks;
|
||||
using JetBrains.Annotations;
|
||||
using Microsoft.DotNet.PlatformAbstractions;
|
||||
using ReactiveUI;
|
||||
using RomRepoMgr.Models;
|
||||
using RomRepoMgr.Core.Models;
|
||||
using RomRepoMgr.Views;
|
||||
|
||||
namespace RomRepoMgr.ViewModels
|
||||
|
||||
@@ -30,7 +30,7 @@ using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Controls.ApplicationLifetimes;
|
||||
using ReactiveUI;
|
||||
using RomRepoMgr.Models;
|
||||
using RomRepoMgr.Core.Models;
|
||||
using RomRepoMgr.Views;
|
||||
|
||||
namespace RomRepoMgr.ViewModels
|
||||
@@ -116,8 +116,9 @@ namespace RomRepoMgr.ViewModels
|
||||
if(result?.Length != 1)
|
||||
return;
|
||||
|
||||
var dialog = new ImportDat();
|
||||
dialog.DataContext = new ImportDatViewModel(dialog, result[0]);
|
||||
var dialog = new ImportDat();
|
||||
var importDatViewModel = new ImportDatViewModel(dialog, result[0]);
|
||||
dialog.DataContext = importDatViewModel;
|
||||
await dialog.ShowDialog(_view);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
*******************************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reactive;
|
||||
@@ -34,8 +33,9 @@ using Avalonia.Controls.ApplicationLifetimes;
|
||||
using Avalonia.Threading;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using ReactiveUI;
|
||||
using RomRepoMgr.Core.EventArgs;
|
||||
using RomRepoMgr.Core.Models;
|
||||
using RomRepoMgr.Database;
|
||||
using RomRepoMgr.Models;
|
||||
|
||||
namespace RomRepoMgr.ViewModels
|
||||
{
|
||||
@@ -352,10 +352,5 @@ namespace RomRepoMgr.ViewModels
|
||||
internal event EventHandler WorkFinished;
|
||||
|
||||
internal event EventHandler<RomSetEventArgs> GotRomSets;
|
||||
|
||||
public sealed class RomSetEventArgs : EventArgs
|
||||
{
|
||||
public List<RomSetModel> RomSets { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user