Adjusted Code to StyleGuide

main
Thomas Ba. 8 years ago
parent bf6720a047
commit a8a5e70e74

@ -2,15 +2,15 @@
namespace NoteMan namespace NoteMan
{ {
class Appointment : Element public class Appointment : Element
{ {
private DateTime start; public DateTime Start { get; set; }
private DateTime end; public DateTime End { get; set; }
public Appointment() public Appointment()
{ {
start = new DateTime(); Start = DateTime.Now;
end = new DateTime(); End = DateTime.Now;
} }
public Appointment(string title, string text, DateTime start, DateTime end) : base(title, text) public Appointment(string title, string text, DateTime start, DateTime end) : base(title, text)
@ -20,8 +20,8 @@ namespace NoteMan
Console.Out.WriteLine("DateTimeComparison: end < start!"); Console.Out.WriteLine("DateTimeComparison: end < start!");
throw new EndBeforeStartException(); throw new EndBeforeStartException();
} }
this.start = start; Start = start;
this.end = end; End = end;
} }
@ -33,8 +33,8 @@ namespace NoteMan
throw new EndBeforeStartException(); throw new EndBeforeStartException();
} }
base.UpdateRecord(title, text); base.UpdateRecord(title, text);
this.start = start; Start = start;
this.end = end; End = end;
} }
} }
} }

@ -0,0 +1,60 @@
<?xml version="1.0" encoding="utf-8"?>
<ClassDiagram MajorVersion="1" MinorVersion="1">
<Class Name="NoteMan.Appointment">
<Position X="7.75" Y="0.5" Width="1.5" />
<TypeIdentifier>
<HashCode>QAIAAAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=</HashCode>
<FileName>Appointment.cs</FileName>
</TypeIdentifier>
</Class>
<Class Name="NoteMan.Data">
<Position X="2.5" Y="0.5" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAABAAAAAAEAAAAAAgAAAAAAAAAgAAAABAAABAAA=</HashCode>
<FileName>Data.cs</FileName>
</TypeIdentifier>
</Class>
<Class Name="NoteMan.Element">
<Position X="6" Y="0.5" Width="1.5" />
<TypeIdentifier>
<HashCode>QAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAACAAAAAA=</HashCode>
<FileName>Element.cs</FileName>
</TypeIdentifier>
</Class>
<Class Name="NoteMan.Note">
<Position X="7.75" Y="2.75" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=</HashCode>
<FileName>Note.cs</FileName>
</TypeIdentifier>
</Class>
<Class Name="NoteMan.Project">
<Position X="4.25" Y="0.5" Width="1.5" />
<TypeIdentifier>
<HashCode>AApAAAAAAAgAAFAEAAAQAAAAAAAAAAAAAgAAAAAAAAA=</HashCode>
<FileName>Project.cs</FileName>
</TypeIdentifier>
</Class>
<Class Name="NoteMan.Todo">
<Position X="7.75" Y="4.25" Width="1.5" />
<TypeIdentifier>
<HashCode>QAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAA=</HashCode>
<FileName>Todo.cs</FileName>
</TypeIdentifier>
</Class>
<Class Name="NoteMan.Form1">
<Position X="0.5" Y="0.5" Width="3" />
<TypeIdentifier>
<HashCode>A4IEDAVXIPAQAlgAQAKAgyACBJAJAQAHgUEADAhQAGA=</HashCode>
<FileName>Form1.cs</FileName>
</TypeIdentifier>
</Class>
<Class Name="NoteMan.TextInput">
<Position X="2.5" Y="3.5" Width="2.5" />
<TypeIdentifier>
<HashCode>ABAAAAAAAiAAABEAAACAAMECAQAEAEAAAAAAAAAAAAA=</HashCode>
<FileName>TextInput.cs</FileName>
</TypeIdentifier>
</Class>
<Font Name="Segoe UI" Size="9" />
</ClassDiagram>

@ -1,15 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace NoteMan
{
class Controller
{
}
}

@ -1,27 +1,45 @@
using System; using System;
using System.Collections.Generic; using System.ComponentModel;
using System.Linq; using System.IO;
using System.Text; using System.Xml;
using System.Threading.Tasks; using System.Xml.Serialization;
namespace NoteMan namespace NoteMan
{ {
class Data public class Data
{ {
private string filename = null; public MyBindingList<Project> Projects = new MyBindingList<Project>();
private List<Project> projects = new List<Project>();
public Data() { } public Data()
public Data(string filename)
{ {
this.filename = filename; CurrentProject = new Project("Default project");
// TODO: implement import! Projects.Add(CurrentProject);
} }
public void AddProject(string title) public void AddProject(string title)
{ {
projects.Add(new Project(title)); Projects.Add(new Project(title));
Console.Out.WriteLine("Projekt '{0}' angelegt!", title);
}
public BindingList<Project> GetProjectList()
{
return Projects;
}
[XmlIgnore]
public Project CurrentProject { get; set; }
public void ExportXml(string filename)
{
using (StreamWriter sw = new StreamWriter(filename))
{
using (XmlWriter writer = XmlWriter.Create(sw))
{
XmlSerializer ser = new XmlSerializer(typeof(Data));
ser.Serialize(writer, this);
}
}
} }
} }
} }

@ -1,53 +1,32 @@
using System; using System.Xml.Serialization;
namespace NoteMan namespace NoteMan
{ {
class Element [XmlInclude(typeof(Todo))]
[XmlInclude(typeof(Appointment))]
[XmlInclude(typeof(Note))]
public class Element
{ {
protected string Title; public string Title { get; set; }
protected string Text;
public string Text { get; set; }
public Element() public Element()
{ {
Title = ""; Title = "unnamed";
Text = ""; Text = "";
} }
public Element(string Title, string Text) public Element(string title, string text)
{
this.Title = Title;
this.Text = Text;
}
public string GetTitle()
{
return Title;
}
public void SetTitle(string title)
{
if (title.Length < 3)
{
Console.Out.WriteLine("Mininum Title length is 3!");
throw new InvalidArgument();
}
this.Title = title;
}
public string GetText()
{
return Text;
}
public void SetText(string text)
{ {
this.Text = text; Title = title;
Text = text;
} }
public void UpdateRecord(string title, string text) public void UpdateRecord(string title, string text)
{ {
SetTitle(title); Title = title;
SetText(text); Text = text;
} }
} }
} }

