Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
using System;

namespace Demo.Arch.Abstraction.Contracts
{
public class Class1
{

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\Demo.Arch.App.Model\Demo.Arch.App.Model.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace Demo.Arch.Abstraction.Transport.Rest
{
public class Class1
{

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="CodeFactory.NDF" Version="1.23111.1" />
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.2.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Demo.Arch.Abstraction.Contracts\Demo.Arch.Abstraction.Contracts.csproj" />
<ProjectReference Include="..\Demo.Arch.App.Model\Demo.Arch.App.Model.csproj" />
<ProjectReference Include="..\Demo.Arch.Transport.Rest.Model\Demo.Arch.Transport.Rest.Model.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
using CodeFactory.NDF;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Demo.Arch.Abstraction.Transport.Rest
{
/// <summary>
/// Provides dependency injection management for this library.
/// </summary>
public class LibraryLoader : DependencyInjectionLoader
{
/// <summary>
/// Loads child libraries that are subscribed to by this library.
/// </summary>
/// <param name="serviceCollection">The dependency injection provider to register services with.</param>
/// <param name="configuration">The source configuration to provide for dependency injection.</param>
protected override void LoadLibraries(IServiceCollection serviceCollection, IConfiguration configuration)
{
//Add child libraries to load if nessecary.
}

/// <summary>
/// Loads dependency injections that are setup and configured manually.
/// </summary>
/// <param name="serviceCollection">The dependency injection provider to register services with.</param>
/// <param name="configuration">The source configuration to provide for dependency injection.</param>
protected override void LoadManualRegistration(IServiceCollection serviceCollection, IConfiguration configuration)
{
//Manual register singlton and other services that cannot be loaded through automation.
}

/// <summary>
/// Loads dependency injections that are setup and configured manually.
/// </summary>
/// <param name="serviceCollection">The dependency injection provider to register services with.</param>
/// <param name="configuration">The source configuration to provide for dependency injection.</param>
protected override void LoadRegistration(IServiceCollection serviceCollection, IConfiguration configuration)
{
//Auto generation for transient classes through automation.
}
}
}
9 changes: 9 additions & 0 deletions Demos/DemoArchitecture/Demo.Arch.App.Model/Class1.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
using System;

namespace Demo.Arch.App.Model
{
public class Class1
{

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
<Nullable>enable</Nullable>
</PropertyGroup>

</Project>
7 changes: 7 additions & 0 deletions Demos/DemoArchitecture/Demo.Arch.Client.Maui.Model/Class1.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace Demo.Arch.Client.Maui.Model
{
// All the code in this file is included in all platforms.
public class Class1
{
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net7.0;net7.0-android;net7.0-ios;net7.0-maccatalyst</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net7.0-windows10.0.19041.0</TargetFrameworks>
<!-- Uncomment to also build the tizen app. You will need to install tizen by following this: https://github.com/Samsung/Tizen.NET -->
<!-- <TargetFrameworks>$(TargetFrameworks);net7.0-tizen</TargetFrameworks> -->
<UseMaui>true</UseMaui>
<SingleProject>true</SingleProject>
<ImplicitUsings>enable</ImplicitUsings>

<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">14.2</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">14.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">21.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</SupportedOSPlatformVersion>
<TargetPlatformMinVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</TargetPlatformMinVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'tizen'">6.5</SupportedOSPlatformVersion>
</PropertyGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace Demo.Arch.Client.Maui.Model
{
// All the code in this file is only included on Android.
public class PlatformClass1
{
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace Demo.Arch.Client.Maui.Model
{
// All the code in this file is only included on Mac Catalyst.
public class PlatformClass1
{
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
using System;

namespace Demo.Arch.Client.Maui.Model
{
// All the code in this file is only included on Tizen.
public class PlatformClass1
{
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace Demo.Arch.Client.Maui.Model
{
// All the code in this file is only included on Windows.
public class PlatformClass1
{
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace Demo.Arch.Client.Maui.Model
{
// All the code in this file is only included on iOS.
public class PlatformClass1
{
}
}
26 changes: 26 additions & 0 deletions Demos/DemoArchitecture/Demo.Arch.Client.Maui/App.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8" ?>
<Application xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:Demo.Arch.Client.Maui"
x:Class="Demo.Arch.Client.Maui.App">
<Application.Resources>
<ResourceDictionary>

<Color x:Key="PageBackgroundColor">#512bdf</Color>
<Color x:Key="PrimaryTextColor">White</Color>

<Style TargetType="Label">
<Setter Property="TextColor" Value="{DynamicResource PrimaryTextColor}" />
<Setter Property="FontFamily" Value="OpenSansRegular" />
</Style>

<Style TargetType="Button">
<Setter Property="TextColor" Value="{DynamicResource PrimaryTextColor}" />
<Setter Property="FontFamily" Value="OpenSansRegular" />
<Setter Property="BackgroundColor" Value="#2b0b98" />
<Setter Property="Padding" Value="14,10" />
</Style>

</ResourceDictionary>
</Application.Resources>
</Application>
12 changes: 12 additions & 0 deletions Demos/DemoArchitecture/Demo.Arch.Client.Maui/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
namespace Demo.Arch.Client.Maui
{
public partial class App : Application
{
public App()
{
InitializeComponent();

MainPage = new MainPage();
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
namespace Demo.Arch.Client.Maui.Data
{
public class WeatherForecast
{
public DateTime Date { get; set; }

public int TemperatureC { get; set; }

public int TemperatureF => 32 + (int)(TemperatureC / 0.5556);

public string Summary { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
namespace Demo.Arch.Client.Maui.Data
{
public class WeatherForecastService
{
private static readonly string[] Summaries = new[]
{
"Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching"
};

public Task<WeatherForecast[]> GetForecastAsync(DateTime startDate)
{
return Task.FromResult(Enumerable.Range(1, 5).Select(index => new WeatherForecast
{
Date = startDate.AddDays(index),
TemperatureC = Random.Shared.Next(-20, 55),
Summary = Summaries[Random.Shared.Next(Summaries.Length)]
}).ToArray());
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">

<PropertyGroup>
<TargetFrameworks>net7.0-android;net7.0-ios;net7.0-maccatalyst</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net7.0-windows10.0.19041.0</TargetFrameworks>
<!-- Uncomment to also build the tizen app. You will need to install tizen by following this: https://github.com/Samsung/Tizen.NET -->
<!-- <TargetFrameworks>$(TargetFrameworks);net7.0-tizen</TargetFrameworks> -->
<OutputType>Exe</OutputType>
<RootNamespace>Demo.Arch.Client.Maui</RootNamespace>
<UseMaui>true</UseMaui>
<SingleProject>true</SingleProject>
<ImplicitUsings>enable</ImplicitUsings>
<EnableDefaultCssItems>false</EnableDefaultCssItems>

<!-- Display name -->
<ApplicationTitle>Demo.Arch.Client.Maui</ApplicationTitle>

<!-- App Identifier -->
<ApplicationId>com.companyname.demo.arch.client.maui</ApplicationId>
<ApplicationIdGuid>D7C6EEDD-4A6B-4398-963C-8F8B11F40DB9</ApplicationIdGuid>

<!-- Versions -->
<ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
<ApplicationVersion>1</ApplicationVersion>

<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">14.2</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">14.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">24.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</SupportedOSPlatformVersion>
<TargetPlatformMinVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</TargetPlatformMinVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'tizen'">6.5</SupportedOSPlatformVersion>
</PropertyGroup>

<ItemGroup>
<!-- App Icon -->
<MauiIcon Include="Resources\AppIcon\appicon.svg" ForegroundFile="Resources\AppIcon\appiconfg.svg" Color="#512BD4" />

<!-- Splash Screen -->
<MauiSplashScreen Include="Resources\Splash\splash.svg" Color="#512BD4" BaseSize="128,128" />

<!-- Images -->
<MauiImage Include="Resources\Images\*" />
<MauiImage Update="Resources\Images\dotnet_bot.svg" BaseSize="168,208" />

<!-- Custom Fonts -->
<MauiFont Include="Resources\Fonts\*" />

<!-- Raw Assets (also remove the "Resources\Raw" prefix) -->
<MauiAsset Include="Resources\Raw\**" LogicalName="%(RecursiveDir)%(Filename)%(Extension)" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="CodeFactory.NDF" Version="1.23111.1" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="7.0.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Demo.Arch.Abstraction.Contracts\Demo.Arch.Abstraction.Contracts.csproj" />
<ProjectReference Include="..\Demo.Arch.Abstraction.Transport.Rest\Demo.Arch.Abstraction.Transport.Rest.csproj" />
<ProjectReference Include="..\Demo.Arch.App.Model\Demo.Arch.App.Model.csproj" />
<ProjectReference Include="..\Demo.Arch.Client.Maui.Model\Demo.Arch.Client.Maui.Model.csproj" />
</ItemGroup>

</Project>
48 changes: 48 additions & 0 deletions Demos/DemoArchitecture/Demo.Arch.Client.Maui/LibraryLoader.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
using CodeFactory.NDF;
using Microsoft.Extensions.Configuration;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Demo.Arch.Client.Maui
{
/// <summary>
/// Provides dependency injection management for this library.
/// </summary>
public class LibraryLoader : DependencyInjectionLoader
{
/// <summary>
/// Loads child libraries that are subscribed to by this library.
/// </summary>
/// <param name="serviceCollection">The dependency injection provider to register services with.</param>
/// <param name="configuration">The source configuration to provide for dependency injection.</param>
protected override void LoadLibraries(IServiceCollection serviceCollection, IConfiguration configuration)
{
var abstractLoader = new Abstraction.Transport.Rest.LibraryLoader();

abstractLoader.Load(serviceCollection, configuration);
}

/// <summary>
/// Loads dependency injections that are setup and configured manually.
/// </summary>
/// <param name="serviceCollection">The dependency injection provider to register services with.</param>
/// <param name="configuration">The source configuration to provide for dependency injection.</param>
protected override void LoadManualRegistration(IServiceCollection serviceCollection, IConfiguration configuration)
{
//Manual register singlton and other services that cannot be loaded through automation.
}

/// <summary>
/// Loads dependency injections that are setup and configured manually.
/// </summary>
/// <param name="serviceCollection">The dependency injection provider to register services with.</param>
/// <param name="configuration">The source configuration to provide for dependency injection.</param>
protected override void LoadRegistration(IServiceCollection serviceCollection, IConfiguration configuration)
{
//Auto generation for transient classes through automation.
}
}
}
Loading