Adjusted Code to StyleGuide

main
Thomas Ba. 8 years ago
parent bf6720a047
commit a8a5e70e74

@ -2,15 +2,15 @@
namespace NoteMan
{
class Appointment : Element
public class Appointment : Element
{
private DateTime start;
private DateTime end;
public DateTime Start { get; set; }
public DateTime End { get; set; }
public Appointment()
{
start = new DateTime();
end = new DateTime();
Start = DateTime.Now;
End = DateTime.Now;
}
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!");
throw new EndBeforeStartException();
}
this.start = start;
this.end = end;
Start = start;
End = end;
}
@ -33,8 +33,8 @@ namespace NoteMan
throw new EndBeforeStartException();
}
base.UpdateRecord(title, text);
this.start = start;
this.end = end;
Start = start;
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.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.ComponentModel;
using System.IO;
using System.Xml;
using System.Xml.Serialization;
namespace NoteMan
{
class Data
public class Data
{
private string filename = null;
private List<Project> projects = new List<Project>();
public MyBindingList<Project> Projects = new MyBindingList<Project>();
public Data() { }
public Data(string filename)
public Data()
{
this.filename = filename;
// TODO: implement import!
CurrentProject = new Project("Default project");
Projects.Add(CurrentProject);
}
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
{
class Element
[XmlInclude(typeof(Todo))]
[XmlInclude(typeof(Appointment))]
[XmlInclude(typeof(Note))]
public class Element
{
protected string Title;
protected string Text;
public string Title { get; set; }
public string Text { get; set; }
public Element()
{
Title = "";
Title = "unnamed";
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)
public Element(string title, string text)
{
this.Text = text;
Title = title;
Text = text;
}
public void UpdateRecord(string title, string text)
{
SetTitle(title);
SetText(text);
Title = title;
Text = text;
}
}
}

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

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

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

@ -47,7 +47,6 @@
</ItemGroup>
<ItemGroup>
<Compile Include="Appointment.cs" />
<Compile Include="Controller.cs" />
<Compile Include="Data.cs" />
<Compile Include="Element.cs" />
<Compile Include="EndBeforeStartException.cs" />
@ -58,10 +57,17 @@
<DependentUpon>Form1.cs</DependentUpon>
</Compile>
<Compile Include="InvalidArgument.cs" />
<Compile Include="MyBindingList.cs" />
<Compile Include="Note.cs" />
<Compile Include="Program.cs" />
<Compile Include="Project.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" />
<EmbeddedResource Include="Form1.resx">
<DependentUpon>Form1.cs</DependentUpon>
@ -76,6 +82,14 @@
<DependentUpon>Resources.resx</DependentUpon>
<DesignTime>True</DesignTime>
</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">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>

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

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

@ -169,4 +169,8 @@
<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>
</data>
<data name="ExportFileTypeXML" xml:space="preserve">
<value>XML Files (*.xml)|*.xml|All Files (*.*)|*.*</value>
<comment>XML or All Files</comment>
</data>
</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
{
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)
{
this.deadline = deadline;
Deadline = deadline;
}
public void UpdateRecord(string title, string text, DateTime deadline)
{
base.UpdateRecord(title, text);
this.deadline = deadline;
}
public DateTime GetDeadline()
{
return deadline;
Deadline = deadline;
}
}
}

Loading…
Cancel
Save