@ -28,28 +28,31 @@
/// </summary> /// </summary>
private void InitializeComponent() private void InitializeComponent()
{ {
this.toolStrip1 = new System.Windows.Forms.ToolStrip(); this.components = new System.ComponentModel.Container();
this.toolStripDropDownButton2 = new System.Windows.Forms.ToolStripDropDownButton(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
this.saveToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
this.saveAsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();
this.openToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripMenu = new System.Windows.Forms.ToolStrip();
this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator(); this.toolStripBtnNewProject = new System.Windows.Forms.ToolStripButton();
this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripBtnRenameProject = new System.Windows.Forms.ToolStripButton();
this.toolStripDropDownButton1 = new System.Windows.Forms.ToolStripDropDownButton(); this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
this.newToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripLabel1 = new System.Windows.Forms.ToolStripLabel();
this.editToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripBtnNewElement = new System.Windows.Forms.ToolStripButton();
this.deleteToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripBtnDeleteElement = new System.Windows.Forms.ToolStripButton();
this.toolStripDropDownButton3 = new System.Windows.Forms.ToolStripDropDownButton(); this.toolStripBtnSaveElement = new System.Windows.Forms.ToolStripButton();
this.newToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator();
this.editToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripBtnExportXml = new System.Windows.Forms.ToolStripButton();
this.deleteToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripBtnExitApplication = new System.Windows.Forms.ToolStripButton();
this.splitContainer1 = new System.Windows.Forms.SplitContainer(); this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.listProjects = new System.Windows.Forms.ListBox(); this.listProjects = new System.Windows.Forms.ListBox();
this.labelProjects = new System.Windows.Forms.Label(); this.labelProjects = new System.Windows.Forms.Label();
this.tabConrtolElements = new System.Windows.Forms.TabControl(); this.tabConrtolElements = new System.Windows.Forms.TabControl();
this.tabNotes = new System.Windows.Forms.TabPage(); this.tabNotes = new System.Windows.Forms.TabPage();
this.splitContainer2 = new System.Windows.Forms.SplitContainer(); this.splitContainer2 = new System.Windows.Forms.SplitContainer();
this.listNotes = new System.Windows.Forms.ListBox(); this.dataNotes = new System.Windows.Forms.DataGridView();
this.titleDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.dataGridViewTextBoxColumn1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.noteBindingSource = new System.Windows.Forms.BindingSource(this.components);
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
this.label1 = new System.Windows.Forms.Label(); this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label();
@ -57,7 +60,11 @@
this.textNotesNote = new System.Windows.Forms.TextBox(); this.textNotesNote = new System.Windows.Forms.TextBox();
this.tabAppointments = new System.Windows.Forms.TabPage(); this.tabAppointments = new System.Windows.Forms.TabPage();
this.splitContainer3 = new System.Windows.Forms.SplitContainer(); this.splitContainer3 = new System.Windows.Forms.SplitContainer();
this.listAppointments = new System.Windows.Forms.ListBox(); this.dataAppointments = new System.Windows.Forms.DataGridView();
this.titleDataGridViewTextBoxColumn1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Start = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.End = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.appointmentBindingSource = new System.Windows.Forms.BindingSource(this.components);
this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel(); this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
this.label3 = new System.Windows.Forms.Label(); this.label3 = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label(); this.label4 = new System.Windows.Forms.Label();
@ -69,7 +76,11 @@
this.label6 = new System.Windows.Forms.Label(); this.label6 = new System.Windows.Forms.Label();
this.tabTodos = new System.Windows.Forms.TabPage(); this.tabTodos = new System.Windows.Forms.TabPage();
this.splitContainer4 = new System.Windows.Forms.SplitContainer(); this.splitContainer4 = new System.Windows.Forms.SplitContainer();
this.listTodos = new System.Windows.Forms.ListBox(); this.dataTodos = new System.Windows.Forms.DataGridView();
this.titleDataGridViewTextBoxColumn2 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Deadline = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Text = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.todoBindingSource = new System.Windows.Forms.BindingSource(this.components);
this.tableLayoutPanel3 = new System.Windows.Forms.TableLayoutPanel(); this.tableLayoutPanel3 = new System.Windows.Forms.TableLayoutPanel();
this.label7 = new System.Windows.Forms.Label(); this.label7 = new System.Windows.Forms.Label();
this.label8 = new System.Windows.Forms.Label(); this.label8 = new System.Windows.Forms.Label();
@ -77,7 +88,8 @@
this.textTodoDescription = new System.Windows.Forms.TextBox(); this.textTodoDescription = new System.Windows.Forms.TextBox();
this.dateTimePickerTodoDeadline = new System.Windows.Forms.DateTimePicker(); this.dateTimePickerTodoDeadline = new System.Windows.Forms.DateTimePicker();
this.label9 = new System.Windows.Forms.Label(); this.label9 = new System.Windows.Forms.Label();
this.toolStrip1.SuspendLayout(); this.elementBindingSource = new System.Windows.Forms.BindingSource(this.components);
this.toolStripMenu.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
this.splitContainer1.Panel1.SuspendLayout(); this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout(); this.splitContainer1.Panel2.SuspendLayout();
@ -88,146 +100,126 @@
this.splitContainer2.Panel1.SuspendLayout(); this.splitContainer2.Panel1.SuspendLayout();
this.splitContainer2.Panel2.SuspendLayout(); this.splitContainer2.Panel2.SuspendLayout();
this.splitContainer2.SuspendLayout(); this.splitContainer2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.dataNotes)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.noteBindingSource)).BeginInit();
this.tableLayoutPanel1.SuspendLayout(); this.tableLayoutPanel1.SuspendLayout();
this.tabAppointments.SuspendLayout(); this.tabAppointments.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.splitContainer3)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.splitContainer3)).BeginInit();
this.splitContainer3.Panel1.SuspendLayout(); this.splitContainer3.Panel1.SuspendLayout();
this.splitContainer3.Panel2.SuspendLayout(); this.splitContainer3.Panel2.SuspendLayout();
this.splitContainer3.SuspendLayout(); this.splitContainer3.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.dataAppointments)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.appointmentBindingSource)).BeginInit();
this.tableLayoutPanel2.SuspendLayout(); this.tableLayoutPanel2.SuspendLayout();
this.tabTodos.SuspendLayout(); this.tabTodos.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.splitContainer4)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.splitContainer4)).BeginInit();
this.splitContainer4.Panel1.SuspendLayout(); this.splitContainer4.Panel1.SuspendLayout();
this.splitContainer4.Panel2.SuspendLayout(); this.splitContainer4.Panel2.SuspendLayout();
this.splitContainer4.SuspendLayout(); this.splitContainer4.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.dataTodos)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.todoBindingSource)).BeginInit();
this.tableLayoutPanel3.SuspendLayout(); this.tableLayoutPanel3.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.elementBindingSource)).BeginInit();
this.SuspendLayout(); this.SuspendLayout();
// //
// toolStrip1 // toolStripMenu
// //
this.toolStrip1.ImageScalingSize = new System.Drawing.Size(24, 24); this.toolStripMenu.ImageScalingSize = new System.Drawing.Size(24, 24);
this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.toolStripMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.toolStripDropDownButton2, this.toolStripBtnNewProject,
this.toolStripDropDownButton1, this.toolStripBtnRenameProject,
this.toolStripDropDownButton3}); this.toolStripSeparator1,
this.toolStrip1.Location = new System.Drawing.Point(0, 0); this.toolStripLabel1,
this.toolStrip1.Name = "toolStrip1"; this.toolStripBtnNewElement,
this.toolStrip1.Size = new System.Drawing.Size(778, 31); this.toolStripBtnDeleteElement,
this.toolStrip1.TabIndex = 0; this.toolStripBtnSaveElement,
this.toolStrip1.Text = "toolStrip1"; this.toolStripSeparator3,
// this.toolStripBtnExportXml,
// toolStripDropDownButton2 this.toolStripBtnExitApplication});
// this.toolStripMenu.Location = new System.Drawing.Point(0, 0);
this.toolStripDropDownButton2.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.toolStripMenu.Name = "toolStripMenu";
this.saveToolStripMenuItem, this.toolStripMenu.Size = new System.Drawing.Size(778, 31);
this.saveAsToolStripMenuItem, this.toolStripMenu.TabIndex = 0;
this.openToolStripMenuItem, this.toolStripMenu.Text = "toolStripMenu";
this.toolStripSeparator2, //
this.exitToolStripMenuItem}); // toolStripBtnNewProject
this.toolStripDropDownButton2.Image = global::NoteMan.Properties.Resources.media_playlist_repeat; //
this.toolStripDropDownButton2.ImageTransparentColor = System.Drawing.Color.Magenta; this.toolStripBtnNewProject.Image = global::NoteMan.Properties.Resources.project_development_new_template;
this.toolStripDropDownButton2.Name = "toolStripDropDownButton2"; this.toolStripBtnNewProject.ImageTransparentColor = System.Drawing.Color.Magenta;
this.toolStripDropDownButton2.Size = new System.Drawing.Size(62, 28); this.toolStripBtnNewProject.Name = "toolStripBtnNewProject";
this.toolStripDropDownButton2.Text = "File"; this.toolStripBtnNewProject.Size = new System.Drawing.Size(99, 28);
// this.toolStripBtnNewProject.Text = "New Project";
// saveToolStripMenuItem this.toolStripBtnNewProject.Click += new System.EventHandler(this.toolStripBtnNewProject_Click);
// //
this.saveToolStripMenuItem.Image = global::NoteMan.Properties.Resources.document_save; // toolStripBtnRenameProject
this.saveToolStripMenuItem.Name = "saveToolStripMenuItem"; //
this.saveToolStripMenuItem.Size = new System.Drawing.Size(126, 22); this.toolStripBtnRenameProject.Image = global::NoteMan.Properties.Resources.document_edit1;
this.saveToolStripMenuItem.Text = "Save"; this.toolStripBtnRenameProject.ImageTransparentColor = System.Drawing.Color.Magenta;
// this.toolStripBtnRenameProject.Name = "toolStripBtnRenameProject";
// saveAsToolStripMenuItem this.toolStripBtnRenameProject.Size = new System.Drawing.Size(78, 28);
// this.toolStripBtnRenameProject.Text = "Rename";
this.saveAsToolStripMenuItem.Image = global::NoteMan.Properties.Resources.document_save_as; this.toolStripBtnRenameProject.Click += new System.EventHandler(this.toolStripBtnRenameProject_Click);
this.saveAsToolStripMenuItem.Name = "saveAsToolStripMenuItem"; //
this.saveAsToolStripMenuItem.Size = new System.Drawing.Size(126, 22); // toolStripSeparator1
this.saveAsToolStripMenuItem.Text = "Save As ..."; //
// this.toolStripSeparator1.Name = "toolStripSeparator1";
// openToolStripMenuItem this.toolStripSeparator1.Size = new System.Drawing.Size(6, 31);
// //
this.openToolStripMenuItem.Image = global::NoteMan.Properties.Resources.document_open; // toolStripLabel1
this.openToolStripMenuItem.Name = "openToolStripMenuItem"; //
this.openToolStripMenuItem.Size = new System.Drawing.Size(126, 22); this.toolStripLabel1.Name = "toolStripLabel1";
this.openToolStripMenuItem.Text = "Open"; this.toolStripLabel1.Size = new System.Drawing.Size(53, 28);
// this.toolStripLabel1.Text = "Element:";
// toolStripSeparator2 //
// // toolStripBtnNewElement
this.toolStripSeparator2.Name = "toolStripSeparator2"; //
this.toolStripSeparator2.Size = new System.Drawing.Size(123, 6); this.toolStripBtnNewElement.Image = global::NoteMan.Properties.Resources.document_new;
// this.toolStripBtnNewElement.ImageTransparentColor = System.Drawing.Color.Magenta;
// exitToolStripMenuItem this.toolStripBtnNewElement.Name = "toolStripBtnNewElement";
// this.toolStripBtnNewElement.Size = new System.Drawing.Size(59, 28);
this.exitToolStripMenuItem.Image = global::NoteMan.Properties.Resources.application_exit; this.toolStripBtnNewElement.Text = "New";
this.exitToolStripMenuItem.Name = "exitToolStripMenuItem"; this.toolStripBtnNewElement.Click += new System.EventHandler(this.toolStripBtnNewElement_Click);
this.exitToolStripMenuItem.Size = new System.Drawing.Size(126, 22); //
this.exitToolStripMenuItem.Text = "Exit"; // toolStripBtnDeleteElement
// //
// toolStripDropDownButton1 this.toolStripBtnDeleteElement.Image = global::NoteMan.Properties.Resources.document_close;
// this.toolStripBtnDeleteElement.ImageTransparentColor = System.Drawing.Color.Magenta;
this.toolStripDropDownButton1.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.toolStripBtnDeleteElement.Name = "toolStripBtnDeleteElement";
this.newToolStripMenuItem, this.toolStripBtnDeleteElement.Size = new System.Drawing.Size(68, 28);
this.editToolStripMenuItem, this.toolStripBtnDeleteElement.Text = "Delete";
this.deleteToolStripMenuItem}); this.toolStripBtnDeleteElement.Click += new System.EventHandler(this.toolStripBtnDeleteElement_Click);
this.toolStripDropDownButton1.Image = global::NoteMan.Properties.Resources.project_development; //
this.toolStripDropDownButton1.ImageTransparentColor = System.Drawing.Color.Magenta; // toolStripBtnSaveElement
this.toolStripDropDownButton1.Name = "toolStripDropDownButton1"; //
this.toolStripDropDownButton1.Size = new System.Drawing.Size(81, 28); this.toolStripBtnSaveElement.Image = global::NoteMan.Properties.Resources.document_save;
this.toolStripDropDownButton1.Text = "Project"; this.toolStripBtnSaveElement.ImageTransparentColor = System.Drawing.Color.Magenta;
// this.toolStripBtnSaveElement.Name = "toolStripBtnSaveElement";
// newToolStripMenuItem this.toolStripBtnSaveElement.Size = new System.Drawing.Size(59, 28);
// this.toolStripBtnSaveElement.Text = "Save";
this.newToolStripMenuItem.Image = global::NoteMan.Properties.Resources.project_development_new_template; this.toolStripBtnSaveElement.Click += new System.EventHandler(this.toolStripBtnSaveElement_Click);
this.newToolStripMenuItem.Name = "newToolStripMenuItem"; //
this.newToolStripMenuItem.Size = new System.Drawing.Size(107, 22); // toolStripSeparator3
this.newToolStripMenuItem.Text = "New"; //
// this.toolStripSeparator3.Name = "toolStripSeparator3";
// editToolStripMenuItem this.toolStripSeparator3.Size = new System.Drawing.Size(6, 31);
// //
this.editToolStripMenuItem.Image = global::NoteMan.Properties.Resources.project_development; // toolStripBtnExportXml
this.editToolStripMenuItem.Name = "editToolStripMenuItem"; //
this.editToolStripMenuItem.Size = new System.Drawing.Size(107, 22); this.toolStripBtnExportXml.Image = global::NoteMan.Properties.Resources.document_save_as;
this.editToolStripMenuItem.Text = "Edit"; this.toolStripBtnExportXml.ImageTransparentColor = System.Drawing.Color.Magenta;
// this.toolStripBtnExportXml.Name = "toolStripBtnExportXml";
// deleteToolStripMenuItem this.toolStripBtnExportXml.Size = new System.Drawing.Size(94, 28);
// this.toolStripBtnExportXml.Text = "Export data";
this.deleteToolStripMenuItem.Image = global::NoteMan.Properties.Resources.project_development_close; this.toolStripBtnExportXml.Click += new System.EventHandler(this.toolStripBtnExportXml_Click);
this.deleteToolStripMenuItem.Name = "deleteToolStripMenuItem"; //
this.deleteToolStripMenuItem.Size = new System.Drawing.Size(107, 22); // toolStripBtnExitApplication
this.deleteToolStripMenuItem.Text = "Delete"; //
// this.toolStripBtnExitApplication.Image = global::NoteMan.Properties.Resources.application_exit;
// toolStripDropDownButton3 this.toolStripBtnExitApplication.ImageTransparentColor = System.Drawing.Color.Magenta;
// this.toolStripBtnExitApplication.Name = "toolStripBtnExitApplication";
this.toolStripDropDownButton3.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.toolStripBtnExitApplication.Size = new System.Drawing.Size(128, 28);
this.newToolStripMenuItem1, this.toolStripBtnExitApplication.Text = "Close Application";
this.editToolStripMenuItem1, this.toolStripBtnExitApplication.Click += new System.EventHandler(this.toolStripBtnExitApplication_Click);
this.deleteToolStripMenuItem1});
this.toolStripDropDownButton3.Image = global::NoteMan.Properties.Resources.text_plain;
this.toolStripDropDownButton3.ImageTransparentColor = System.Drawing.Color.Magenta;
this.toolStripDropDownButton3.Name = "toolStripDropDownButton3";
this.toolStripDropDownButton3.Size = new System.Drawing.Size(87, 28);
this.toolStripDropDownButton3.Text = "Element";
//
// newToolStripMenuItem1
//
this.newToolStripMenuItem1.Image = global::NoteMan.Properties.Resources.document_new;
this.newToolStripMenuItem1.Name = "newToolStripMenuItem1";
this.newToolStripMenuItem1.Size = new System.Drawing.Size(107, 22);
this.newToolStripMenuItem1.Text = "New";
//
// editToolStripMenuItem1
//
this.editToolStripMenuItem1.Image = global::NoteMan.Properties.Resources.document_edit1;
this.editToolStripMenuItem1.Name = "editToolStripMenuItem1";
this.editToolStripMenuItem1.Size = new System.Drawing.Size(107, 22);
this.editToolStripMenuItem1.Text = "Edit";
//
// deleteToolStripMenuItem1
//
this.deleteToolStripMenuItem1.Image = global::NoteMan.Properties.Resources.document_close;
this.deleteToolStripMenuItem1.Name = "deleteToolStripMenuItem1";
this.deleteToolStripMenuItem1.Size = new System.Drawing.Size(107, 22);
this.deleteToolStripMenuItem1.Text = "Delete";
// //
// splitContainer1 // splitContainer1
// //
@ -255,7 +247,7 @@
this.listProjects.Name = "listProjects"; this.listProjects.Name = "listProjects";
this.listProjects.Size = new System.Drawing.Size(224, 550); this.listProjects.Size = new System.Drawing.Size(224, 550);
this.listProjects.TabIndex = 1; this.listProjects.TabIndex = 1;
this.listProjects.SelectedIndexChanged += new System.EventHandler(this.listProjects_SelectedIndexChanged); this.listProjects.SelectedValueChanged += new System.EventHandler(this.listProjects_SelectedValueChanged);
// //
// labelProjects // labelProjects
// //
@ -301,7 +293,7 @@
// //
// splitContainer2.Panel1 // splitContainer2.Panel1
// //
this.splitContainer2.Panel1.Controls.Add(this.listNotes); this.splitContainer2.Panel1.Controls.Add(this.dataNotes);
// //
// splitContainer2.Panel2 // splitContainer2.Panel2
// //
@ -310,14 +302,43 @@
this.splitContainer2.SplitterDistance = 372; this.splitContainer2.SplitterDistance = 372;
this.splitContainer2.TabIndex = 0; this.splitContainer2.TabIndex = 0;
// //
// listNotes // dataNotes
//
this.dataNotes.AllowUserToAddRows = false;
this.dataNotes.AllowUserToDeleteRows = false;
this.dataNotes.AutoGenerateColumns = false;
this.dataNotes.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill;
this.dataNotes.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dataNotes.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.titleDataGridViewTextBoxColumn,
this.dataGridViewTextBoxColumn1});
this.dataNotes.DataSource = this.noteBindingSource;
this.dataNotes.Dock = System.Windows.Forms.DockStyle.Fill;
this.dataNotes.Location = new System.Drawing.Point(0, 0);
this.dataNotes.MultiSelect = false;
this.dataNotes.Name = "dataNotes";
this.dataNotes.ReadOnly = true;
this.dataNotes.Size = new System.Drawing.Size(536, 372);
this.dataNotes.TabIndex = 0;
this.dataNotes.CurrentCellChanged += new System.EventHandler(this.dataNotes_CurrentCellChanged);
//
// titleDataGridViewTextBoxColumn
// //
this.listNotes.Dock = System.Windows.Forms.DockStyle.Fill; this.titleDataGridViewTextBoxColumn.DataPropertyName = "Title";
this.listNotes.FormattingEnabled = true; this.titleDataGridViewTextBoxColumn.HeaderText = "Title";
this.listNotes.Location = new System.Drawing.Point(0, 0); this.titleDataGridViewTextBoxColumn.Name = "titleDataGridViewTextBoxColumn";
this.listNotes.Name = "listNotes"; this.titleDataGridViewTextBoxColumn.ReadOnly = true;
this.listNotes.Size = new System.Drawing.Size(536, 372); //
this.listNotes.TabIndex = 0; // dataGridViewTextBoxColumn1
//
this.dataGridViewTextBoxColumn1.DataPropertyName = "Text";
this.dataGridViewTextBoxColumn1.HeaderText = "Text";
this.dataGridViewTextBoxColumn1.Name = "dataGridViewTextBoxColumn1";
this.dataGridViewTextBoxColumn1.ReadOnly = true;
//
// noteBindingSource
//
this.noteBindingSource.DataSource = typeof(NoteMan.Note);
// //
// tableLayoutPanel1 // tableLayoutPanel1
// //
@ -347,7 +368,6 @@
this.label1.TabIndex = 0; this.label1.TabIndex = 0;
this.label1.Text = "Title"; this.label1.Text = "Title";
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.label1.Click += new System.EventHandler(this.label1_Click);
// //
// label2 // label2
// //
@ -397,7 +417,7 @@
// //
// splitContainer3.Panel1 // splitContainer3.Panel1
// //
this.splitContainer3.Panel1.Controls.Add(this.listAppointments); this.splitContainer3.Panel1.Controls.Add(this.dataAppointments);
// //
// splitContainer3.Panel2 // splitContainer3.Panel2
// //
@ -406,14 +426,57 @@
this.splitContainer3.SplitterDistance = 372; this.splitContainer3.SplitterDistance = 372;
this.splitContainer3.TabIndex = 0; this.splitContainer3.TabIndex = 0;
// //
// listAppointments // dataAppointments
// //
this.listAppointments.Dock = System.Windows.Forms.DockStyle.Fill; this.dataAppointments.AllowUserToAddRows = false;
this.listAppointments.FormattingEnabled = true; this.dataAppointments.AllowUserToDeleteRows = false;
this.listAppointments.Location = new System.Drawing.Point(0, 0); this.dataAppointments.AutoGenerateColumns = false;
this.listAppointments.Name = "listAppointments"; this.dataAppointments.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill;
this.listAppointments.Size = new System.Drawing.Size(536, 372); this.dataAppointments.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.listAppointments.TabIndex = 0; this.dataAppointments.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.titleDataGridViewTextBoxColumn1,
this.Start,
this.End});
this.dataAppointments.DataSource = this.appointmentBindingSource;
this.dataAppointments.Dock = System.Windows.Forms.DockStyle.Fill;
this.dataAppointments.Location = new System.Drawing.Point(0, 0);
this.dataAppointments.MultiSelect = false;
this.dataAppointments.Name = "dataAppointments";
this.dataAppointments.ReadOnly = true;
this.dataAppointments.Size = new System.Drawing.Size(536, 372);
this.dataAppointments.TabIndex = 0;
this.dataAppointments.CurrentCellChanged += new System.EventHandler(this.dataAppointments_CurrentCellChanged);
//
// titleDataGridViewTextBoxColumn1
//
this.titleDataGridViewTextBoxColumn1.DataPropertyName = "Title";
this.titleDataGridViewTextBoxColumn1.HeaderText = "Title";
this.titleDataGridViewTextBoxColumn1.Name = "titleDataGridViewTextBoxColumn1";
this.titleDataGridViewTextBoxColumn1.ReadOnly = true;
//
// Start
//
this.Start.DataPropertyName = "Start";
dataGridViewCellStyle1.Format = "G";
dataGridViewCellStyle1.NullValue = "0000-00-00 00:00:00";
this.Start.DefaultCellStyle = dataGridViewCellStyle1;
this.Start.HeaderText = "Start";
this.Start.Name = "Start";
this.Start.ReadOnly = true;
//
// End
//
this.End.DataPropertyName = "End";
dataGridViewCellStyle2.Format = "G";
dataGridViewCellStyle2.NullValue = "0000-00-00 00:00:00";
this.End.DefaultCellStyle = dataGridViewCellStyle2;
this.End.HeaderText = "End";
this.End.Name = "End";
this.End.ReadOnly = true;
//
// appointmentBindingSource
//
this.appointmentBindingSource.DataSource = typeof(NoteMan.Appointment);
// //
// tableLayoutPanel2 // tableLayoutPanel2
// //
@ -460,7 +523,6 @@
this.label4.TabIndex = 1; this.label4.TabIndex = 1;
this.label4.Text = "Description"; this.label4.Text = "Description";
this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.label4.Click += new System.EventHandler(this.label4_Click);
// //
// textAppointmentTitle // textAppointmentTitle
// //
@ -541,7 +603,7 @@
// //
// splitContainer4.Panel1 // splitContainer4.Panel1
// //
this.splitContainer4.Panel1.Controls.Add(this.listTodos); this.splitContainer4.Panel1.Controls.Add(this.dataTodos);
// //
// splitContainer4.Panel2 // splitContainer4.Panel2
// //
@ -550,14 +612,56 @@
this.splitContainer4.SplitterDistance = 372; this.splitContainer4.SplitterDistance = 372;
this.splitContainer4.TabIndex = 0; this.splitContainer4.TabIndex = 0;
// //
// listTodos // dataTodos
// //
this.listTodos.Dock = System.Windows.Forms.DockStyle.Fill; this.dataTodos.AllowUserToAddRows = false;
this.listTodos.FormattingEnabled = true; this.dataTodos.AllowUserToDeleteRows = false;
this.listTodos.Location = new System.Drawing.Point(0, 0); this.dataTodos.AutoGenerateColumns = false;
this.listTodos.Name = "listTodos"; this.dataTodos.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill;
this.listTodos.Size = new System.Drawing.Size(536, 372); this.dataTodos.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.listTodos.TabIndex = 0; this.dataTodos.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.titleDataGridViewTextBoxColumn2,
this.Deadline,
this.Text});
this.dataTodos.DataSource = this.todoBindingSource;
this.dataTodos.Dock = System.Windows.Forms.DockStyle.Fill;
this.dataTodos.Location = new System.Drawing.Point(0, 0);
this.dataTodos.MultiSelect = false;
this.dataTodos.Name = "dataTodos";
this.dataTodos.ReadOnly = true;
this.dataTodos.Size = new System.Drawing.Size(536, 372);
this.dataTodos.TabIndex = 0;
this.dataTodos.CurrentCellChanged += new System.EventHandler(this.dataTodos_CurrentCellChanged);
//
// titleDataGridViewTextBoxColumn2
//
this.titleDataGridViewTextBoxColumn2.DataPropertyName = "Title";
this.titleDataGridViewTextBoxColumn2.HeaderText = "Title";
this.titleDataGridViewTextBoxColumn2.Name = "titleDataGridViewTextBoxColumn2";
this.titleDataGridViewTextBoxColumn2.ReadOnly = true;
//
// Deadline
//
this.Deadline.DataPropertyName = "Deadline";
dataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle3.Format = "g";
dataGridViewCellStyle3.NullValue = "0000-00-00 00:00";
this.Deadline.DefaultCellStyle = dataGridViewCellStyle3;
this.Deadline.HeaderText = "Deadline";
this.Deadline.MaxInputLength = 20;
this.Deadline.Name = "Deadline";
this.Deadline.ReadOnly = true;
//
// Text
//
this.Text.DataPropertyName = "Text";
this.Text.HeaderText = "Text";
this.Text.Name = "Text";
this.Text.ReadOnly = true;
//
// todoBindingSource
//
this.todoBindingSource.DataSource = typeof(NoteMan.Todo);
// //
// tableLayoutPanel3 // tableLayoutPanel3
// //
@ -639,7 +743,10 @@
this.label9.TabIndex = 6; this.label9.TabIndex = 6;
this.label9.Text = "Deadline"; this.label9.Text = "Deadline";
this.label9.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; this.label9.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.label9.Click += new System.EventHandler(this.label9_Click); //
// elementBindingSource
//
this.elementBindingSource.DataSource = typeof(NoteMan.Element);
// //
// Form1 // Form1
// //
@ -647,11 +754,10 @@
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(778, 598); this.ClientSize = new System.Drawing.Size(778, 598);
this.Controls.Add(this.splitContainer1); this.Controls.Add(this.splitContainer1);
this.Controls.Add(this.toolStrip1); this.Controls.Add(this.toolStripMenu);
this.Name = "Form1"; this.Name = "Form1";
this.Text = "NoteMan"; this.toolStripMenu.ResumeLayout(false);
this.toolStrip1.ResumeLayout(false); this.toolStripMenu.PerformLayout();
this.toolStrip1.PerformLayout();
this.splitContainer1.Panel1.ResumeLayout(false); this.splitContainer1.Panel1.ResumeLayout(false);
this.splitContainer1.Panel1.PerformLayout(); this.splitContainer1.Panel1.PerformLayout();
this.splitContainer1.Panel2.ResumeLayout(false); this.splitContainer1.Panel2.ResumeLayout(false);
@ -663,6 +769,8 @@
this.splitContainer2.Panel2.ResumeLayout(false); this.splitContainer2.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).EndInit();
this.splitContainer2.ResumeLayout(false); this.splitContainer2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.dataNotes)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.noteBindingSource)).EndInit();
this.tableLayoutPanel1.ResumeLayout(false); this.tableLayoutPanel1.ResumeLayout(false);
this.tableLayoutPanel1.PerformLayout(); this.tableLayoutPanel1.PerformLayout();
this.tabAppointments.ResumeLayout(false); this.tabAppointments.ResumeLayout(false);
@ -670,6 +778,8 @@
this.splitContainer3.Panel2.ResumeLayout(false); this.splitContainer3.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.splitContainer3)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.splitContainer3)).EndInit();
this.splitContainer3.ResumeLayout(false); this.splitContainer3.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.dataAppointments)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.appointmentBindingSource)).EndInit();
this.tableLayoutPanel2.ResumeLayout(false); this.tableLayoutPanel2.ResumeLayout(false);
this.tableLayoutPanel2.PerformLayout(); this.tableLayoutPanel2.PerformLayout();
this.tabTodos.ResumeLayout(false); this.tabTodos.ResumeLayout(false);
@ -677,8 +787,11 @@
this.splitContainer4.Panel2.ResumeLayout(false); this.splitContainer4.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.splitContainer4)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.splitContainer4)).EndInit();
this.splitContainer4.ResumeLayout(false); this.splitContainer4.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.dataTodos)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.todoBindingSource)).EndInit();
this.tableLayoutPanel3.ResumeLayout(false); this.tableLayoutPanel3.ResumeLayout(false);
this.tableLayoutPanel3.PerformLayout(); this.tableLayoutPanel3.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.elementBindingSource)).EndInit();
this.ResumeLayout(false); this.ResumeLayout(false);
this.PerformLayout(); this.PerformLayout();
@ -686,7 +799,7 @@
#endregion #endregion
private System.Windows.Forms.ToolStrip toolStrip1; private System.Windows.Forms.ToolStrip toolStripMenu;
private System.Windows.Forms.SplitContainer splitContainer1; private System.Windows.Forms.SplitContainer splitContainer1;
private System.Windows.Forms.TabControl tabConrtolElements; private System.Windows.Forms.TabControl tabConrtolElements;
private System.Windows.Forms.TabPage tabNotes; private System.Windows.Forms.TabPage tabNotes;
@ -695,25 +808,8 @@
private System.Windows.Forms.SplitContainer splitContainer3; private System.Windows.Forms.SplitContainer splitContainer3;
private System.Windows.Forms.TabPage tabTodos; private System.Windows.Forms.TabPage tabTodos;
private System.Windows.Forms.SplitContainer splitContainer4; private System.Windows.Forms.SplitContainer splitContainer4;
private System.Windows.Forms.ToolStripDropDownButton toolStripDropDownButton2;
private System.Windows.Forms.ToolStripMenuItem saveToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem saveAsToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem openToolStripMenuItem;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator2;
private System.Windows.Forms.ToolStripMenuItem exitToolStripMenuItem;
private System.Windows.Forms.ToolStripDropDownButton toolStripDropDownButton1;
private System.Windows.Forms.ToolStripMenuItem newToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem editToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem deleteToolStripMenuItem;
private System.Windows.Forms.ToolStripDropDownButton toolStripDropDownButton3;
private System.Windows.Forms.ToolStripMenuItem newToolStripMenuItem1;
private System.Windows.Forms.ToolStripMenuItem editToolStripMenuItem1;
private System.Windows.Forms.ToolStripMenuItem deleteToolStripMenuItem1;
private System.Windows.Forms.ListBox listProjects; private System.Windows.Forms.ListBox listProjects;
private System.Windows.Forms.Label labelProjects; private System.Windows.Forms.Label labelProjects;
private System.Windows.Forms.ListBox listNotes;
private System.Windows.Forms.ListBox listAppointments;
private System.Windows.Forms.ListBox listTodos;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1; private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
private System.Windows.Forms.Label label1; private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2; private System.Windows.Forms.Label label2;
@ -735,6 +831,31 @@
private System.Windows.Forms.TextBox textTodoDescription; private System.Windows.Forms.TextBox textTodoDescription;
private System.Windows.Forms.DateTimePicker dateTimePickerTodoDeadline; private System.Windows.Forms.DateTimePicker dateTimePickerTodoDeadline;
private System.Windows.Forms.Label label9; private System.Windows.Forms.Label label9;
private System.Windows.Forms.DataGridView dataNotes;
private System.Windows.Forms.DataGridView dataAppointments;
private System.Windows.Forms.DataGridView dataTodos;
private System.Windows.Forms.BindingSource noteBindingSource;
private System.Windows.Forms.BindingSource appointmentBindingSource;
private System.Windows.Forms.BindingSource todoBindingSource;
private System.Windows.Forms.BindingSource elementBindingSource;
private System.Windows.Forms.DataGridViewTextBoxColumn titleDataGridViewTextBoxColumn;
private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn1;
private System.Windows.Forms.ToolStripButton toolStripBtnNewProject;
private System.Windows.Forms.ToolStripButton toolStripBtnExportXml;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;
private System.Windows.Forms.ToolStripLabel toolStripLabel1;
private System.Windows.Forms.ToolStripButton toolStripBtnNewElement;
private System.Windows.Forms.ToolStripButton toolStripBtnDeleteElement;
private System.Windows.Forms.ToolStripButton toolStripBtnSaveElement;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator3;
private System.Windows.Forms.ToolStripButton toolStripBtnExitApplication;
private System.Windows.Forms.DataGridViewTextBoxColumn titleDataGridViewTextBoxColumn1;
private System.Windows.Forms.DataGridViewTextBoxColumn Start;
private System.Windows.Forms.DataGridViewTextBoxColumn End;
private System.Windows.Forms.DataGridViewTextBoxColumn titleDataGridViewTextBoxColumn2;
private System.Windows.Forms.DataGridViewTextBoxColumn Deadline;
private System.Windows.Forms.DataGridViewTextBoxColumn Text;
private System.Windows.Forms.ToolStripButton toolStripBtnRenameProject;
} }
} }

