116 |
catch { } |
catch { } |
117 |
} |
} |
118 |
|
|
119 |
|
|
120 |
|
private void AddDocument(ScratchPadDocument t) |
121 |
|
{ |
122 |
|
t.DocumentClosing += new BaseEventHandler<ControlClosingEventArgs<int>>(t_DocumentClosing); |
123 |
|
docuemntList.Add(t); |
124 |
|
this.tb.TabPages.Add(t.DocumentTab); |
125 |
|
t.Dock = DockStyle.Fill; |
126 |
|
} |
127 |
|
|
128 |
private void mnuItemNew_Click(object sender, EventArgs e) |
private void mnuItemNew_Click(object sender, EventArgs e) |
129 |
{ |
{ |
130 |
// create new document |
// create new document |
131 |
int tp_index = this.tb.TabPages.Count; |
int tp_index = this.tb.TabPages.Count; |
132 |
ScratchPadDocument t = new ScratchPadDocument(tp_index); |
ScratchPadDocument t = new ScratchPadDocument(tp_index); |
133 |
t.DocumentClosing += new BaseEventHandler<ControlClosingEventArgs<int>>(t_DocumentClosing); |
AddDocument(t); |
|
docuemntList.Add(t); |
|
|
this.tb.TabPages.Add(t.DocumentTab); |
|
134 |
} |
} |
135 |
|
|
136 |
private void ScratchPad_Load(object sender, EventArgs e) |
private void ScratchPad_Load(object sender, EventArgs e) |
137 |
{ |
{ |
138 |
int tp_index = this.tb.TabPages.Count; |
int tp_index = this.tb.TabPages.Count; |
139 |
ScratchPadDocument t = new ScratchPadDocument(tp_index); |
ScratchPadDocument t = new ScratchPadDocument(tp_index); |
140 |
t.DocumentClosing += new BaseEventHandler<ControlClosingEventArgs<int>>(t_DocumentClosing); |
AddDocument(t); |
|
docuemntList.Add(t); |
|
|
this.tb.TabPages.Add(t.DocumentTab); |
|
141 |
} |
} |
142 |
|
|
143 |
void t_DocumentClosing(ControlClosingEventArgs<int> e) |
void t_DocumentClosing(ControlClosingEventArgs<int> e) |