private void PropertyForm_Load(object sender, EventArgs e) { AnnObject annObject = TifEditor.GetCurrentEditor().AnnAutomation.CurrentEditObject; AnnTextObject obj = annObject as AnnTextObject; if (obj != null && obj.GetType() != typeof(AnnStampObject)) { this.Opacity = 100; InitializeValue(); } else { /* if (obj != null && obj.GetType() == typeof(AnnStampObject)) * { * */ if (obj == null) { MessageBox.Show("The property form is not supported for selected object in this version."); } /* * }*/ this.Close(); } }
private void InitalizeTifEditor() { tifEditor = new TifEditor(); tifEditor.ExitDelegate = this.ExitHandler; this.tifEditor.Dock = DockStyle.Fill; tifEditor.Edit = allowEdit; this.Controls.Add(tifEditor); }
private void PropertyForm_FormClosed(object sender, FormClosedEventArgs e) { try { TifEditor.GetCurrentEditor().Viewer.Invalidate(); } catch (Exception ex) { } }
private void SetObjectValue() { AnnObject annObject = TifEditor.GetCurrentEditor().AnnAutomation.CurrentEditObject; AnnTextObject obj = annObject as AnnTextObject; if (obj != null) { obj.Text = txtData.Text; } }
public TifEditor() { // RasterSupport.Unlock(RasterSupportType.Document, "xcRns97c3"); // RasterSupport.Unlock(RasterSupportType.Document, "vhG42tyuh9"); try { SetLicenseFile(); InitializeComponent(); IntializeAnnContainer(); CurrentEditor = this; } catch (Exception ex) { Logger.Error("Error constructing tifEditor:" + ex.Message, ex); XtraMessageBox.Show("An error occurred while creating the Image Editor." + Environment.NewLine + "Error CNF-388 in " + FORM_NAME + ".TifEditor(): " + ex.Message, FORM_ERROR_CAPTION, MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void TifEditor_Enter(object sender, EventArgs e) { CurrentEditor = this; }
private void InstantiateTifEditor() { this.tifEditorInbound = new Sempra.Confirm.InBound.ImageEdit.TifEditor(); this.tabpgImageViewer.Controls.Add(this.tifEditorInbound); this.tifEditorInbound.Dock = System.Windows.Forms.DockStyle.Fill; // this.tifEditorInbound.Edit = false; this.tifEditorInbound.ExitDelegate = null; this.tifEditorInbound.ImageFileName = null; this.tifEditorInbound.Location = new System.Drawing.Point(0, 0); this.tifEditorInbound.Name = "tifEditorInbound"; this.tifEditorInbound.SaveAsFileName = null; this.tifEditorInbound.ScaleFactor = 1; this.tifEditorInbound.Size = new System.Drawing.Size(410, 431); this.toolTipController.SetSuperTip(this.tifEditorInbound, null); this.tifEditorInbound.TabIndex = 0; this.tifEditorInbound.TransDelegate = null; this.tifEditorInbound.UserName = null; tifEditorInbound.SaveImageOverrideDelegate = SaveImageOverride; tifEditorInbound.GetImageDataOverride = GetImageBytesOverride; }
private void SaveImageOverride(TifEditor editor) { try { var currentSelected = ImagesEventManager.Instance.CurrentSelected; if (currentSelected == null || !currentSelected.CanSave) { XtraMessageBox.Show(FORM_NAME + ".SaveImage: Image cannot be saved.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } IImagesDal dal = new ImagesDal(sqlConnectionStr); currentSelected.MarkupImage = tifEditorInbound.GetImageBytes(); dal.Update(currentSelected); } catch (Exception e) { Logger.Error("Error CNF-171: Error saving image back to database:" + e.Message, e); XtraMessageBox.Show("Error saving image back to database. " + Environment.NewLine + FORM_NAME + ".SaveImage" + Environment.NewLine + "Error CNF-171 in " + FORM_NAME + ".SaveImageOverride(): " + e.Message, MAIN_FORM_ERROR_CAPTION, MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void AddDocViewer(byte[] docStream) { DocType fileDocType = GetDocumentType(docStream); switch (fileDocType) { case DocType.TIF: { try { TifEditor editor = new TifEditor(); editor.Dock = System.Windows.Forms.DockStyle.Fill; editor.Edit = false; editor.ExitDelegate = null; editor.ImageFileName = null; editor.Location = new System.Drawing.Point(0, 0); editor.SaveAsFileName = null; editor.ScaleFactor = 1; editor.Size = new System.Drawing.Size(1148, 422); editor.TabIndex = 0; editor.TransDelegate = null; editor.UserName = null; editor.LoadImage(new MemoryStream(docStream)); this.Controls.Add(editor); } catch (Exception ex) { XtraMessageBox.Show("An error occurred while loading file: " + fileName + "." + Environment.NewLine + "Error CNF-547 in " + PROJ_FILE_NAME + ".AddDocViewer(): " + ex.Message, "Inbound Tab Page", MessageBoxButtons.OK, MessageBoxIcon.Error); } break; } case DocType.HTML: { WebBrowser webBrowser = new WebBrowser(); webBrowser.Dock = System.Windows.Forms.DockStyle.Fill; webBrowser.TabIndex = 0; this.Controls.Add(webBrowser); StringBuilder contents = new StringBuilder(); char[] str = new char[docStream.Length]; for (int i = 0; i < docStream.Length; i++) { str[i] = (char)docStream[i]; } contents.Append(str); webBrowser.Navigate("about:blank"); webBrowser.Document.Write(contents.ToString()); webBrowser.Refresh(); break; } case DocType.RTF: { VaultRTFEditor richTextBox = new VaultRTFEditor(); richTextBox.Dock = System.Windows.Forms.DockStyle.Fill; richTextBox.LoadFile(new MemoryStream(docStream), RichTextBoxStreamType.RichText); this.Controls.Add(richTextBox); break; } } }