@ -1,40 +1,168 @@
using System; 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 System.Windows.Forms;
using NoteMan.Properties;
namespace NoteMan namespace NoteMan
{ {
public partial class Form1 : Form public partial class Form1 : Form
{ {
private readonly Data d = new Data();
public Form1() public Form1()
{ {
InitializeComponent(); InitializeComponent();
listProjects.DisplayMember = "Title";
listProjects.DataSource = d.GetProjectList();
}
private void toolStripBtnExitApplication_Click(object sender, EventArgs e)
{
Close();
} }
private void label1_Click(object sender, EventArgs e) private void toolStripBtnNewProject_Click(object sender, EventArgs e)
{ {
TextInput ti = new TextInput();
string title = ti.Show("Project name:", "");
if (title != null)
{
d.AddProject(title);
}
}
private void listProjects_SelectedValueChanged(object sender, EventArgs e)
{
d.CurrentProject = listProjects.SelectedItem as Project;
if (d.CurrentProject == null) return;
dataAppointments.DataSource = d.CurrentProject.GetAppointments();
dataTodos.DataSource = d.CurrentProject.GetTodos();
dataNotes.DataSource = d.CurrentProject.GetNotes();
} }
private void label4_Click(object sender, EventArgs e) private void toolStripBtnNewElement_Click(object sender, EventArgs e)
{ {
// distinguish the different types
if (tabConrtolElements.SelectedTab == tabTodos)
{
d.CurrentProject.Add(new Todo());
dataTodos.DataSource = d.CurrentProject.GetTodos();
}
else if (tabConrtolElements.SelectedTab == tabAppointments)
{
d.CurrentProject.Add(new Appointment());
dataAppointments.DataSource = d.CurrentProject.GetAppointments();
}
else if (tabConrtolElements.SelectedTab == tabNotes)
{
d.CurrentProject.Add(new Note());
dataNotes.DataSource = d.CurrentProject.GetNotes();
}
}
private void dataTodos_CurrentCellChanged(object sender, EventArgs e)
{
if (dataTodos.CurrentRow?.DataBoundItem == null) return;
var elem = (Todo) dataTodos.CurrentRow.DataBoundItem;
textTodoTitle.Text = elem.Title;
textTodoDescription.Text = elem.Text;
dateTimePickerTodoDeadline.Value = elem.Deadline;
} }
private void label9_Click(object sender, EventArgs e) private void toolStripBtnExportXml_Click(object sender, EventArgs e)
{ {
SaveFileDialog sfd = new SaveFileDialog
{
DefaultExt = "xml",
AddExtension = true,
Filter = Resources.ExportFileTypeXML,
InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments)
};
DialogResult r = sfd.ShowDialog();
if (r == DialogResult.OK)
{
d.ExportXml(sfd.FileName);
}
} }
private void listProjects_SelectedIndexChanged(object sender, EventArgs e) private void toolStripBtnSaveElement_Click(object sender, EventArgs e)
{
// distinguish the different types
if (tabConrtolElements.SelectedTab == tabTodos)
{
if (dataTodos.CurrentRow?.DataBoundItem == null) return;
Todo elem = (Todo) dataTodos.CurrentRow.DataBoundItem;
elem.Title = textTodoTitle.Text;
elem.Text = textTodoDescription.Text;
elem.Deadline = dateTimePickerTodoDeadline.Value;
}
else if (tabConrtolElements.SelectedTab == tabAppointments)
{
if (dataAppointments.CurrentRow?.DataBoundItem == null) return;
Appointment elem = (Appointment) dataAppointments.CurrentRow.DataBoundItem;
elem.UpdateRecord(textAppointmentTitle.Text, textAppointmentDescription.Text, dateTimePickerAppointmentStart.Value, dateTimePickerAppointmentEnd.Value);
}
else if (tabConrtolElements.SelectedTab == tabNotes)
{
if (dataNotes.CurrentRow?.DataBoundItem == null) return;
Note elem = (Note) dataNotes.CurrentRow.DataBoundItem;
elem.UpdateRecord(textNotesTitle.Text, textNotesNote.Text);
}
}
private void toolStripBtnDeleteElement_Click(object sender, EventArgs e)
{ {
//listProjects.SelectedItem(); // distinguish the different types
if (tabConrtolElements.SelectedTab == tabTodos)
{
if (dataTodos.CurrentRow?.DataBoundItem == null) return;
Todo elem = (Todo) dataTodos.CurrentRow.DataBoundItem;
d.CurrentProject.Elements.Remove(elem);
}
else if (tabConrtolElements.SelectedTab == tabAppointments)
{
if (dataAppointments.CurrentRow?.DataBoundItem == null) return;
Appointment elem = (Appointment) dataAppointments.CurrentRow.DataBoundItem;
d.CurrentProject.Elements.Remove(elem);
}
else if (tabConrtolElements.SelectedTab == tabNotes)
{
if (dataNotes.CurrentRow?.DataBoundItem == null) return;
Note elem = (Note) dataNotes.CurrentRow.DataBoundItem;
d.CurrentProject.Elements.Remove(elem);
}
}
private void dataAppointments_CurrentCellChanged(object sender, EventArgs e)
{
if (dataAppointments.CurrentRow?.DataBoundItem != null)
{
Appointment elem = (Appointment) dataAppointments.CurrentRow.DataBoundItem;
textAppointmentTitle.Text = elem.Title;
textAppointmentDescription.Text = elem.Text;
dateTimePickerAppointmentStart.Value = elem.Start;
dateTimePickerAppointmentEnd.Value = elem.End;
}
}
private void dataNotes_CurrentCellChanged(object sender, EventArgs e)
{
if (dataNotes.CurrentRow?.DataBoundItem != null)
{
Note elem = (Note) dataNotes.CurrentRow.DataBoundItem;
textNotesTitle.Text = elem.Title;
textNotesNote.Text = elem.Text;
}
}
private void toolStripBtnRenameProject_Click(object sender, EventArgs e)
{
TextInput ti = new TextInput();
string title = ti.Show("New project name:", d.CurrentProject.Title);
d.CurrentProject.Title = title;
} }
} }
} }

