示例#1
0
        public int Run()
        {
            DialogResult Result = DialogResult.OK;

            try
            {
                // Initialize the form
                InitializeForm();

                // Are we running interactively?

                if (CSYS.iInteractive() != 0)
                {
                    Result = ShowDialog();
                }
                else
                {
                    ini.RefreshControls();
                }
            }
            catch (ApplicationException e)
            {
                // An empty message indicates a CSYS.Cancel()
                if (e.Message.Length > 0)
                {
                    ShowErrorAndExit(e.Message);
                }
                else
                {
                    Result = DialogResult.Cancel;
                }
            }
            catch (Exception e)
            {
                ShowErrorAndExit(CreateGXFailureMessage(e.Message));
            }

            if (Result == DialogResult.OK)
            {
                try
                {
                    Execute();
                    return(0);
                }
                catch (Exception e)
                {
                    // An empty message indicates a cancel
                    if (e.Message.Length > 0)
                    {
                        ShowErrorAndExit(e.Message);
                    }
                }
            }
            return(1);
        }
示例#2
0
        public void FillComboBoxes()
        {
            // --- For 8.5 restrict larger page sizes to a select "in" group ---

            bool bigData = (CSYS.iInteractive() == 0) || (CSYS.iGetInt(ini.GroupName, _n("PAGESIZE")) > 16384);

            // --- In the following two controls, the "Value" part
            //     is the pagesize; the two controls are locked together ---

            m_cbMaxDataPerChan.AddItem(_("4 Megabytes"), 64);
            m_cbMaxDataPerChan.AddItem(_("8 Megabytes"), 128);
            m_cbMaxDataPerChan.AddItem(_("16 Megabytes"), 256);
            m_cbMaxDataPerChan.AddItem(_("32 Megabytes"), 512);
            m_cbMaxDataPerChan.AddItem(_("64 Megabytes (Standard)"), 1024);
            m_cbMaxDataPerChan.AddItem(_("128 Megabytes"), 2048);
            m_cbMaxDataPerChan.AddItem(_("256 Megabytes"), 4096);
            m_cbMaxDataPerChan.AddItem(_("512 Megabytes"), 8192);
            m_cbMaxDataPerChan.AddItem(_("1 Gigabyte"), 16384);
            if (bigData)
            {
                m_cbMaxDataPerChan.AddItem(_("2 Gigabytes"), 32768);
                m_cbMaxDataPerChan.AddItem(_("4 Gigabytes"), 65536);
                m_cbMaxDataPerChan.AddItem(_("8 Gigabytes"), 131072);
                m_cbMaxDataPerChan.AddItem(_("16 Gigabytes"), 262144);
                m_cbMaxDataPerChan.AddItem(_("32 Gigabytes"), 524288);
                m_cbMaxDataPerChan.AddItem(_("64 Gigabytes"), 1048576);
            }

            m_cbMaxData.AddItem(_("256 Gigabytes"), 64);
            m_cbMaxData.AddItem(_("512 Gigabytes"), 128);
            m_cbMaxData.AddItem(_("1 Terabyte"), 256);
            m_cbMaxData.AddItem(_("2 Terabytes"), 512);
            m_cbMaxData.AddItem(_("4 Terabytes (Standard)"), 1024);
            m_cbMaxData.AddItem(_("8 Terabytes"), 2048);
            m_cbMaxData.AddItem(_("16 Terabytes"), 4096);
            m_cbMaxData.AddItem(_("32 Terabytes"), 8192);
            m_cbMaxData.AddItem(_("64 Terabytes"), 16384);
            if (bigData)
            {
                m_cbMaxData.AddItem(_("128 Terabytes"), 32768);
                m_cbMaxData.AddItem(_("256 Terabytes"), 65536);
                m_cbMaxData.AddItem(_("512 Terabytes"), 131072);
                m_cbMaxData.AddItem(_("1 Exabyte"), 262144);
                m_cbMaxData.AddItem(_("2 Exabytes"), 524288);
                m_cbMaxData.AddItem(_("4 Exabytes"), 1048576);
            }

            m_cbCompression.AddItem(_("No compression"), 0);
            m_cbCompression.AddItem(_("Compress for speed"), 1);
            m_cbCompression.AddItem(_("Compress for size"), 2);

            string szCompression = string.Empty;

            if (CSYS.IiGlobal("MONTAJ.DB_COMPRESS", ref szCompression) == 0)
            {
                m_cbCompression.SetValue(szCompression);
            }

            ini.RefreshControls();
            m_cbMaxData.SetValue(m_cbMaxDataPerChan.strGetValue());
        }