コード例 #1
0
ファイル: cXML.cs プロジェクト: adri78/CSReports.net
        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);
            }
        }
コード例 #2
0
ファイル: cXML.cs プロジェクト: javiercrowsoft/CSReports.net
        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;
            }
        }
コード例 #3
0
ファイル: cXML.cs プロジェクト: adri78/CSReports.net
        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);
            }
        }
コード例 #4
0
ファイル: cXML.cs プロジェクト: adri78/CSReports.net
        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);
            }
        }
コード例 #5
0
ファイル: cXML.cs プロジェクト: javiercrowsoft/CSReports.net
        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;
            }            
        }
コード例 #6
0
ファイル: cXML.cs プロジェクト: javiercrowsoft/CSReports.net
        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;
            }
        }