Beispiel #1
0
        internal static void Print(PwDatabase pd, bool bEmSheet, bool bKeyFile)
        {
            if ((pd == null) || !pd.IsOpen)
            {
                Debug.Assert(false); return;
            }
            if (!bEmSheet && !bKeyFile)
            {
                Debug.Assert(false); return;
            }

            if (!bEmSheet && bKeyFile)
            {
                string strText = KPRes.KeyFilePrintLocal + MessageService.NewParagraph +
                                 KPRes.AskContinue;
                if (!MessageService.AskYesNo(strText))
                {
                    return;
                }
            }

            try { PrintUtil.PrintHtml(GenerateDoc(pd, bEmSheet, bKeyFile)); }
            catch (Exception ex)
            {
                MessageService.ShowWarning(ex);
            }
        }
Beispiel #2
0
        public static void Print(PwDatabase pd)
        {
            if ((pd == null) || !pd.IsOpen)
            {
                Debug.Assert(false); return;
            }

            try
            {
                string strName = UrlUtil.StripExtension(UrlUtil.GetFileName(
                                                            pd.IOConnectionInfo.Path));
                if (strName.Length == 0)
                {
                    strName = KPRes.Database;
                }

                string strHtml = GenerateHtml(pd, strName);
                PrintUtil.PrintHtml(strHtml);
            }
            catch (Exception ex)
            {
                MessageService.ShowWarning(ex);
            }
        }