Skip to content

Commit

Permalink
#38 + #39
Browse files Browse the repository at this point in the history
  • Loading branch information
hovrawl committed Jul 19, 2022
1 parent 536cc44 commit c91c6ba
Show file tree
Hide file tree
Showing 27 changed files with 1,168 additions and 68 deletions.
454 changes: 454 additions & 0 deletions AvaloniaMisterDoctor/.gitignore

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions AvaloniaMisterDoctor/App.axaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<Application xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:themes="clr-namespace:Material.Styles.Themes;assembly=Material.Styles"
x:Class="AvaloniaMisterDoctor.App">
<Application.Styles>
<FluentTheme Mode="Light"/>
<themes:MaterialTheme BaseTheme="Dark" PrimaryColor="Purple" SecondaryColor="Lime" />
<StyleInclude Source="avares://Material.Icons.Avalonia/App.xaml"></StyleInclude>

</Application.Styles>
</Application>
24 changes: 24 additions & 0 deletions AvaloniaMisterDoctor/App.axaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using Avalonia;
using Avalonia.Controls.ApplicationLifetimes;
using Avalonia.Markup.Xaml;

namespace AvaloniaMisterDoctor
{
public partial class App : Application
{
public override void Initialize()
{
AvaloniaXamlLoader.Load(this);
}

public override void OnFrameworkInitializationCompleted()
{
if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
{
desktop.MainWindow = new MainWindow();
}

base.OnFrameworkInitializationCompleted();
}
}
}
35 changes: 35 additions & 0 deletions AvaloniaMisterDoctor/AvaloniaMisterDoctor.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
<!--Avalonia doesen't support TrimMode=link currently,but we are working on that https://github.com/AvaloniaUI/Avalonia/issues/6892 -->
<TrimMode>copyused</TrimMode>
<BuiltInComInteropSupport>true</BuiltInComInteropSupport>
</PropertyGroup>
<ItemGroup>
<None Remove=".gitignore" />
</ItemGroup>
<ItemGroup>
<!--This helps with theme dll-s trimming.
If you will publish your application in self-contained mode with p:PublishTrimmed=true and it will use Fluent theme Default theme will be trimmed from the output and vice versa.
https://github.com/AvaloniaUI/Avalonia/issues/5593 -->
<TrimmableAssembly Include="Avalonia.Themes.Fluent" />
<TrimmableAssembly Include="Avalonia.Themes.Default" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Avalonia" Version="0.10.16" />
<PackageReference Include="Avalonia.Desktop" Version="0.10.14" />
<!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="0.10.14" />
<PackageReference Include="Material.Avalonia" Version="3.0.0-rc0.98-nightly" />
<PackageReference Include="Material.Icons.Avalonia" Version="1.1.10" />
<PackageReference Include="XamlNameReferenceGenerator" Version="1.3.4" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\EngineDoctor\EngineDoctor.csproj" />
</ItemGroup>
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Exec Command="xcopy &quot;$(ProjectDir)Dependencies\nounlist.txt&quot; &quot;$(TargetDir)&quot; /Y /I" />
</Target>
</Project>
File renamed without changes.
55 changes: 55 additions & 0 deletions AvaloniaMisterDoctor/MainWindow.axaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<Window xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:material="using:Material.Icons.Avalonia"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="AvaloniaMisterDoctor.MainWindow"
Title="AvaloniaMisterDoctor">
<Panel>
<!-- Add button to panel -->
<TabControl>
<TabItem VerticalContentAlignment="Center">
<TabItem.Header>
<TextBlock VerticalAlignment="Center">Main</TextBlock>
</TabItem.Header>
<StackPanel >
<TextBlock Text="This is the landing page for the bot! Configure you login if not setup." HorizontalAlignment="Left" VerticalAlignment="Center"/>

<Button Margin="5">
<WrapPanel>
<TextBlock Text="Login" HorizontalAlignment="Left" VerticalAlignment="Center"/>
<material:MaterialIcon Kind="Login"></material:MaterialIcon>
</WrapPanel>
</Button>
<Button Name="BtnBotStart" Margin="5" Click="BtnBotStart_OnClick">
<WrapPanel>
<TextBlock Text="Start Bot" HorizontalAlignment="Left" VerticalAlignment="Center"/>
<material:MaterialIcon Kind="Login"></material:MaterialIcon>
</WrapPanel>
</Button>
</StackPanel>
</TabItem>
<TabItem>
<TabItem.Header>
<TextBlock VerticalAlignment="Center">Plugins</TextBlock>
</TabItem.Header>
<StackPanel>
<TextBlock Text="I am in the triangle page ! I'll put a button to show you that each page contains what you want." HorizontalAlignment="Left" VerticalAlignment="Center"/>
<Button>A button in the triangle page !</Button>
<material:MaterialIcon Kind="Abacus"></material:MaterialIcon>
</StackPanel>
</TabItem>
<TabItem>
<TabItem.Header>
<TextBlock VerticalAlignment="Center">Options</TextBlock>
</TabItem.Header>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Square : " HorizontalAlignment="Left" VerticalAlignment="Center"/>
<Rectangle Fill="Blue" Width="63" Height="41"/>
</StackPanel>
</TabItem>
</TabControl>
</Panel>

</Window>
24 changes: 24 additions & 0 deletions AvaloniaMisterDoctor/MainWindow.axaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using Avalonia.Controls;
using Avalonia.Interactivity;
using EngineDoctor;
using EngineDoctor.Helpers;

namespace AvaloniaMisterDoctor
{
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
var appSettings = DbHelper.ReadConnectionSettings();
Engine.Setup(appSettings);
}

private void BtnBotStart_OnClick(object? sender, RoutedEventArgs e)
{
// Button Bot Start Click event handler

Engine.Connect();
}
}
}
21 changes: 21 additions & 0 deletions AvaloniaMisterDoctor/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
using Avalonia;
using System;

namespace AvaloniaMisterDoctor
{
class Program
{
// Initialization code. Don't use any Avalonia, third-party APIs or any
// SynchronizationContext-reliant code before AppMain is called: things aren't initialized
// yet and stuff might break.
[STAThread]
public static void Main(string[] args) => BuildAvaloniaApp()
.StartWithClassicDesktopLifetime(args);

// Avalonia configuration, don't remove; also used by visual designer.
public static AppBuilder BuildAvaloniaApp()
=> AppBuilder.Configure<App>()
.UsePlatformDetect()
.LogToTrace();
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace MisterDoctor.Classes
namespace EngineDoctor.Classes
{
internal class ConnectionDto : ConnectionSettings
public class ConnectionDto : ConnectionSettings
{
public int Id { get; set; }

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace MisterDoctor.Classes
namespace EngineDoctor.Classes
{
public class ConnectionSettings
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System;

namespace MisterDoctor.Classes
namespace EngineDoctor.Classes
{
public class IgnoredUser
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System;

namespace MisterDoctor.Classes
namespace EngineDoctor.Classes
{
public class PluginState
{
Expand Down
6 changes: 6 additions & 0 deletions EngineDoctor/Classes/PluginStates.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
namespace EngineDoctor.Classes
{
public class PluginStates : List<PluginState>
{
}
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
using System;
using MisterDoctor.Plugins;
using MisterDoctor.Plugins;
using MisterDoctor.Plugins.Classes;

namespace MisterDoctor.Classes
namespace EngineDoctor.Classes
{
public class SettingsDto
{
Expand Down
Loading

0 comments on commit c91c6ba

Please sign in to comment.