public bool openXmlWithDialog() { try { CSKernelFile.cFile file = new CSKernelFile.cFile(); file.setFilter(m_filter); file.init("OpenXmlWithDialog", C_MODULE, m_commDialog); if (!file.open(m_name, eFileMode.eRead, false, false, eFileAccess.eLockReadWrite, true, true)) { return false; } m_name = file.getName(); m_path = file.getPath(); file.close(); file = null; return openXml(); } catch (Exception ex) { cError.mngError(ex, "OpenXmlWithDialog", C_MODULE, "There was an error trying to open file: " + m_name); return false; } }
public bool openXmlWithDialog() { try { CSKernelFile.cFile file = new CSKernelFile.cFile(); file.setFilter(m_filter); file.init("OpenXmlWithDialog", C_MODULE, m_commDialog); if (!file.open(m_name, eFileMode.eRead, false, false, eFileAccess.eLockReadWrite, true, true)) { return(false); } m_name = file.getName(); m_path = file.getPath(); file.close(); file = null; return(openXml()); } catch (Exception ex) { cError.mngError(ex, "OpenXmlWithDialog", C_MODULE, "There was an error trying to open file: " + m_name); return(false); } }
public bool newXmlWithDialog() { try { string msg = ""; CSKernelFile.cFile file = new CSKernelFile.cFile(); file.init("NewXmlWithDialog", C_MODULE, m_commDialog); file.setFilter(m_filter); bool bExists = false; bool bReadonly = false; if (!file.save(m_name, out bExists, out bReadonly, "")) { return(false); } if (bExists && bReadonly) { msg = "There is already a file with this name and it is read only. Do you want to replace this file?"; } else if (bExists) { if (m_name != file.getName()) { msg = "There is already a file with this name. Do you want to replace this file?"; } } if (msg != "") { if (!cWindow.ask(msg, MessageBoxDefaultButton.Button2, "Saving")) { return(false); } } m_name = file.getName(); m_path = file.getPath(); file = null; return(newXml()); } catch (Exception ex) { cError.mngError(ex, "NewXmlWithDialog", C_MODULE, "There was an error trying to create the file: " + m_name); return(false); } }
public bool saveWithDialog() { try { CSKernelFile.cFile file = new CSKernelFile.cFile(); if (!file.open(m_name, eFileMode.eWrite, false, false, eFileAccess.eLockWrite, false, false)) { return(false); } m_name = file.getName(); m_path = file.getPath(); file = null; return(save()); } catch (Exception ex) { cError.mngError(ex, "SaveWithDialog", C_MODULE, "There was an error trying to save the file: " + m_name); return(false); } }
/* TODO: implement me private void form_QueryUnload(int cancel, int unloadMode) { cancel = !saveChanges(); if (cancel) { cGlobals.setDocActive(this); } } */ /* TODO: implement me private void form_Unload(int cancel) { if (m_fmain.getReportCopySource() == this) { m_fmain.setReportCopySource(null); } if (fSearch.fSearch.getFReport() == this) { fSearch.fSearch.setFReport(null); } m_report = null; m_paint = null; m_fToolBox = null; m_fControls = null; m_fTreeCtrls = null; m_fConnectsAux = null; m_fProperties = null; m_fFormula = null; m_fGroup = null; m_fProgress.Hide(); m_fProgress = null; cGlobals.setDocInacActive(this); G.redim(ref m_vSelectedKeys, 0); G.redim(ref m_vCopyKeys, 0); } */ public void init() { m_showingProperties = false; cReportLaunchInfo oLaunchInfo = null; m_report = new cReport(); // TODO: event handler for // /* m_report_Done(); m_report_Progress(task, page, currRecord, recordCount, cancel,); m_report_FindFileAccess(answer, commDialog, file,); */ oLaunchInfo = new cReportLaunchInfo(); m_report.getPaperInfo().setPaperSize(m_fmain.getPaperSize()); m_report.getPaperInfo().setOrientation(m_fmain.getOrientation()); oLaunchInfo.setPrinter(cPrintAPI.getcPrinterFromDefaultPrinter()); oLaunchInfo.setObjPaint(new CSReportPaint.cReportPrint()); if (!m_report.init(oLaunchInfo)) { return; } CSKernelFile.cFile file = new CSKernelFile.cFile(); m_report.setPathDefault(Application.StartupPath); m_picReport.Top = C_TOPBODY; m_picRule.Left = 0; m_picReport.Left = pGetLeftBody(); m_keyMoving = ""; m_keySizing = ""; m_keyObj = ""; m_keyFocus = ""; m_nextNameCtrl = 0; m_paint = new CSReportPaint.cReportPaint(); Rectangle tR = null; cReportPaperInfo w_paperInfo = m_report.getPaperInfo(); tR = new Rectangle(CSReportPaint.cGlobals.getRectFromPaperSize( m_report.getPaperInfo(), w_paperInfo.getPaperSize(), w_paperInfo.getOrientation())); cGlobals.createStandarSections(m_report, tR); m_paint.setGridHeight(pSetSizePics(tR.height)); m_paint.initGrid(m_picReport.CreateGraphics(), m_typeGrid); paintStandarSections(); m_dataHasChanged = false; }
public bool saveWithDialog() { try { CSKernelFile.cFile file = new CSKernelFile.cFile(); if (!file.open(m_name, eFileMode.eWrite, false, false, eFileAccess.eLockWrite, false, false)) { return false; } m_name = file.getName(); m_path = file.getPath(); file = null; return save(); } catch (Exception ex) { cError.mngError(ex, "SaveWithDialog", C_MODULE, "There was an error trying to save the file: " + m_name); return false; } }
public bool newXmlWithDialog() { try { string msg = ""; CSKernelFile.cFile file = new CSKernelFile.cFile(); file.init("NewXmlWithDialog", C_MODULE, m_commDialog); file.setFilter(m_filter); bool bExists = false; bool bReadonly = false; if (!file.save(m_name, out bExists, out bReadonly, "")) { return false; } if (bExists && bReadonly) { msg = "There is already a file with this name and it is read only. Do you want to replace this file?"; } else if (bExists) { if (m_name != file.getName()) { msg = "There is already a file with this name. Do you want to replace this file?"; } } if (msg != "") { if (!cWindow.ask(msg, MessageBoxDefaultButton.Button2, "Saving")) { return false; } } m_name = file.getName(); m_path = file.getPath(); file = null; return newXml(); } catch (Exception ex) { cError.mngError(ex, "NewXmlWithDialog", C_MODULE, "There was an error trying to create the file: " + m_name); return false; } }