Skip to content

Commit

Permalink
Добавил исходный код
Browse files Browse the repository at this point in the history
  • Loading branch information
Zalexanninev15 authored Oct 14, 2019
1 parent cbff0cc commit 81088c4
Show file tree
Hide file tree
Showing 50 changed files with 106,189 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Source/App.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
</configuration>
288 changes: 288 additions & 0 deletions Source/Form1.Designer.cs

Large diffs are not rendered by default.

138 changes: 138 additions & 0 deletions Source/Form1.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using MaterialSkin.Animations;
using MaterialSkin.Controls;
using MaterialSkin;

namespace Translator
{
public partial class Form1 : MaterialForm
{
Form f;
YandexTranslator yt;

public Form1()
{
InitializeComponent();

yt = new YandexTranslator();

// Дефолтная тема
var materialSkinManager = MaterialSkinManager.Instance;
materialSkinManager.AddFormToManage(this);

materialSkinManager.Theme = MaterialSkinManager.Themes.LIGHT;
materialSkinManager.ColorScheme = new ColorScheme(Primary.Red500, Primary.Red700, Primary.Red100, Accent.Blue200, TextShade.WHITE);
// 1 - под заголовком, 2 - заголовок, 3 - ?, 4 - элементы выбора

}

private void MaterialRadioButton2_CheckedChanged(object sender, EventArgs e)
{

}

private void Form1_Load_1(object sender, EventArgs e)
{

}

private void B_w_CheckedChanged_1(object sender, EventArgs e)
{
if (b_w.Checked)
{
//Включение тёмной темы (галочка)
b_w.Text = "ТЁМНАЯ ТЕМА";
var materialSkinManager = MaterialSkinManager.Instance;
materialSkinManager.Theme = MaterialSkinManager.Themes.DARK;
materialSkinManager.ColorScheme = new ColorScheme(Primary.Blue500, Primary.Blue700, Primary.Blue100, Accent.Yellow200, TextShade.WHITE);
//materialSkinManager.ColorScheme = new ColorScheme(Primary.Cyan500, Primary.Cyan700, Primary.Cyan100, Accent.Yellow200, TextShade.WHITE);
}
if (!b_w.Checked)
{
//Выключение тёмной темы (галочка) (включение дефолтной темы)
b_w.Text = "ТЁМНАЯ ТЕМА";
var materialSkinManager = MaterialSkinManager.Instance;
materialSkinManager.Theme = MaterialSkinManager.Themes.LIGHT;
//materialSkinManager.ColorScheme = new ColorScheme(Primary.Red600, Primary.Red700, Primary.Red400, Accent.Yellow700, TextShade.WHITE);
materialSkinManager.ColorScheme = new ColorScheme(Primary.Red500, Primary.Red700, Primary.Red100, Accent.Blue200, TextShade.WHITE);
}
}

private void MaterialFlatButton1_Click(object sender, EventArgs e)
{
inputTextBox.Clear();
outputTextBox.Clear();
}

private void MaterialFlatButton2_Click_1(object sender, EventArgs e)
{
f = new Form2();
f.Show();
b_w.Checked = false;
}

private void MaterialFlatButton4_Click(object sender, EventArgs e)
{
Clipboard.Clear();
Clipboard.SetText(outputTextBox.Text);
}

private void MaterialRaisedButton1_Click(object sender, EventArgs e)
{
string lang;

if (materialRadioButton1.Checked == true)
{
lang = "ru-en";
}
else
{
lang = "en-ru";
}

outputTextBox.Text = yt.Translate(inputTextBox.Text, lang);
}

private void MaterialRaisedButton3_Click(object sender, EventArgs e)
{
Clipboard.Clear();
Clipboard.SetText(outputTextBox.Text);
}

private void MaterialRaisedButton4_Click(object sender, EventArgs e)
{
inputTextBox.Clear();
outputTextBox.Clear();
}

private void MaterialRadioButton2_CheckedChanged_1(object sender, EventArgs e)
{

}

private void MaterialRaisedButton2_Click(object sender, EventArgs e)
{
f = new Form2();
f.Show();
b_w.Checked = false;
}

private void MaterialRaisedButton5_Click(object sender, EventArgs e)
{
System.Diagnostics.Process.Start("https://translate.yandex.ru");
}

private void materialRaisedButton6_Click(object sender, EventArgs e)
{
inputTextBox.Text = Clipboard.GetText(); ;
}
}
}
Loading

0 comments on commit 81088c4

Please sign in to comment.