demo^Wfirst release

This commit is contained in:
Alexander Popov 2017-02-12 00:23:46 +03:00
commit 970223f712
6 changed files with 125 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
DefectRand.exe

17
AssemblyInfo.cs Normal file
View File

@ -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")]

21
LICENSE Normal file
View File

@ -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.

5
Makefile Normal file
View File

@ -0,0 +1,5 @@
CS=csc /nologo
TARGET=DefectRand.exe
DefectRand.exe:
$(CS) /out:DefectRand.exe main.cs AssemblyInfo.cs /win32icon:app.ico

BIN
app.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

81
main.cs Normal file
View File

@ -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());
}
}
}