// Full set up of dialog: public static DialogResult ShowBox(string aMessage, string aTitle, MessageBoxButtons aMsgBoxBtns, MessageBoxIcon aIcon, string aDetails) { CRSMessageBox lMsgBox = new CRSMessageBox(); lMsgBox.Title = aTitle; lMsgBox.MessageText = aMessage; lMsgBox.DialogButtons = aMsgBoxBtns; lMsgBox.DialogIcon = aIcon; lMsgBox.ApplyLocale(RsViewEngine.Locale); lMsgBox.Text = RsApplicationInfo.ApplicationName; lMsgBox.Details = aDetails; return(lMsgBox.ShowMsgBox()); }
protected override void dialogAccept(object Sender, System.EventArgs aEArgs) { if (_eFolderName.Text == "") { CRSMessageBox.ShowBox( XmlTools.getXmlNodeByAttrVal("name", "noName", DialogLocale).InnerText, RsViewEngine.Locale.GetTagText("error"), MessageBoxButtons.OK, MessageBoxIcon.Exclamation ); } else { base.dialogAccept(Sender, aEArgs); } }
public void DoAddReport() { XmlNode lThisData = RsViewEngine.Locale.GetFormData(LOCALE_ALIAS); RsReportCollection lCurrColl = getSelectedCollection(); if (lCurrColl == null) { CRSMessageBox.ShowBox( XmlTools.getXmlNodeByAttrVal("name", NOCOLLECTION_FILE, lThisData).InnerText, RsViewEngine.Locale.GetTagText("error"), MessageBoxButtons.OK, MessageBoxIcon.Exclamation ); } else { if (lCurrColl is CFavoritesCollection) { _dlgAddReport.CollectionName = RsViewEngine.Locale.GetTagText(RsLocalization.TAG_FAVORITES); } else { _dlgAddReport.CollectionName = lCurrColl.CollectionName; } _dlgAddReport.Modify = false; DialogResult lDlgRes = _dlgAddReport.ShowDialog(); if (lDlgRes == DialogResult.OK) { CReportFolder lParent = getCurrentParent(); if (lParent == null) { CRSMessageBox.ShowBox( RsViewEngine.Locale.GetTagText("collectionNotSelected"), RsViewEngine.Locale.GetTagText("error"), MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; } CReportFile lNewFile = new CReportFile(_dlgAddReport.Alias, _dlgAddReport.ReportFile); lNewFile.Parent = lParent; lParent.Collection.ApplyToGUI(); lParent.Collection.QuickSave(); } } }
// Show as statusbox: public static IRSStatusBox ShowStatusBox(string aTitle) { CRSMessageBox lMsgBox = new CRSMessageBox(); lMsgBox.Title = aTitle; lMsgBox._Icon.Image = (Image)RsViewEngine.Resources.GetObject("gfx_mail_48x48"); lMsgBox._Icon.BackColor = Color.White; lMsgBox.MessageText = ""; lMsgBox.ShowAsStatusBox = true; lMsgBox.setLayout(); lMsgBox.MinimizeBox = false; lMsgBox.MaximizeBox = false; lMsgBox.FormBorderStyle = FormBorderStyle.FixedDialog; lMsgBox.Show(); lMsgBox.BringToFront(); return(lMsgBox); }
public void DoAddFolder() { XmlNode lThisData = RsViewEngine.Locale.GetFormData(LOCALE_ALIAS); RsReportCollection lCurrColl = getSelectedCollection(); if (getSelectedItem() == null) { CRSMessageBox.ShowBox( XmlTools.getXmlNodeByAttrVal("name", NOCOLLECTION_FOLDER, lThisData).InnerText, RsViewEngine.Locale.GetTagText("error"), MessageBoxButtons.OK, MessageBoxIcon.Exclamation ); } else { if (lCurrColl is CFavoritesCollection) { _dlgAddFolder.CollectionName = RsViewEngine.Locale.GetTagText(RsLocalization.TAG_FAVORITES); } else { _dlgAddFolder.CollectionName = lCurrColl.CollectionName; } _dlgAddFolder.FolderName = ""; DialogResult lDlgRes = _dlgAddFolder.ShowDialog(); if (lDlgRes == DialogResult.OK) { CReportFolder lParent = getCurrentParent(); CReportFolder lNewFolder = new CReportFolder(_dlgAddFolder.FolderName); lNewFolder.Parent = lParent; lParent.Collection.ApplyToGUI(); lParent.Collection.QuickSave(); } } }
public void OpenReport() { if (File.Exists(_ReportFile)) { CHostApplication lHostApp = new CHostApplication(this); _ChildProcess = lHostApp.StartEmbeddedApp( System.Windows.Forms.Application.ExecutablePath, " \"" + _ReportFile + "\" \"" + this.Title + "\"" ); RsViewEngine.ChildApplications.AddChildApplication(_ChildProcess); _ChildProcess.Exited += new EventHandler(EH_ChildExited); } else { CRSMessageBox.ShowBox( RsViewEngine.Locale.GetMessage("rptNotFound") + "\n" + _ReportFile, RsViewEngine.Locale.GetMessageTitle("rptNotFound"), MessageBoxButtons.OK, MessageBoxIcon.Error ); } }
// Show as statusbox: public static IRSStatusBox ShowStatusBox(string aTitle) { CRSMessageBox lMsgBox = new CRSMessageBox(); lMsgBox.Title = aTitle; lMsgBox._Icon.Image = (Image)RsViewEngine.Resources.GetObject("gfx_mail_48x48"); lMsgBox._Icon.BackColor = Color.White; lMsgBox.MessageText = ""; lMsgBox.ShowAsStatusBox = true; lMsgBox.setLayout(); lMsgBox.MinimizeBox = false; lMsgBox.MaximizeBox = false; lMsgBox.FormBorderStyle = FormBorderStyle.FixedDialog; lMsgBox.Show(); lMsgBox.BringToFront(); return lMsgBox; }
// Full set up of dialog: public static DialogResult ShowBox(string aMessage, string aTitle, MessageBoxButtons aMsgBoxBtns, MessageBoxIcon aIcon, string aDetails) { CRSMessageBox lMsgBox = new CRSMessageBox(); lMsgBox.Title = aTitle; lMsgBox.MessageText = aMessage; lMsgBox.DialogButtons = aMsgBoxBtns; lMsgBox.DialogIcon = aIcon; lMsgBox.ApplyLocale(RsViewEngine.Locale); lMsgBox.Text = RsApplicationInfo.ApplicationName; lMsgBox.Details = aDetails; return lMsgBox.ShowMsgBox(); }
public void DoSendEmail() { if (_offline) { CMapiMail lMail = new CMapiMail(); lMail.Attachments += _PdfFile; lMail.StartMail(); } else { if (RsViewEngine.dlgSendMail.ShowDialog() == DialogResult.OK) { int lStepCount = 0, lDone = 0; IRSStatusBox lStatus = CRSMessageBox.ShowStatusBox(RsViewEngine.Locale.GetMessage("sendMail")); RsReportMailSender lSender = new RsReportMailSender(ReportProvider); lStepCount += (RsViewEngine.dlgSendMail.DOC) ? 1 : 0; lStepCount += (RsViewEngine.dlgSendMail.HTM) ? 1 : 0; lStepCount += (RsViewEngine.dlgSendMail.PDF) ? 1 : 0; lStepCount += (RsViewEngine.dlgSendMail.XLS) ? 1 : 0; lStepCount += (RsViewEngine.dlgSendMail.XML) ? 1 : 0; if (lStepCount == 0) { lStepCount = 1; } if (RsViewEngine.dlgSendMail.DOC) { lSender.AddAttachment(RsExportFormat.WordDocument); lDone++; lStatus.SetStatus(calcStatus(lStepCount, lDone, 100)); } if (RsViewEngine.dlgSendMail.HTM) { lSender.AddAttachment(RsExportFormat.HtmlDocument); lDone++; lStatus.SetStatus(calcStatus(lStepCount, lDone, 100)); } if (RsViewEngine.dlgSendMail.PDF) { lSender.AddAttachment(RsExportFormat.PortableFormatDocument); lDone++; lStatus.SetStatus(calcStatus(lStepCount, lDone, 100)); } if (RsViewEngine.dlgSendMail.XLS) { lSender.AddAttachment(RsExportFormat.ExcelDocument); lDone++; lStatus.SetStatus(calcStatus(lStepCount, lDone, 100)); } if (RsViewEngine.dlgSendMail.XML) { lSender.AddAttachment(RsExportFormat.XmlDocument); lDone++; lStatus.SetStatus(calcStatus(lStepCount, lDone, 100)); } lSender.Send(); lStatus.SetStatus(100); lStatus.HideBox(); } } }
public void DoRemove() { XmlNode lThisData = RsViewEngine.Locale.GetFormData(LOCALE_ALIAS); CReportItem lSelected = getSelectedItem(); RsReportCollection lCollection = getSelectedCollection(); string lVerifyMsg; string lItemName; if (lSelected == null) { CRSMessageBox.ShowBox( XmlTools.getXmlNodeByAttrVal("name", "itemNotSelected_del", lThisData).InnerText, RsViewEngine.Locale.GetTagText("error"), MessageBoxButtons.OK, MessageBoxIcon.Exclamation ); return; } lItemName = lSelected.ItemName; if (lSelected is CReportRootFolder) { if (lSelected is CReportFavoritesRoot) { lVerifyMsg = XmlTools.getXmlNodeByAttrVal("name", "verify_eraseFavs", lThisData).InnerText; } else { lVerifyMsg = XmlTools.getXmlNodeByAttrVal("name", "verify_rmCollection", lThisData).InnerText + " " + lCollection.CollectionName + "?"; } DialogResult lDlgRes = CRSMessageBox.ShowBox( lVerifyMsg, RsViewEngine.Locale.GetTagText("verify"), MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation ); if (lDlgRes == DialogResult.Yes) { if (lSelected is CReportFavoritesRoot) { lCollection.ClearCollection(); lCollection.QuickSave(); lCollection.ApplyToGUI(); _eCollection.SelectedNode = lCollection.RootFolder.GUINode; } else { if (lCollection.Modified) { lDlgRes = CRSMessageBox.ShowBox( XmlTools.getXmlNodeByAttrVal("name", "nosaved_collection", lThisData).InnerText + " " + lCollection.CollectionName + "?", RsViewEngine.Locale.GetTagText("save"), MessageBoxButtons.YesNo, MessageBoxIcon.Question ); if (lDlgRes == DialogResult.Yes) { RsViewEngine.SaveCollection(lCollection); } } RsViewEngine.CloseCollection(lCollection); _eCollection.SelectedNode = RsViewEngine.Favorites.RootFolder.GUINode; } } } else { if (lSelected is CReportFolder) { lVerifyMsg = XmlTools.getXmlNodeByAttrVal("name", "verify_rmFolder", lThisData).InnerText + " " + lItemName + "?"; } else { lVerifyMsg = XmlTools.getXmlNodeByAttrVal("name", "verify_rmFile", lThisData).InnerText + " " + lItemName + "?"; } DialogResult lDlgRes = CRSMessageBox.ShowBox( lVerifyMsg, RsViewEngine.Locale.GetTagText("verify"), MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation ); if (lDlgRes == DialogResult.Yes) { _eCollection.SelectedNode = lSelected.GUINode; lSelected.Release(); lCollection.QuickSave(); } } }