@ -117,7 +117,34 @@
<resheader name="writer"> <resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.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> </resheader>
<metadata name="toolStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <metadata name="toolStripMenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value> <value>17, 17</value>
</metadata> </metadata>
<metadata name="dataGridViewTextBoxColumn1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="noteBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>479, 17</value>
</metadata>
<metadata name="Start.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="End.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="appointmentBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>278, 17</value>
</metadata>
<metadata name="Deadline.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Text.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="todoBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>122, 17</value>
</metadata>
<metadata name="elementBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>634, 17</value>
</metadata>
</root> </root>

@ -0,0 +1,10 @@
using System;
using System.ComponentModel;
namespace NoteMan
{
[Serializable]
public class MyBindingList<T> : BindingList<T>
{
}
}

@ -1,8 +1,8 @@
namespace NoteMan namespace NoteMan
{ {
class Note : Element public class Note : Element
{ {
public Note() : base() { } public Note() {}
public Note(string title, string text) : base(title, text) { } public Note(string title, string text) : base(title, text) { }
} }
} }

@ -47,7 +47,6 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="Appointment.cs" /> <Compile Include="Appointment.cs" />
<Compile Include="Controller.cs" />
<Compile Include="Data.cs" /> <Compile Include="Data.cs" />
<Compile Include="Element.cs" /> <Compile Include="Element.cs" />
<Compile Include="EndBeforeStartException.cs" /> <Compile Include="EndBeforeStartException.cs" />
@ -58,10 +57,17 @@
<DependentUpon>Form1.cs</DependentUpon> <DependentUpon>Form1.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="InvalidArgument.cs" /> <Compile Include="InvalidArgument.cs" />
<Compile Include="MyBindingList.cs" />
<Compile Include="Note.cs" /> <Compile Include="Note.cs" />
<Compile Include="Program.cs" /> <Compile Include="Program.cs" />
<Compile Include="Project.cs" /> <Compile Include="Project.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="TextInput.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="TextInput.Designer.cs">
<DependentUpon>TextInput.cs</DependentUpon>
</Compile>
<Compile Include="Todo.cs" /> <Compile Include="Todo.cs" />
<EmbeddedResource Include="Form1.resx"> <EmbeddedResource Include="Form1.resx">
<DependentUpon>Form1.cs</DependentUpon> <DependentUpon>Form1.cs</DependentUpon>
@ -76,6 +82,14 @@
<DependentUpon>Resources.resx</DependentUpon> <DependentUpon>Resources.resx</DependentUpon>
<DesignTime>True</DesignTime> <DesignTime>True</DesignTime>
</Compile> </Compile>
<EmbeddedResource Include="TextInput.resx">
<DependentUpon>TextInput.cs</DependentUpon>
</EmbeddedResource>
<None Include="ClassDiagram1.cd" />
<None Include="Properties\DataSources\Appointment.datasource" />
<None Include="Properties\DataSources\Element.datasource" />
<None Include="Properties\DataSources\Note.datasource" />
<None Include="Properties\DataSources\Todo.datasource" />
<None Include="Properties\Settings.settings"> <None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator> <Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput> <LastGenOutput>Settings.Designer.cs</LastGenOutput>

