예제 #1
0
파일: MainForm.cs 프로젝트: hmahal/KeePass
        private void PrepareSave()
        {
            m_trl.Properties.Application        = PwDefs.ProductName;
            m_trl.Properties.ApplicationVersion = PwDefs.VersionString;
            m_trl.Properties.Generator          = TrlUtilName;

            PwUuid pwUuid = new PwUuid(true);

            m_trl.Properties.FileUuid = pwUuid.ToHexString();

            m_trl.Properties.LastModified = DateTime.Now.ToString("u");

            m_trl.UnusedText = m_rtbUnusedText.Text;

            try { Validate3Dots(); }
            catch (Exception) { Debug.Assert(false); }

            try
            {
                string strAccel = AccelKeysCheck.Validate(m_trl);
                if (strAccel != null)
                {
                    MessageBox.Show(this, "Warning! The following accelerator keys collide:" +
                                    MessageService.NewParagraph + strAccel + MessageService.NewParagraph +
                                    "Click [OK] to continue saving.", TrlUtilName, MessageBoxButtons.OK,
                                    MessageBoxIcon.Warning);
                }
            }
            catch (Exception) { Debug.Assert(false); }
        }
예제 #2
0
        private void PrepareSave()
        {
            m_trl.Properties.Application        = PwDefs.ProductName;
            m_trl.Properties.ApplicationVersion = PwDefs.VersionString;
            m_trl.Properties.Generator          = TrlUtilName;

            PwUuid pwUuid = new PwUuid(true);

            m_trl.Properties.FileUuid = pwUuid.ToHexString();

            m_trl.Properties.LastModified = DateTime.UtcNow.ToString("u");

            m_trl.UnusedText = m_rtbUnusedText.Text;
            if (!string.IsNullOrEmpty(m_trl.UnusedText))
            {
                ShowValidationWarning(@"It is recommended to clear the 'Unused Text' tab.");
            }

            try { ValidateTranslation(); }
            catch (Exception) { Debug.Assert(false); }

            try
            {
                string strAccel = AccelKeysCheck.Validate(m_trl);
                if (strAccel != null)
                {
                    ShowValidationWarning("The following accelerator keys collide:" +
                                          MessageService.NewParagraph + strAccel);
                }
            }
            catch (Exception) { Debug.Assert(false); }
        }