using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;
namespace Memopad
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void 保存ToolStripMenuItem_Click(object sender, EventArgs e)
{
SaveFileDialog dialog = new SaveFileDialog();
dialog.Filter = "テキストファイル(*.txt)|*.txt|すべてのファイル(*.*)|*.*";
//dialog.Title = "ファイルを保存する";
if (dialog.ShowDialog() == DialogResult.OK)
File.WriteAllText(dialog.FileName, textBox1.Text);
}
private void 読み込みToolStripMenuItem_Click(object sender, EventArgs e)
{
OpenFileDialog dialog = new OpenFileDialog();
dialog.Filter = "テキストファイル(*.txt)|*.txt|すべてのファイル(*.*)|*.*";
//dialog.Title = "ファイルを読み込む";
if (dialog.ShowDialog() == DialogResult.OK)
textBox1.Text = File.ReadAllText(dialog.FileName);
}
private void 終了ToolStripMenuItem_Click(object sender, EventArgs e)
{
Close();
}
private void 元に戻すToolStripMenuItem_Click(object sender, EventArgs e)
{
textBox1.Undo();
}
}
}
dXNpbmcgU3lzdGVtOwp1c2luZyBTeXN0ZW0uQ29sbGVjdGlvbnMuR2VuZXJpYzsKdXNpbmcgU3lzdGVtLkNvbXBvbmVudE1vZGVsOwp1c2luZyBTeXN0ZW0uRGF0YTsKdXNpbmcgU3lzdGVtLkRyYXdpbmc7CnVzaW5nIFN5c3RlbS5MaW5xOwp1c2luZyBTeXN0ZW0uVGV4dDsKdXNpbmcgU3lzdGVtLldpbmRvd3MuRm9ybXM7CnVzaW5nIFN5c3RlbS5JTzsKCm5hbWVzcGFjZSBNZW1vcGFkCnsKICAgIHB1YmxpYyBwYXJ0aWFsIGNsYXNzIEZvcm0xIDogRm9ybQogICAgewogICAgICAgIHB1YmxpYyBGb3JtMSgpCiAgICAgICAgewogICAgICAgICAgICBJbml0aWFsaXplQ29tcG9uZW50KCk7CiAgICAgICAgfQoKICAgICAgICBwcml2YXRlIHZvaWQg5L+d5a2YVG9vbFN0cmlwTWVudUl0ZW1fQ2xpY2sob2JqZWN0IHNlbmRlciwgRXZlbnRBcmdzIGUpCiAgICAgICAgewogICAgICAgICAgICBTYXZlRmlsZURpYWxvZyBkaWFsb2cgPSBuZXcgU2F2ZUZpbGVEaWFsb2coKTsKICAgICAgICAgICAgZGlhbG9nLkZpbHRlciA9ICLjg4bjgq3jgrnjg4jjg5XjgqHjgqTjg6soKi50eHQpfCoudHh0fOOBmeOBueOBpuOBruODleOCoeOCpOODqygqLiopfCouKiI7CiAgICAgICAgICAgIC8vZGlhbG9nLlRpdGxlID0gIuODleOCoeOCpOODq+OCkuS/neWtmOOBmeOCiyI7CiAgICAgICAgICAgIGlmIChkaWFsb2cuU2hvd0RpYWxvZygpID09IERpYWxvZ1Jlc3VsdC5PSykKICAgICAgICAgICAgICAgIEZpbGUuV3JpdGVBbGxUZXh0KGRpYWxvZy5GaWxlTmFtZSwgdGV4dEJveDEuVGV4dCk7CiAgICAgICAgfQoKICAgICAgICBwcml2YXRlIHZvaWQg6Kqt44G/6L6844G/VG9vbFN0cmlwTWVudUl0ZW1fQ2xpY2sob2JqZWN0IHNlbmRlciwgRXZlbnRBcmdzIGUpCiAgICAgICAgewogICAgICAgICAgICBPcGVuRmlsZURpYWxvZyBkaWFsb2cgPSBuZXcgT3BlbkZpbGVEaWFsb2coKTsKICAgICAgICAgICAgZGlhbG9nLkZpbHRlciA9ICLjg4bjgq3jgrnjg4jjg5XjgqHjgqTjg6soKi50eHQpfCoudHh0fOOBmeOBueOBpuOBruODleOCoeOCpOODqygqLiopfCouKiI7CiAgICAgICAgICAgIC8vZGlhbG9nLlRpdGxlID0gIuODleOCoeOCpOODq+OCkuiqreOBv+i+vOOCgCI7CiAgICAgICAgICAgIGlmIChkaWFsb2cuU2hvd0RpYWxvZygpID09IERpYWxvZ1Jlc3VsdC5PSykKICAgICAgICAgICAgICAgIHRleHRCb3gxLlRleHQgPSAgRmlsZS5SZWFkQWxsVGV4dChkaWFsb2cuRmlsZU5hbWUpOwogICAgICAgIH0KCiAgICAgICAgcHJpdmF0ZSB2b2lkIOe1guS6hlRvb2xTdHJpcE1lbnVJdGVtX0NsaWNrKG9iamVjdCBzZW5kZXIsIEV2ZW50QXJncyBlKQogICAgICAgIHsKICAgICAgICAgICAgQ2xvc2UoKTsKICAgICAgICB9CgogICAgICAgIHByaXZhdGUgdm9pZCDlhYPjgavmiLvjgZlUb29sU3RyaXBNZW51SXRlbV9DbGljayhvYmplY3Qgc2VuZGVyLCBFdmVudEFyZ3MgZSkKICAgICAgICB7CiAgICAgICAgICAgIHRleHRCb3gxLlVuZG8oKTsKICAgICAgICB9CiAgICB9Cn0K