commit 970223f7124cfc643d9f3d94b37eeba19c27dcfd Author: Alexander Popov Date: Sun Feb 12 00:23:46 2017 +0300 demo^Wfirst release diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..6e5a4bb --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +DefectRand.exe diff --git a/AssemblyInfo.cs b/AssemblyInfo.cs new file mode 100644 index 0000000..b53a655 --- /dev/null +++ b/AssemblyInfo.cs @@ -0,0 +1,17 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +[assembly: AssemblyTitle("DefectRand")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("OWNER")] +[assembly: AssemblyProduct("Рандомайзер дефектов")] +[assembly: AssemblyCopyright("2017 by iiiypuk")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +[assembly: ComVisible(false)] + +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..0d83115 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2017 Alexander Popov + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..10e4145 --- /dev/null +++ b/Makefile @@ -0,0 +1,5 @@ +CS=csc /nologo +TARGET=DefectRand.exe + +DefectRand.exe: + $(CS) /out:DefectRand.exe main.cs AssemblyInfo.cs /win32icon:app.ico diff --git a/app.ico b/app.ico new file mode 100644 index 0000000..1ac0c7a Binary files /dev/null and b/app.ico differ diff --git a/main.cs b/main.cs new file mode 100644 index 0000000..0338c03 --- /dev/null +++ b/main.cs @@ -0,0 +1,81 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Windows.Forms; + +namespace DefectRand +{ + partial class MainForm : Form + { + string[] defectStrings = { + "Аккумуляторный отсек требует обслуживания.", + "Не горит подсветка приборной панели." + }; + public MainForm() + { + InitializeComponent(); + } + private System.ComponentModel.IContainer components = null; + + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + private void InitializeComponent() + { + this.randButton = new System.Windows.Forms.Button(); + this.textField = new System.Windows.Forms.RichTextBox(); + this.SuspendLayout(); + + this.randButton.Location = new System.Drawing.Point(13, 231); + this.randButton.Name = "randButton"; + this.randButton.Size = new System.Drawing.Size(263, 23); + this.randButton.TabIndex = 0; + this.randButton.Text = "Ещё"; + this.randButton.UseVisualStyleBackColor = true; + randButton.Click += new EventHandler(getDefect); + + this.textField.Font = new System.Drawing.Font("Times New Roman", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204))); + this.textField.Location = new System.Drawing.Point(13, 13); + this.textField.Name = "textField"; + this.textField.Size = new System.Drawing.Size(263, 212); + this.textField.TabIndex = 1; + this.textField.Text = "Рандомайзер дефектов\nспециально для ВМО\n2017 by iiiypuk"; + + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(288, 266); + this.Controls.Add(this.textField); + this.Controls.Add(this.randButton); + this.Name = "MainForm"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; + this.Text = "DefectRand - 1.0"; + this.ResumeLayout(false); + } + + private void getDefect(object sender, EventArgs e) + { + // MessageBox.Show("Hello World"); + this.textField.Text = defectStrings[new Random().Next(0, defectStrings.Length)]; + } + + private System.Windows.Forms.Button randButton; + private System.Windows.Forms.RichTextBox textField; + } + + static class Program + { + [STAThread] + public static void Main() + { + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + Application.Run(new MainForm()); + } + } +}