Optimized code(again), TXLib added to resources, and compiling is in new thread now

This commit is contained in:
DarkCat09 2020-10-08 19:07:23 +04:00
parent 4d22e9dbbc
commit f5b399abf7
24 changed files with 9005 additions and 8619 deletions

380
.gitignore vendored
View file

@ -1,32 +1,362 @@
# Prerequisites
*.d
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
##
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
# Compiled Object files
*.slo
*.lo
*.o
# User-specific files
*.rsuser
*.suo
*.user
*.userosscache
*.sln.docstates
# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs
# Mono auto generated files
mono_crash.*
# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
[Ww][Ii][Nn]32/
[Aa][Rr][Mm]/
[Aa][Rr][Mm]64/
bld/
[Bb]in/
[Oo]bj/
[Ll]og/
[Ll]ogs/
# Visual Studio 2015/2017 cache/options directory
.vs/
# Uncomment if you have tasks that create the project's static files in wwwroot
#wwwroot/
# Visual Studio 2017 auto generated files
Generated\ Files/
# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
# NUnit
*.VisualState.xml
TestResult.xml
nunit-*.xml
# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
dlldata.c
# Benchmark Results
BenchmarkDotNet.Artifacts/
# .NET Core
project.lock.json
project.fragment.lock.json
artifacts/
# ASP.NET Scaffolding
ScaffoldingReadMe.txt
# StyleCop
StyleCopReport.xml
# Files built by Visual Studio
*_i.c
*_p.c
*_h.h
*.ilk
*.meta
*.obj
# Precompiled Headers
*.gch
*.iobj
*.pch
*.pdb
*.ipdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*_wpftmp.csproj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc
# Compiled Dynamic libraries
*.so
*.dylib
*.dll
# Chutzpah Test files
_Chutzpah*
# Fortran module files
*.mod
*.smod
# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opendb
*.opensdf
*.sdf
*.cachefile
*.VC.db
*.VC.VC.opendb
# Compiled Static libraries
*.lai
*.la
*.a
*.lib
# Visual Studio profiler
*.psess
*.vsp
*.vspx
*.sap
# Executables
*.exe
*.out
*.app
# Visual Studio Trace Files
*.e2e
# TFS 2012 Local Workspace
$tf/
# Guidance Automation Toolkit
*.gpState
# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user
# TeamCity is a build add-in
_TeamCity*
# DotCover is a Code Coverage Tool
*.dotCover
# AxoCover is a Code Coverage Tool
.axoCover/*
!.axoCover/settings.json
# Coverlet is a free, cross platform Code Coverage Tool
coverage*.json
coverage*.xml
coverage*.info
# Visual Studio code coverage results
*.coverage
*.coveragexml
# NCrunch
_NCrunch_*
.*crunch*.local.xml
nCrunchTemp_*
# MightyMoose
*.mm.*
AutoTest.Net/
# Web workbench (sass)
.sass-cache/
# Installshield output folder
[Ee]xpress/
# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html
# Click-Once directory
publish/
# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
# Note: Comment the next line if you want to checkin your web deploy settings,
# but database connection strings (with potential passwords) will be unencrypted
*.pubxml
*.publishproj
# Microsoft Azure Web App publish settings. Comment the next line if you want to
# checkin your Azure Web App publish settings, but sensitive information contained
# in these scripts will be unencrypted
PublishScripts/
# NuGet Packages
*.nupkg
# NuGet Symbol Packages
*.snupkg
# The packages folder can be ignored because of Package Restore
**/[Pp]ackages/*
# except build/, which is used as an MSBuild target.
!**/[Pp]ackages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/[Pp]ackages/repositories.config
# NuGet v3's project.json files produces more ignorable files
*.nuget.props
*.nuget.targets
# Microsoft Azure Build Output
csx/
*.build.csdef
# Microsoft Azure Emulator
ecf/
rcf/
# Windows Store app package directories and files
AppPackages/
BundleArtifacts/
Package.StoreAssociation.xml
_pkginfo.txt
*.appx
*.appxbundle
*.appxupload
# Visual Studio cache files
# files ending in .cache can be ignored
*.[Cc]ache
# but keep track of directories ending in .cache
!?*.[Cc]ache/
# Others
ClientBin/
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.jfm
*.pfx
*.publishsettings
orleans.codegen.cs
# Including strong name files can present a security risk
# (https://github.com/github/gitignore/pull/2483#issue-259490424)
#*.snk
# Since there are multiple workflows, uncomment next line to ignore bower_components
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
#bower_components/
# RIA/Silverlight projects
Generated_Code/
# Backup & report files from converting an old project file
# to a newer Visual Studio version. Backup files are not needed,
# because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm
ServiceFabricBackup/
*.rptproj.bak
# SQL Server files
*.mdf
*.ldf
*.ndf
# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings
*.rptproj.rsuser
*- [Bb]ackup.rdl
*- [Bb]ackup ([0-9]).rdl
*- [Bb]ackup ([0-9][0-9]).rdl
# Microsoft Fakes
FakesAssemblies/
# GhostDoc plugin setting file
*.GhostDoc.xml
# Node.js Tools for Visual Studio
.ntvs_analysis.dat
node_modules/
# Visual Studio 6 build log
*.plg
# Visual Studio 6 workspace options file
*.opt
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
*.vbw
# Visual Studio LightSwitch build output
**/*.HTMLClient/GeneratedArtifacts
**/*.DesktopClient/GeneratedArtifacts
**/*.DesktopClient/ModelManifest.xml
**/*.Server/GeneratedArtifacts
**/*.Server/ModelManifest.xml
_Pvt_Extensions
# Paket dependency manager
.paket/paket.exe
paket-files/
# FAKE - F# Make
.fake/
# CodeRush personal settings
.cr/personal
# Python Tools for Visual Studio (PTVS)
__pycache__/
*.pyc
# Cake - Uncomment if you are using it
# tools/**
# !tools/packages.config
# Tabs Studio
*.tss
# Telerik's JustMock configuration file
*.jmconfig
# BizTalk build output
*.btp.cs
*.btm.cs
*.odx.cs
*.xsd.cs
# OpenCover UI analysis results
OpenCover/
# Azure Stream Analytics local run output
ASALocalRun/
# MSBuild Binary and Structured Log
*.binlog
# NVidia Nsight GPU debugger configuration file
*.nvuser
# MFractors (Xamarin productivity tool) working folder
.mfractor/
# Local History for Visual Studio
.localhistory/
# BeatPulse healthcheck temp database
healthchecksdb
# Backup folder for Package Reference Convert tool in Visual Studio 2017
MigrationBackup/
# Ionide (cross platform F# VS Code tools) working folder
.ionide/
# Fody - auto-generated XML schema
FodyWeavers.xsd

View file

@ -2,6 +2,7 @@
using System.Diagnostics;
using System.IO;
using System.Text;
using System.Threading;
using System.Windows.Forms;
namespace WindowsFormsApplication1
@ -47,7 +48,22 @@ namespace WindowsFormsApplication1
textBox2.Text += ("Компиляция " + codeFilename + " в " +
Path.GetFileNameWithoutExtension(codeFilename) + ".exe с помощью " +
mingwDir + "\\bin\\mingw32-g++.exe:" + Environment.NewLine + Environment.NewLine);
new Thread(new ThreadStart(CompilingFunction)).Start();
}
catch (Exception ex)
{
_ = MessageBox.Show("Произошла ошибка!\n" + ex.Message);
}
}
else
{
_ = MessageBox.Show("Сначала укажите каталог с MinGW!", "Ошибка",
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void CompilingFunction()
{
Process mingwp = new Process();
mingwp.StartInfo = new ProcessStartInfo()
{
@ -67,25 +83,13 @@ namespace WindowsFormsApplication1
mingwp.Start();
mingwp.BeginOutputReadLine();
mingwp.BeginErrorReadLine();
mingwp.WaitForExit(10000);
_ = MessageBox.Show("Готово!");
}
catch (Exception ex)
{
_ = MessageBox.Show("Произошла ошибка!\n" + ex.Message);
}
}
else
{
_ = MessageBox.Show("Сначала укажите каталог с MinGW!", "Ошибка",
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
mingwp.WaitForExit(20000);
textBox2.Invoke(new Action(() => { textBox2.AppendText("Готово!" + Environment.NewLine); }));
}
private void CompilerOutputHandler(object sendingProcess, DataReceivedEventArgs outputLine)
{
textBox2.Invoke(new Action(() => { textBox2.Text += (outputLine.Data + Environment.NewLine); }));
textBox2.Invoke(new Action(() => { textBox2.AppendText(outputLine.Data + Environment.NewLine); }));
}
}
}

View file

@ -238,11 +238,13 @@ namespace WindowsFormsApplication1
}
if (saveFileDialog1.ShowDialog() == DialogResult.OK)
{
try
{
mainFilename = saveFileDialog1.FileName;
//Adding TXLibrary and pictures
File.Copy("TXLib.h", Path.GetDirectoryName(mainFilename) + "\\TXLib.h", true);
File.WriteAllText(Path.GetDirectoryName(mainFilename) + "\\TXLib.h", Properties.Resources.TXLib);
string dir_path = Path.GetDirectoryName(mainFilename) + "\\Pictures";
if (!Directory.Exists(dir_path))
{
@ -312,6 +314,12 @@ namespace WindowsFormsApplication1
MessageBox.Show("Готово!");
}
catch (Exception ex)
{
_ = MessageBox.Show("Произошла ошибка!\n" + ex.Message, "Ошибка",
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
}
private void Char_Creator_Button_Click(object sender, MouseEventArgs e)
@ -344,11 +352,11 @@ namespace WindowsFormsApplication1
private void Char_Info_Click(object sender, EventArgs e)
{
this.leftPanel.Controls.Remove(persons[nomerPersa - 1].l1);
this.leftPanel.Controls.Remove(persons[nomerPersa - 1].l2);
this.leftPanel.Controls.Remove(persons[nomerPersa - 1].l3);
this.leftPanel.Controls.Remove(persons[nomerPersa - 1].b1);
this.leftPanel.Controls.Remove(persons[nomerPersa - 1].b2);
leftPanel.Controls.Remove(persons[nomerPersa - 1].l1);
leftPanel.Controls.Remove(persons[nomerPersa - 1].l2);
leftPanel.Controls.Remove(persons[nomerPersa - 1].l3);
leftPanel.Controls.Remove(persons[nomerPersa - 1].b1);
leftPanel.Controls.Remove(persons[nomerPersa - 1].b2);
nomerPersa--;
yPersa -= 30;
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 147 KiB

After

Width:  |  Height:  |  Size: 147 KiB

View file

@ -19,7 +19,7 @@ namespace WindowsFormsApplication1.Properties {
// с помощью такого средства, как ResGen или Visual Studio.
// Чтобы добавить или удалить член, измените файл .ResX и снова запустите ResGen
// с параметром /str или перестройте свой проект VS.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
@ -59,5 +59,20 @@ namespace WindowsFormsApplication1.Properties {
resourceCulture = value;
}
}
/// <summary>
/// Ищет локализованную строку, похожую на //=================================================================================================================
///// [These sections are for folding control in Code::Blocks]
/////{ [Best viewed with &quot;Fold all on file open&quot; option enabled] [best screen width is 115 chars]
/////=================================================================================================================
/////!
/////! @file TXLib.h
/////! @brief Библиотека Тупого Художника (The Dumb Artist Libr [остаток строки не уместился]&quot;;.
/// </summary>
internal static string TXLib {
get {
return ResourceManager.GetString("TXLib", resourceCulture);
}
}
}
}

View file

@ -46,7 +46,7 @@
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
@ -60,6 +60,7 @@
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
@ -68,9 +69,10 @@
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" />
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
@ -85,9 +87,10 @@
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
@ -109,9 +112,13 @@
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="TXLib" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\TXLib.h;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;windows-1251</value>
</data>
</root>

View file

@ -94,6 +94,9 @@
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
</ItemGroup>
<ItemGroup>
<None Include="TXLib.h" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.

View file

@ -0,0 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1"/></startup></configuration>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

View file

@ -0,0 +1,4 @@
// <autogenerated />
using System;
using System.Reflection;
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.6.1", FrameworkDisplayName = ".NET Framework 4.6.1")]

View file

@ -0,0 +1 @@
a71191b9b8c49cadecaa2e05cc537d361f14ffd5

View file

@ -0,0 +1,11 @@
C:\Users\Acer\VisualStudio\source\repos\MultRedactor\WindowsFormsApplication1\WindowsFormsApplication1\bin\Debug\WindowsFormsApplication1.exe.config
C:\Users\Acer\VisualStudio\source\repos\MultRedactor\WindowsFormsApplication1\WindowsFormsApplication1\bin\Debug\WindowsFormsApplication1.exe
C:\Users\Acer\VisualStudio\source\repos\MultRedactor\WindowsFormsApplication1\WindowsFormsApplication1\bin\Debug\WindowsFormsApplication1.pdb
C:\Users\Acer\VisualStudio\source\repos\MultRedactor\WindowsFormsApplication1\WindowsFormsApplication1\obj\Debug\WindowsFormsApplication1.csprojAssemblyReference.cache
C:\Users\Acer\VisualStudio\source\repos\MultRedactor\WindowsFormsApplication1\WindowsFormsApplication1\obj\Debug\WindowsFormsApplication1.CompileForm.resources
C:\Users\Acer\VisualStudio\source\repos\MultRedactor\WindowsFormsApplication1\WindowsFormsApplication1\obj\Debug\WindowsFormsApplication1.MainForm.resources
C:\Users\Acer\VisualStudio\source\repos\MultRedactor\WindowsFormsApplication1\WindowsFormsApplication1\obj\Debug\WindowsFormsApplication1.Properties.Resources.resources
C:\Users\Acer\VisualStudio\source\repos\MultRedactor\WindowsFormsApplication1\WindowsFormsApplication1\obj\Debug\WindowsFormsApplication1.csproj.GenerateResource.cache
C:\Users\Acer\VisualStudio\source\repos\MultRedactor\WindowsFormsApplication1\WindowsFormsApplication1\obj\Debug\WindowsFormsApplication1.csproj.CoreCompileInputs.cache
C:\Users\Acer\VisualStudio\source\repos\MultRedactor\WindowsFormsApplication1\WindowsFormsApplication1\obj\Debug\WindowsFormsApplication1.exe
C:\Users\Acer\VisualStudio\source\repos\MultRedactor\WindowsFormsApplication1\WindowsFormsApplication1\obj\Debug\WindowsFormsApplication1.pdb