Skip to content

Commit

Permalink
KCore 0.2.0
Browse files Browse the repository at this point in the history
work with #10, #11
fix #9
new dashbord, kcore storage, localizations, inifile refactoring
  • Loading branch information
AIexandrKotov committed Jan 1, 2024
1 parent 9760a3d commit bc3e1d7
Show file tree
Hide file tree
Showing 54 changed files with 3,600 additions and 611 deletions.
6 changes: 6 additions & 0 deletions Editor/App.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
</startup>
</configuration>
59 changes: 59 additions & 0 deletions Editor/ConsoleControl.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
using KCore;
using KCore.Graphics;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;

namespace Editor
{
public class ConsoleControl : Form
{
private object sync = new object();
public static ConsoleRequestPack ConsoleThreadRequest;
public static ConsoleRequestPack MainFormThreadRequest;
public static bool RequestSended;

public ConsoleControl() : base()
{
AllowedDashboard = false;
Bind(new DelegateRequest(this, form => true, form =>
{
Program.GetWindowRect(Program.ConsoleHandler, ref Program.ConsoleRect);
Program.MainForm.MoveRequest = true;
}));
Bind(new DelegateRequest(this, form => RequestSended, form =>
{
lock (sync) ConsoleThreadRequest = MainFormThreadRequest;
RequestSended = false;
}));
Bind(new DelegateRequest(this, form =>
{
lock (sync) return ConsoleThreadRequest != null;
}, form =>
{
lock (sync)
{
ConsoleThreadRequest.Invoke();
ConsoleThreadRequest = null;
}
}));
}

protected override void OnOpening()
{
while (Program.MainForm == null)
Thread.Sleep(100);
}

protected override void OnKeyDown(byte key)
{
if (key == 1)
if (Program.MainForm != null)
Program.MainForm.ClickRequest = true;
}
}
}
29 changes: 29 additions & 0 deletions Editor/ConsoleRequestPack.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
using KCore.Graphics.Widgets;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Editor
{
public abstract class ConsoleRequestPack
{
public abstract void Invoke();
public void Send()
{
ConsoleControl.MainFormThreadRequest = this;
ConsoleControl.RequestSended = true;
}
}

public class SimpleRequest : ConsoleRequestPack
{
public SimpleRequest(Action action) => Action = action;
public Action Action { get; set; }
public override void Invoke()
{
Action.Invoke();
}
}
}
97 changes: 97 additions & 0 deletions Editor/Editor.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{7450C379-DD7C-410E-A122-A96EF8082F37}</ProjectGuid>
<OutputType>Exe</OutputType>
<RootNamespace>Editor</RootNamespace>
<AssemblyName>Editor</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>..\bin\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>..\bin\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
<StartupObject />
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="ConsoleControl.cs" />
<Compile Include="ConsoleRequestPack.cs" />
<Compile Include="MainForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="MainForm.Designer.cs">
<DependentUpon>MainForm.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="MainForm.resx">
<DependentUpon>MainForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\KCore\KCore.csproj">
<Project>{FE2FBEFB-28CC-4928-B11B-D22BD7DFE137}</Project>
<Name>KCore</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PreBuildEvent>../building/IncEditorRevision.bat</PreBuildEvent>
</PropertyGroup>
</Project>
138 changes: 138 additions & 0 deletions Editor/MainForm.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit bc3e1d7

Please sign in to comment.