Started on the UI project

Added ReactiveUI, Material design and MahApps
Added the welcome page
This commit is contained in:
SpoinkyNL committed 2017-12-18 01:04:28 +01:00
1 parent d64c1a660d
commit fc996b7258
26 files changed
+869 -100

No files matched your search

+6 -4
View File
@@ -1,11 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>
<TargetFramework>net461</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="2.0.1" />
<DotNetCliToolReference Include="Microsoft.EntityFrameworkCore.Tools.DotNet" Version="2.0.1" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="2.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.0.1" />
</ItemGroup>
-10
View File
@@ -1,10 +0,0 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace Artemis.Storage.Entities
{
class Condition
{
}
}
+12 -4
View File
@@ -1,10 +1,18 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Collections.Generic;
namespace Artemis.Storage.Entities
{
class Layer
internal class Layer
{
public int ProfileId { get; set; }
public string Name { get; set; }
public LayerType LayerType { get; set; }
public virtual Profile Profile { get; set; }
public virtual ICollection<Layer> Layers { get; set; }
}
internal enum LayerType
{
}
}
+7 -4
View File
@@ -1,10 +1,13 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
namespace Artemis.Storage.Entities
{
class Profile
internal class Profile
{
[Key]
public int Id { get; set; }
public string Name { get; set; }
public virtual ICollection<Layer> Layers { get; set; }
}
}
+11
View File
@@ -0,0 +1,11 @@
using System.ComponentModel.DataAnnotations;
namespace Artemis.Storage.Entities
{
internal class Setting
{
[Key]
public string Name { get; set; }
public string Value { get; set; }
}
}
@@ -0,0 +1,67 @@
// <auto-generated />
using Artemis.Storage;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage;
using System;
namespace Artemis.Storage.Migrations
{
[DbContext(typeof(StorageContext))]
[Migration("20171208203331_InitialCreate")]
partial class InitialCreate
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "2.0.1-rtm-125");
modelBuilder.Entity("Artemis.Storage.Entities.Layer", b =>
{
b.Property<int>("ProfileId");
b.Property<string>("Name");
b.HasKey("ProfileId", "Name");
b.ToTable("Layer");
});
modelBuilder.Entity("Artemis.Storage.Entities.Profile", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("Name");
b.HasKey("Id");
b.ToTable("Profiles");
});
modelBuilder.Entity("Artemis.Storage.Entities.Setting", b =>
{
b.Property<string>("Name")
.ValueGeneratedOnAdd();
b.Property<string>("Value");
b.HasKey("Name");
b.ToTable("Settings");
});
modelBuilder.Entity("Artemis.Storage.Entities.Layer", b =>
{
b.HasOne("Artemis.Storage.Entities.Profile", "Profile")
.WithMany("Layers")
.HasForeignKey("ProfileId")
.OnDelete(DeleteBehavior.Cascade);
});
#pragma warning restore 612, 618
}
}
}
@@ -0,0 +1,67 @@
using Microsoft.EntityFrameworkCore.Migrations;
using System;
using System.Collections.Generic;
namespace Artemis.Storage.Migrations
{
public partial class InitialCreate : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "Profiles",
columns: table => new
{
Id = table.Column<int>(nullable: false)
.Annotation("Sqlite:Autoincrement", true),
Name = table.Column<string>(nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Profiles", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Settings",
columns: table => new
{
Name = table.Column<string>(nullable: false),
Value = table.Column<string>(nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Settings", x => x.Name);
});
migrationBuilder.CreateTable(
name: "Layer",
columns: table => new
{
ProfileId = table.Column<int>(nullable: false),
Name = table.Column<string>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Layer", x => new { x.ProfileId, x.Name });
table.ForeignKey(
name: "FK_Layer_Profiles_ProfileId",
column: x => x.ProfileId,
principalTable: "Profiles",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "Layer");
migrationBuilder.DropTable(
name: "Settings");
migrationBuilder.DropTable(
name: "Profiles");
}
}
}
@@ -0,0 +1,66 @@
// <auto-generated />
using Artemis.Storage;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage;
using System;
namespace Artemis.Storage.Migrations
{
[DbContext(typeof(StorageContext))]
partial class StorageContextModelSnapshot : ModelSnapshot
{
protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "2.0.1-rtm-125");
modelBuilder.Entity("Artemis.Storage.Entities.Layer", b =>
{
b.Property<int>("ProfileId");
b.Property<string>("Name");
b.HasKey("ProfileId", "Name");
b.ToTable("Layer");
});
modelBuilder.Entity("Artemis.Storage.Entities.Profile", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("Name");
b.HasKey("Id");
b.ToTable("Profiles");
});
modelBuilder.Entity("Artemis.Storage.Entities.Setting", b =>
{
b.Property<string>("Name")
.ValueGeneratedOnAdd();
b.Property<string>("Value");
b.HasKey("Name");
b.ToTable("Settings");
});
modelBuilder.Entity("Artemis.Storage.Entities.Layer", b =>
{
b.HasOne("Artemis.Storage.Entities.Profile", "Profile")
.WithMany("Layers")
.HasForeignKey("ProfileId")
.OnDelete(DeleteBehavior.Cascade);
});
#pragma warning restore 612, 618
}
}
}
Binary file not shown.
+28
View File
@@ -0,0 +1,28 @@
using Artemis.Storage.Entities;
using Microsoft.EntityFrameworkCore;
namespace Artemis.Storage
{
internal class StorageContext : DbContext
{
internal DbSet<Profile> Profiles { get; set; }
internal DbSet<Setting> Settings { get; set; }
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
optionsBuilder.UseSqlite("Data Source=Storage.db");
}
#region Overrides of DbContext
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
// Composite keys must be configured with fluent API in Core
modelBuilder.Entity<Layer>().HasKey(l => new {l.ProfileId, l.Name});
base.OnModelCreating(modelBuilder);
}
#endregion
}
}