32 |
this.DocumentTab.Text = string.Format("{0}{1}", this.DocumentFilename, this.DocumentIndex); |
this.DocumentTab.Text = string.Format("{0}{1}", this.DocumentFilename, this.DocumentIndex); |
33 |
//this.DocumentClosing += new BaseEventHandler<ControlClosingEventArgs<int>>(ScratchPadDocument_DocumentClosing); |
//this.DocumentClosing += new BaseEventHandler<ControlClosingEventArgs<int>>(ScratchPadDocument_DocumentClosing); |
34 |
this.IsDefaultDocument = true; |
this.IsDefaultDocument = true; |
35 |
|
this.DocumentSaved = true; |
36 |
this.DocumentTab.Controls.Add(this); |
this.DocumentTab.Controls.Add(this); |
37 |
} |
} |
38 |
|
|
90 |
private void mnuItemOpen_Click(object sender, EventArgs e) |
private void mnuItemOpen_Click(object sender, EventArgs e) |
91 |
{ |
{ |
92 |
OpenDocument(); |
OpenDocument(); |
93 |
|
this.DocumentSaved = true; // the file was just opened |
94 |
} |
} |
95 |
|
|
96 |
private void mnuItemSave_Click(object sender, EventArgs e) |
private void mnuItemSave_Click(object sender, EventArgs e) |
131 |
txtEditor.Document.ReParse(); |
txtEditor.Document.ReParse(); |
132 |
this.UpdateTabName(fi.Name); |
this.UpdateTabName(fi.Name); |
133 |
this.IsDefaultDocument = false; |
this.IsDefaultDocument = false; |
134 |
|
this.DocumentSaved = true; |
135 |
} |
} |
136 |
catch (Exception ex) |
catch (Exception ex) |
137 |
{ |
{ |
147 |
} |
} |
148 |
catch (Exception ex) |
catch (Exception ex) |
149 |
{ |
{ |
150 |
|
this.DocumentSaved = false; |
151 |
MessageBox.Show(string.Format("Failed to open: '{0}'", fi.Name), "", MessageBoxButtons.OK, MessageBoxIcon.Error); |
MessageBox.Show(string.Format("Failed to open: '{0}'", fi.Name), "", MessageBoxButtons.OK, MessageBoxIcon.Error); |
152 |
logger.Error.WriteLine("Failed to open: '{0}'", fi.FullName); |
logger.Error.WriteLine("Failed to open: '{0}'", fi.FullName); |
153 |
logger.Error.WriteLine(ex.ToString()); |
logger.Error.WriteLine(ex.ToString()); |