@ -1,7 +1,4 @@
using System; using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms; using System.Windows.Forms;
namespace NoteMan namespace NoteMan

@ -1,31 +1,61 @@
using System; using System;
using System.Collections.Generic; using System.ComponentModel;
namespace NoteMan namespace NoteMan
{ {
class Project public class Project
{ {
private string title; public BindingList<Element> Elements { get; } = new BindingList<Element>();
private List<Element> elements = new List<Element>();
public Project()
{
Title = "";
}
public Project(string title) public Project(string title)
{ {
SetTitle(title); Title = title;
// TODO: remove Test
Elements.Add(new Todo(title + ": Test 1", "Just a Test :-)", new DateTime(2017, 1, 1, 0, 0, 0)));
Elements.Add(new Todo(title + ": Test 2", "Just a simple Test :-)", new DateTime(2017, 2, 1)));
Elements.Add(new Note("Test", "Test"));
} }
private string GetTitle() public string Title { get; set; }
public void Add(Element element)
{ {
return title; Elements.Add(element);
} }
private void SetTitle(string title) private BindingList<Element> GetElementsOfType(Type type)
{ {
if (title.Length < 3) BindingList<Element> items = new BindingList<Element>();
foreach (Element e in Elements)
{ {
Console.Out.WriteLine("Mininum Title length is 3!"); if (e.GetType() == type)
throw new InvalidArgument(); {
items.Add(e);
}
} }
this.title = title; return items;
}
public BindingList<Element> GetAppointments()
{
return GetElementsOfType(typeof(Appointment));
}
public BindingList<Element> GetTodos()
{
return GetElementsOfType(typeof(Todo));
}
public BindingList<Element> GetNotes()
{
return GetElementsOfType(typeof(Note));
}
public override string ToString()
{
return Title;
} }
} }
} }

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
This file is automatically generated by Visual Studio .Net. It is
used to store generic object data source configuration information.
Renaming the file extension or editing the content of this file may
cause the file to be unrecognizable by the program.
-->
<GenericObjectDataSource DisplayName="Appointment" Version="1.0" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
<TypeInfo>NoteMan.Appointment, NoteMan, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null</TypeInfo>
</GenericObjectDataSource>

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
This file is automatically generated by Visual Studio .Net. It is
used to store generic object data source configuration information.
Renaming the file extension or editing the content of this file may
cause the file to be unrecognizable by the program.
-->
<GenericObjectDataSource DisplayName="Element" Version="1.0" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
<TypeInfo>NoteMan.Element, NoteMan, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null</TypeInfo>
</GenericObjectDataSource>

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
This file is automatically generated by Visual Studio .Net. It is
used to store generic object data source configuration information.
Renaming the file extension or editing the content of this file may
cause the file to be unrecognizable by the program.
-->
<GenericObjectDataSource DisplayName="Note" Version="1.0" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
<TypeInfo>NoteMan.Note, NoteMan, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null</TypeInfo>
</GenericObjectDataSource>

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
This file is automatically generated by Visual Studio .Net. It is
used to store generic object data source configuration information.
Renaming the file extension or editing the content of this file may
cause the file to be unrecognizable by the program.
-->
<GenericObjectDataSource DisplayName="Todo" Version="1.0" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
<TypeInfo>NoteMan.Todo, NoteMan, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null</TypeInfo>
</GenericObjectDataSource>

