//------------------------------------------------------------------------ private void SaveAsSymitar() { frmFileOpen saveAs = new frmFileOpen(fileName); DialogResult result = saveAs.ShowDialog(Util.MainForm); if (result == DialogResult.Cancel) { saveAs.Dispose(); return; } if (result == DialogResult.No) { saveAs.Dispose(); SaveAsLocal(); return; } if (saveAs.saveAsIsLocal) //not a Local Filesystem file, but a LOCAL mounted Filesystem file { fileLocal = saveAs.saveAsLocal.Path + '\\' + saveAs.saveAsName; if (SaveLocal()) { fileOrigin = Origin.LOCAL; fileType = FileTypeFromExtension(fileLocal); Icon = IconFromType(fileType); } } else { SymInst inst = saveAs.saveAsInst; fileSym = new SymFile(inst.Parent.IP, inst.SymDir, saveAs.saveAsName, DateTime.Now, icsEditor.Text.Length, saveAs.saveAsType); fileName = saveAs.saveAsName; if (SaveSymitar()) { fileOrigin = Origin.SYM; fileType = FileTypeFromSymFile(fileSym); Icon = IconFromType(fileType); if (fileType == ProjectFile.FileType.REPGEN) { icsEditor.SetHighlighting("RepGen"); completer = new RepGenComplete(); folder = new RepGenFold(); icsEditor.Document.FoldingManager.FoldingStrategy = folder; } else if (fileType == ProjectFile.FileType.LETTER) { icsEditor.SetHighlighting("Default"); icsEditor.Document.FoldingManager.FoldingStrategy = new ICSharpCode.TextEditor.Document.IndentFoldingStrategy(); } SetModified(false, true); } } }
//------------------------------------------------------------------------ private void mnuFileOpenSym_Click(object sender, EventArgs e) { frmFileOpen openFile = new frmFileOpen(); DialogResult result = openFile.ShowDialog(this); openFile.Dispose(); if (result == DialogResult.OK) { mnuFileOpenLocal_Click(sender, e); } if (ActiveSource != null) { ActiveSource.icsEditor.Focus(); } }