@ -1,10 +1,10 @@
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// <auto-generated> // <auto-generated>
// Dieser Code wurde von einem Tool generiert. // This code was generated by a tool.
// Laufzeitversion:4.0.30319.42000 // Runtime Version:4.0.30319.42000
// //
// Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn // Changes to this file may cause incorrect behavior and will be lost if
// der Code erneut generiert wird. // the code is regenerated.
// </auto-generated> // </auto-generated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
@ -13,12 +13,12 @@ namespace NoteMan.Properties {
/// <summary> /// <summary>
/// Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw. /// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary> /// </summary>
// Diese Klasse wurde von der StronglyTypedResourceBuilder automatisch generiert // This class was auto-generated by the StronglyTypedResourceBuilder
// -Klasse ĂĽber ein Tool wie ResGen oder Visual Studio automatisch generiert. // class via a tool like ResGen or Visual Studio.
// Um einen Member hinzuzufĂĽgen oder zu entfernen, bearbeiten Sie die .ResX-Datei und fĂĽhren dann ResGen // To add or remove a member, edit your .ResX file then rerun ResGen
// mit der /str-Option erneut aus, oder Sie erstellen Ihr VS-Projekt neu. // with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
@ -33,7 +33,7 @@ namespace NoteMan.Properties {
} }
/// <summary> /// <summary>
/// Gibt die zwischengespeicherte ResourceManager-Instanz zurĂĽck, die von dieser Klasse verwendet wird. /// Returns the cached ResourceManager instance used by this class.
/// </summary> /// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager { internal static global::System.Resources.ResourceManager ResourceManager {
@ -47,8 +47,8 @@ namespace NoteMan.Properties {
} }
/// <summary> /// <summary>
/// Ăśberschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads fĂĽr alle /// Overrides the current thread's CurrentUICulture property for all
/// Ressourcenzuordnungen, die diese stark typisierte Ressourcenklasse verwenden. /// resource lookups using this strongly typed resource class.
/// </summary> /// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture { internal static global::System.Globalization.CultureInfo Culture {
@ -61,7 +61,7 @@ namespace NoteMan.Properties {
} }
/// <summary> /// <summary>
/// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. /// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary> /// </summary>
internal static System.Drawing.Bitmap application_exit { internal static System.Drawing.Bitmap application_exit {
get { get {
@ -71,7 +71,7 @@ namespace NoteMan.Properties {
} }
/// <summary> /// <summary>
/// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. /// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary> /// </summary>
internal static System.Drawing.Bitmap dialog_cancel { internal static System.Drawing.Bitmap dialog_cancel {
get { get {
@ -81,7 +81,7 @@ namespace NoteMan.Properties {
} }
/// <summary> /// <summary>
/// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. /// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary> /// </summary>
internal static System.Drawing.Bitmap dialog_close { internal static System.Drawing.Bitmap dialog_close {
get { get {
@ -91,7 +91,7 @@ namespace NoteMan.Properties {
} }
/// <summary> /// <summary>
/// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. /// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary> /// </summary>
internal static System.Drawing.Bitmap dialog_ok { internal static System.Drawing.Bitmap dialog_ok {
get { get {
@ -101,7 +101,7 @@ namespace NoteMan.Properties {
} }
/// <summary> /// <summary>
/// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. /// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary> /// </summary>
internal static System.Drawing.Bitmap dialog_ok_apply { internal static System.Drawing.Bitmap dialog_ok_apply {
get { get {
@ -111,7 +111,7 @@ namespace NoteMan.Properties {
} }
/// <summary> /// <summary>
/// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. /// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary> /// </summary>
internal static System.Drawing.Bitmap document_close { internal static System.Drawing.Bitmap document_close {
get { get {
@ -121,7 +121,7 @@ namespace NoteMan.Properties {
} }
/// <summary> /// <summary>
/// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. /// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary> /// </summary>
internal static System.Drawing.Bitmap document_edit { internal static System.Drawing.Bitmap document_edit {
get { get {
@ -131,7 +131,7 @@ namespace NoteMan.Properties {
} }
/// <summary> /// <summary>
/// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. /// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary> /// </summary>
internal static System.Drawing.Bitmap document_edit1 { internal static System.Drawing.Bitmap document_edit1 {
get { get {
@ -141,7 +141,7 @@ namespace NoteMan.Properties {
} }
/// <summary> /// <summary>
/// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. /// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary> /// </summary>
internal static System.Drawing.Bitmap document_new { internal static System.Drawing.Bitmap document_new {
get { get {
@ -151,7 +151,7 @@ namespace NoteMan.Properties {
} }
/// <summary> /// <summary>
/// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. /// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary> /// </summary>
internal static System.Drawing.Bitmap document_open { internal static System.Drawing.Bitmap document_open {
get { get {
@ -161,7 +161,7 @@ namespace NoteMan.Properties {
} }
/// <summary> /// <summary>
/// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. /// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary> /// </summary>
internal static System.Drawing.Bitmap document_save { internal static System.Drawing.Bitmap document_save {
get { get {
@ -171,7 +171,7 @@ namespace NoteMan.Properties {
} }
/// <summary> /// <summary>
/// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. /// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary> /// </summary>
internal static System.Drawing.Bitmap document_save_as { internal static System.Drawing.Bitmap document_save_as {
get { get {
@ -181,7 +181,16 @@ namespace NoteMan.Properties {
} }
/// <summary> /// <summary>
/// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. /// Looks up a localized string similar to XML Files (*.xml)|*.xml|All Files (*.*)|*.*.
/// </summary>
internal static string ExportFileTypeXML {
get {
return ResourceManager.GetString("ExportFileTypeXML", resourceCulture);
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary> /// </summary>
internal static System.Drawing.Bitmap media_playlist_repeat { internal static System.Drawing.Bitmap media_playlist_repeat {
get { get {
@ -191,7 +200,7 @@ namespace NoteMan.Properties {
} }
/// <summary> /// <summary>
/// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. /// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary> /// </summary>
internal static System.Drawing.Bitmap project_development { internal static System.Drawing.Bitmap project_development {
get { get {
@ -201,7 +210,7 @@ namespace NoteMan.Properties {
} }
/// <summary> /// <summary>
/// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. /// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary> /// </summary>
internal static System.Drawing.Bitmap project_development_close { internal static System.Drawing.Bitmap project_development_close {
get { get {
@ -211,7 +220,7 @@ namespace NoteMan.Properties {
} }
/// <summary> /// <summary>
/// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. /// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary> /// </summary>
internal static System.Drawing.Bitmap project_development_new_template { internal static System.Drawing.Bitmap project_development_new_template {
get { get {
@ -221,11 +230,11 @@ namespace NoteMan.Properties {
} }
/// <summary> /// <summary>
/// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. /// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary> /// </summary>
internal static System.Drawing.Bitmap text_plain { internal static System.Drawing.Bitmap text_plain {
get { get {
object obj = ResourceManager.GetObject("Text-plain", resourceCulture); object obj = ResourceManager.GetObject("text-plain", resourceCulture);
return ((System.Drawing.Bitmap)(obj)); return ((System.Drawing.Bitmap)(obj));
} }
} }

@ -169,4 +169,8 @@
<data name="media-playlist-repeat" type="System.Resources.ResXFileRef, System.Windows.Forms"> <data name="media-playlist-repeat" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\media-playlist-repeat.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> <value>..\Resources\media-playlist-repeat.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data> </data>
<data name="ExportFileTypeXML" xml:space="preserve">
<value>XML Files (*.xml)|*.xml|All Files (*.*)|*.*</value>
<comment>XML or All Files</comment>
</data>
</root> </root>

@ -0,0 +1,104 @@
namespace NoteMan
{
partial class TextInput
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.btnOK = new System.Windows.Forms.Button();
this.btnCancel = new System.Windows.Forms.Button();
this.txtInput = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// btnOK
//
this.btnOK.BackColor = System.Drawing.Color.PaleGreen;
this.btnOK.Location = new System.Drawing.Point(13, 51);
this.btnOK.Name = "btnOK";
this.btnOK.Size = new System.Drawing.Size(150, 23);
this.btnOK.TabIndex = 1;
this.btnOK.Text = "OK";
this.btnOK.UseVisualStyleBackColor = false;
this.btnOK.Click += new System.EventHandler(this.btnOK_Click);
//
// btnCancel
//
this.btnCancel.BackColor = System.Drawing.Color.OrangeRed;
this.btnCancel.Location = new System.Drawing.Point(169, 51);
this.btnCancel.Name = "btnCancel";
this.btnCancel.Size = new System.Drawing.Size(150, 23);
this.btnCancel.TabIndex = 2;
this.btnCancel.Text = "Cancel";
this.btnCancel.UseVisualStyleBackColor = false;
this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
//
// txtInput
//
this.txtInput.Location = new System.Drawing.Point(12, 25);
this.txtInput.Name = "txtInput";
this.txtInput.Size = new System.Drawing.Size(305, 20);
this.txtInput.TabIndex = 0;
this.txtInput.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.txtInput_KeyPress);
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(12, 9);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(41, 13);
this.label1.TabIndex = 3;
this.label1.Text = "Name?";
//
// TextInput
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(329, 83);
this.ControlBox = false;
this.Controls.Add(this.label1);
this.Controls.Add(this.txtInput);
this.Controls.Add(this.btnCancel);
this.Controls.Add(this.btnOK);
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "TextInput";
this.ShowInTaskbar = false;
this.Text = "TextInput";
this.TopMost = true;
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Button btnOK;
private System.Windows.Forms.Button btnCancel;
private System.Windows.Forms.TextBox txtInput;
private System.Windows.Forms.Label label1;
}
}

@ -0,0 +1,69 @@
using System;
using System.Windows.Forms;
namespace NoteMan
{
public partial class TextInput : Form
{
private string _returnValue;
public TextInput()
{
InitializeComponent();
}
public new string Show()
{
return Show("Name?", "");
}
public new string ShowDialog()
{
return Show("Name?", "");
}
public string Show(string label)
{
return Show(label, "");
}
public string ShowDialog(string label)
{
return Show(label, "");
}
public string ShowDialog(string label, string value)
{
return Show(label, value);
}
public string Show(string label, string value)
{
_returnValue = null;
txtInput.Text = "";
label1.Text = label;
txtInput.Text = value;
base.ShowDialog();
return _returnValue;
}
private void btnOK_Click(object sender, EventArgs e)
{
_returnValue = txtInput.Text;
Close();
}
private void btnCancel_Click(object sender, EventArgs e)
{
Close();
}
private void txtInput_KeyPress(object sender, KeyPressEventArgs e)
{
if (e.KeyChar == (char) 13)
{
_returnValue = txtInput.Text;
Close();
}
}
}
}

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: 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">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<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">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<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" 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">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<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=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

@ -2,29 +2,24 @@
namespace NoteMan namespace NoteMan
{ {
class Todo : Element public class Todo : Element
{ {
private DateTime deadline; public DateTime Deadline { get; set; }
public Todo() : base() public Todo()
{ {
deadline = new DateTime(); Deadline = new DateTime();
} }
public Todo(string title, string text, DateTime deadline) : base(title, text) public Todo(string title, string text, DateTime deadline) : base(title, text)
{ {
this.deadline = deadline; Deadline = deadline;
} }
public void UpdateRecord(string title, string text, DateTime deadline) public void UpdateRecord(string title, string text, DateTime deadline)
{ {
base.UpdateRecord(title, text); base.UpdateRecord(title, text);
this.deadline = deadline; Deadline = deadline;
}
public DateTime GetDeadline()
{
return deadline;
} }
} }
} }

Loading…
Cancel
Save