Added methods to use common dictionary of fonts part of B2017-117 Out of Window Handles fix
Use method from VE_Font to get a font reference (uses dictionary so redundant Window Handles are not created) B2017-117 Add a Using statement when we temporarily create a RichTextBox to ensure the Window Handle is free’d. Also use method from VE_Font to get a font reference (uses dictionary so redundant Window Handles are not created) B2017-117
This commit is contained in:
@@ -2456,9 +2456,9 @@ namespace Volian.Controls.Library
|
||||
nextEditItem.Top = newTop;
|
||||
if (nextEditItem.Top != newTop)
|
||||
{
|
||||
_MyLog.InfoFormat("'TryAgainLater',{0},{1},{2},{3},{4},'{5}'",
|
||||
oldTop, nextEditItem.Top, newTop, MyStepPanel.Height, nextEditItem.MyID, nextEditItem.MyItemInfo.ShortPath);
|
||||
nextEditItem.TryAgainLater = true;
|
||||
_MyLog.InfoFormat("'TryAgainLater',{0},{1},{2},{3},{4},'{5}'",
|
||||
oldTop, nextEditItem.Top, newTop, MyStepPanel.Height, nextEditItem.MyID, nextEditItem.MyItemInfo.ShortPath);
|
||||
nextEditItem.TryAgainLater = true;
|
||||
}
|
||||
nextEditItem.LastMethodsPop();
|
||||
MyStepPanel.ItemMoving--;
|
||||
@@ -3694,7 +3694,10 @@ namespace Volian.Controls.Library
|
||||
foreach (EnhancedDocument ed in MyItemInfo.GetMyEnhancedDocuments())
|
||||
{
|
||||
DVEnhancedDocument dved = dveds.GetByType(ed.Type);
|
||||
Font fnt = new System.Drawing.Font("Arial", 5);
|
||||
// follow through in fixing an Out of Window Handles bug, use new function to see if
|
||||
// we can retrieve the font from a dictionary instead a doing a New and using another
|
||||
// window handle B2017-117
|
||||
Font fnt = VE_Font.GetWinSysFont("Arial", 5);
|
||||
//g.DrawLine(Pens.DarkGreen, 18, 1, 18, 6);
|
||||
//g.DrawLine(Pens.DarkGreen, 18, 1, 21, 1);
|
||||
//g.DrawLine(Pens.DarkGreen, 18, 3, 21, 3);
|
||||
|
@@ -473,14 +473,21 @@ namespace Volian.Controls.Library
|
||||
_MyLog.Error(string.Format("MyItemInfo: {0} - {1} Problem doing RefreshDisplay",MyItemInfo.ItemID,MyItemInfo.ShortPath), ex);
|
||||
}
|
||||
}
|
||||
private static string FontKey(System.Drawing.Font font)
|
||||
{
|
||||
return string.Format("{0}_{1}_{2}", font.FontFamily.Name, font.Size, font.Style);
|
||||
}
|
||||
// RefreshDisplay is used to update the rtb for an entire Item as defined by MyItemInfo.
|
||||
public void RefreshDisplay(bool activeMode)
|
||||
{
|
||||
if (IsExperimenting) return;
|
||||
//Volian.Base.Library.HWndCounter.GetWindowHandlesForCurrentProcess(this.Handle, "RefreshDisplay 1");
|
||||
ActiveMode = activeMode;
|
||||
OnAdjustTableWidth(this, new StepRTBTableWidthEventArgs(true));
|
||||
//Volian.Base.Library.HWndCounter.GetWindowHandlesForCurrentProcess(this.Handle, "RefreshDisplay 2");
|
||||
_InitializingRTB = true;
|
||||
DisplayText vlntxt = new DisplayText(MyItemInfo, E_EditPrintMode.Edit, VwMode, !ActiveMode, FieldToEdit, true,null, null,false);
|
||||
//Volian.Base.Library.HWndCounter.GetWindowHandlesForCurrentProcess(this.Handle, "RefreshDisplay 3");
|
||||
//if (_origDisplayText != null && vlntxt.StartText == _origDisplayText.StartText)
|
||||
//{
|
||||
// ReadOnly = !(EpMode == E_EditPrintMode.Edit && VwMode == E_ViewMode.Edit);
|
||||
@@ -488,6 +495,7 @@ namespace Volian.Controls.Library
|
||||
// return;
|
||||
//}
|
||||
OrigDisplayText = vlntxt;
|
||||
//Volian.Base.Library.HWndCounter.GetWindowHandlesForCurrentProcess(this.Handle, "RefreshDisplay 4");
|
||||
|
||||
// RHM 20101201 - Don't reset the text. Calculate the text and compare it with the existing text in AddRTFText
|
||||
//Text = ""; // Initialize text before add text
|
||||
@@ -495,16 +503,47 @@ namespace Volian.Controls.Library
|
||||
// was confusing the 'handle' of the rtf box.
|
||||
//Console.WriteLine("'font',{0}", Font);
|
||||
//if(Text == "")SelectionFont = Font; // Initialize SelectionFont
|
||||
//Volian.Base.Library.HWndCounter.GetWindowHandlesForCurrentProcess(this.Handle, "1");
|
||||
if (FieldToEdit == E_FieldToEdit.StepText)
|
||||
{
|
||||
if (MyItemInfo != null)
|
||||
{
|
||||
if (MyItemInfo.IsStep) Font = MyFontFamily == null ? MyItemInfo.FormatStepData.Font.WindowsFont : new Font(MyFontFamily, MyItemInfo.FormatStepData.Font.WindowsFont.Size, MyItemInfo.FormatStepData.Font.WindowsFont.Style);
|
||||
else Font = Font = MyFontFamily == null ? MyItemInfo.ActiveFormat.PlantFormat.FormatData.Font.WindowsFont : new Font(MyFontFamily, MyItemInfo.ActiveFormat.PlantFormat.FormatData.Font.WindowsFont.Size, MyItemInfo.ActiveFormat.PlantFormat.FormatData.Font.WindowsFont.Style);
|
||||
//if (MyItemInfo.IsStep) Font = MyFontFamily == null ? MyItemInfo.FormatStepData.Font.WindowsFont : new Font(MyFontFamily, MyItemInfo.FormatStepData.Font.WindowsFont.Size, MyItemInfo.FormatStepData.Font.WindowsFont.Style);
|
||||
//else Font = Font = MyFontFamily == null ? MyItemInfo.ActiveFormat.PlantFormat.FormatData.Font.WindowsFont : new Font(MyFontFamily, MyItemInfo.ActiveFormat.PlantFormat.FormatData.Font.WindowsFont.Size, MyItemInfo.ActiveFormat.PlantFormat.FormatData.Font.WindowsFont.Style);
|
||||
if (MyItemInfo.IsStep)
|
||||
{
|
||||
if (MyFontFamily == null)
|
||||
{
|
||||
//Volian.Base.Library.HWndCounter.GetWindowHandlesForCurrentProcess(this.Handle, "Before WindowsFont1");
|
||||
System.Drawing.Font fnt = MyItemInfo.FormatStepData.Font.WindowsFont;
|
||||
//Volian.Base.Library.HWndCounter.GetWindowHandlesForCurrentProcess(this.Handle, "After WindowsFont1a");
|
||||
Application.DoEvents();
|
||||
if (FontKey(Font) != FontKey(fnt))
|
||||
Font = fnt;
|
||||
//Volian.Base.Library.HWndCounter.GetWindowHandlesForCurrentProcess(this.Handle, "After WindowsFont1b");
|
||||
}
|
||||
else
|
||||
Font = VE_Font.GetWinSysFont(MyFontFamily, MyItemInfo.FormatStepData.Font.WindowsFont.Size, MyItemInfo.FormatStepData.Font.WindowsFont.Style);
|
||||
//Volian.Base.Library.HWndCounter.GetWindowHandlesForCurrentProcess(this.Handle, "RefreshDisplay 4");
|
||||
}
|
||||
else
|
||||
{
|
||||
if (MyFontFamily == null)
|
||||
{
|
||||
//Volian.Base.Library.HWndCounter.GetWindowHandlesForCurrentProcess(this.Handle, "Before WindowsFont2");
|
||||
Font = MyItemInfo.ActiveFormat.PlantFormat.FormatData.Font.WindowsFont;
|
||||
//Volian.Base.Library.HWndCounter.GetWindowHandlesForCurrentProcess(this.Handle, "After WindowsFont2");
|
||||
}
|
||||
else
|
||||
Font = VE_Font.GetWinSysFont(MyFontFamily, MyItemInfo.ActiveFormat.PlantFormat.FormatData.Font.WindowsFont.Size, MyItemInfo.ActiveFormat.PlantFormat.FormatData.Font.WindowsFont.Style);
|
||||
//Volian.Base.Library.HWndCounter.GetWindowHandlesForCurrentProcess(this.Handle, "RefreshDisplay 5");
|
||||
}
|
||||
LastRtf = Rtf;
|
||||
}
|
||||
}
|
||||
//Volian.Base.Library.HWndCounter.GetWindowHandlesForCurrentProcess(this.Handle, "StepRTB.RefreshDisplay Before SetLineSpacing");
|
||||
RTBAPI.SetLineSpacing(this, RTBAPI.ParaSpacing.PFS_EXACT);
|
||||
//Volian.Base.Library.HWndCounter.GetWindowHandlesForCurrentProcess(this.Handle, "StepRTB.RefreshDisplay After SetLineSpacing");
|
||||
bool readOnlyStep = MyItemInfo == null || MyItemInfo.FormatStepData == null ? false : MyItemInfo.FormatStepData.ReadOnly;
|
||||
if (!readOnlyStep)
|
||||
{
|
||||
@@ -513,7 +552,9 @@ namespace Volian.Controls.Library
|
||||
readOnlyStep = true;
|
||||
}
|
||||
ReadOnly = readOnlyStep || VwMode == E_ViewMode.View || ActiveMode == false;
|
||||
//Volian.Base.Library.HWndCounter.GetWindowHandlesForCurrentProcess(this.Handle, "Before AddRTFText");
|
||||
AddRtfText(vlntxt.StartText);
|
||||
//Volian.Base.Library.HWndCounter.GetWindowHandlesForCurrentProcess(this.Handle, "After AddRTFText");
|
||||
//AddRtfStyles();
|
||||
// set readonly based on initial modes, however, these may change if
|
||||
// user selected view mode.
|
||||
@@ -534,13 +575,16 @@ namespace Volian.Controls.Library
|
||||
//
|
||||
// Setting the RightMargin to the Width minus one, accounts for the slight indent (1 pixel) of
|
||||
// the text within the RichTextBox.
|
||||
RightMargin = Width > 0 ? Width - 1 : 0;
|
||||
//RightMargin = Width > 0 ? Width - 1 : 0;
|
||||
RightMargin = ActiveMode ? Width : Width > 0 ? Width - 1 : 0; // > 0 ? Width - 1 : 0;
|
||||
// figure out if needs outlined, depends on table/figure type
|
||||
if (!ActiveMode)
|
||||
{
|
||||
RemoveEventHandlers();
|
||||
OnAdjustTableWidth(this, new StepRTBTableWidthEventArgs(false));// View Mode
|
||||
//Volian.Base.Library.HWndCounter.GetWindowHandlesForCurrentProcess(this.Handle, "Before SelectAll");
|
||||
SelectAll();
|
||||
//Volian.Base.Library.HWndCounter.GetWindowHandlesForCurrentProcess(this.Handle, "After SelectAll");
|
||||
//if (SelectionHangingIndent !=0) SelectionHangingIndent = 0;
|
||||
int indchar = 0;
|
||||
string indentToken = MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.IndentToken;
|
||||
@@ -604,7 +648,10 @@ namespace Volian.Controls.Library
|
||||
_InitializingRTB = false;
|
||||
|
||||
AdjustSizeForContents(!ActiveMode);
|
||||
//Volian.Base.Library.HWndCounter.GetWindowHandlesForCurrentProcess(this.Handle, "After RefreshDisplay");
|
||||
Application.DoEvents();
|
||||
}
|
||||
|
||||
private bool IsDerived(StepConfig sc)
|
||||
{
|
||||
foreach (EnhancedDocument ed in sc.MyEnhancedDocuments)
|
||||
@@ -828,7 +875,7 @@ namespace Volian.Controls.Library
|
||||
private void SetUpStepRTB()
|
||||
{
|
||||
DetectUrls = false;
|
||||
SpellCheckStatus = false;
|
||||
SpellCheckStatus = false;
|
||||
this.Height = 10; // initialize the height to 10, the default height was too big for the cells in grid tables
|
||||
BorderStyle = System.Windows.Forms.BorderStyle.None;
|
||||
this.ScrollBars = RichTextBoxScrollBars.None;
|
||||
@@ -1143,7 +1190,13 @@ namespace Volian.Controls.Library
|
||||
}
|
||||
else
|
||||
{
|
||||
base.WndProc(ref m);
|
||||
try
|
||||
{
|
||||
base.WndProc(ref m);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
private static void AddFontTable(StringBuilder selectedRtfSB, Font myFont, bool isFixed)
|
||||
@@ -2088,85 +2141,89 @@ namespace Volian.Controls.Library
|
||||
// verify that data in clipboard is valid for this type. If inserting an equation, need to verify that
|
||||
// input data has an 'equation', and if not inserting into an equation step type, it must not have
|
||||
// equation data.
|
||||
DataFormats.Format frm = DataFormats.GetFormat("Embed Source");
|
||||
System.Windows.Forms.RichTextBox richTextBox1;
|
||||
richTextBox1 = new System.Windows.Forms.RichTextBox();
|
||||
richTextBox1.Location = new System.Drawing.Point(35, 32);
|
||||
richTextBox1.Name = "richTextBox1";
|
||||
richTextBox1.Size = new System.Drawing.Size(67, 58);
|
||||
richTextBox1.TabIndex = 0;
|
||||
richTextBox1.Text = "";
|
||||
richTextBox1.ScrollBars = System.Windows.Forms.RichTextBoxScrollBars.None;
|
||||
bool hasEquation = false;
|
||||
try
|
||||
//DataFormats.Format frm = DataFormats.GetFormat("Embed Source");
|
||||
//System.Windows.Forms.RichTextBox richTextBox1;
|
||||
using (System.Windows.Forms.RichTextBox richTextBox1 = new System.Windows.Forms.RichTextBox())
|
||||
{
|
||||
richTextBox1.Paste(frm);
|
||||
if (richTextBox1.Rtf.ToUpper().Contains("OBJCLASS EQU")) hasEquation = true;
|
||||
if (richTextBox1.Rtf.ToUpper().Contains("OBJCLASS VIS")) hasEquation = true; // Support Visio
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
hasEquation = true;
|
||||
}
|
||||
if (MyItemInfo != null && MyItemInfo.IsRtfRaw && MyItemInfo.FormatStepData.Type.ToUpper().Contains("EQUATION") && !hasEquation)
|
||||
{
|
||||
MessageBox.Show("Cannot paste non-equation data into an equation step type.", "Invalid data", MessageBoxButtons.OK);
|
||||
richTextBox1.Dispose();
|
||||
e.Handled = true;
|
||||
return;
|
||||
}
|
||||
// if inserting anything other than equation, be sure that an equation is not in the buffer:
|
||||
else if (hasEquation && (MyItemInfo==null || (MyItemInfo != null && !MyItemInfo.IsRtfRaw && !MyItemInfo.FormatStepData.Type.ToUpper().Contains("EQUATION"))))
|
||||
{
|
||||
MessageBox.Show("Cannot paste equation data into an non-equation step type.", "Invalid data", MessageBoxButtons.OK);
|
||||
richTextBox1.Dispose();
|
||||
e.Handled = true;
|
||||
return;
|
||||
}
|
||||
|
||||
// only allow the paste of a screen shot image if using the shortcut switch "/EmbedImages"
|
||||
if (Volian.Base.Library.VlnSettings.GetCommandFlag("EmbedImages") && iData.GetDataPresent(DataFormats.Dib)) // Device Independent Bitmap
|
||||
{
|
||||
System.Drawing.Image img = Clipboard.GetImage();
|
||||
ImageWidth = img.Width;
|
||||
Width = ImageWidth + 2;
|
||||
Paste();
|
||||
e.Handled = true;
|
||||
return;
|
||||
}
|
||||
else if (iData.GetDataPresent("Embed Source")) //DS Equation") || iData.GetDataPresent("MathType EF"))
|
||||
{
|
||||
Size sz = RtfRawItem.GetRtfRawSize(richTextBox1.Rtf);
|
||||
this.Rtf = richTextBox1.Rtf;
|
||||
Width = sz.Width;
|
||||
Height = sz.Height;
|
||||
e.Handled = true;
|
||||
return;
|
||||
}
|
||||
else if (iData.GetDataPresent(DataFormats.Dib))
|
||||
{
|
||||
System.Drawing.Image img = Clipboard.GetImage();
|
||||
ImageWidth = img.Width;
|
||||
Width = ImageWidth + 2;
|
||||
Paste();
|
||||
e.Handled = true;
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!iData.GetDataPresent(DataFormats.Text) && !iData.GetDataPresent(DataFormats.Rtf))
|
||||
richTextBox1.Location = new System.Drawing.Point(35, 32);
|
||||
richTextBox1.Name = "richTextBox1";
|
||||
richTextBox1.Size = new System.Drawing.Size(67, 58);
|
||||
richTextBox1.TabIndex = 0;
|
||||
richTextBox1.Text = "";
|
||||
richTextBox1.ScrollBars = System.Windows.Forms.RichTextBoxScrollBars.None;
|
||||
bool hasEquation = false;
|
||||
try
|
||||
{
|
||||
MessageBox.Show("Cannot paste, text has special characters or symbols that will not paste correctly.");
|
||||
DataFormats.Format frm = DataFormats.GetFormat("Embed Source");
|
||||
richTextBox1.Paste(frm);
|
||||
if (richTextBox1.Rtf.ToUpper().Contains("OBJCLASS EQU")) hasEquation = true;
|
||||
if (richTextBox1.Rtf.ToUpper().Contains("OBJCLASS VIS")) hasEquation = true; // Support Visio
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
hasEquation = true;
|
||||
}
|
||||
if (MyItemInfo != null && MyItemInfo.IsRtfRaw && MyItemInfo.FormatStepData.Type.ToUpper().Contains("EQUATION") && !hasEquation)
|
||||
{
|
||||
MessageBox.Show("Cannot paste non-equation data into an equation step type.", "Invalid data", MessageBoxButtons.OK);
|
||||
//richTextBox1.Dispose();
|
||||
e.Handled = true;
|
||||
return;
|
||||
}
|
||||
// if inserting anything other than equation, be sure that an equation is not in the buffer:
|
||||
else if (hasEquation && (MyItemInfo == null || (MyItemInfo != null && !MyItemInfo.IsRtfRaw && !MyItemInfo.FormatStepData.Type.ToUpper().Contains("EQUATION"))))
|
||||
{
|
||||
MessageBox.Show("Cannot paste equation data into an non-equation step type.", "Invalid data", MessageBoxButtons.OK);
|
||||
//richTextBox1.Dispose();
|
||||
e.Handled = true;
|
||||
return;
|
||||
}
|
||||
|
||||
// only allow the paste of a screen shot image if using the shortcut switch "/EmbedImages"
|
||||
if (Volian.Base.Library.VlnSettings.GetCommandFlag("EmbedImages") && iData.GetDataPresent(DataFormats.Dib)) // Device Independent Bitmap
|
||||
{
|
||||
System.Drawing.Image img = Clipboard.GetImage();
|
||||
ImageWidth = img.Width;
|
||||
Width = ImageWidth + 2;
|
||||
Paste();
|
||||
e.Handled = true;
|
||||
return;
|
||||
}
|
||||
else if (iData.GetDataPresent("Embed Source")) //DS Equation") || iData.GetDataPresent("MathType EF"))
|
||||
{
|
||||
Size sz = RtfRawItem.GetRtfRawSize(richTextBox1.Rtf);
|
||||
this.Rtf = richTextBox1.Rtf;
|
||||
Width = sz.Width;
|
||||
Height = sz.Height;
|
||||
e.Handled = true;
|
||||
return;
|
||||
}
|
||||
else if (iData.GetDataPresent(DataFormats.Dib))
|
||||
{
|
||||
System.Drawing.Image img = Clipboard.GetImage();
|
||||
ImageWidth = img.Width;
|
||||
Width = ImageWidth + 2;
|
||||
Paste();
|
||||
e.Handled = true;
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
// if contains bad rtf (from Word), paste as text, otherwise, do the paste here.
|
||||
if (!PasteRtfAsText(true)) Paste();
|
||||
if (SelectionLength == 0 && MyStyleFont != null) SelectionFont = MyStyleFont.WindowsFont; // B2017-023 null reference check for empty workdraft set information dialog
|
||||
if (!iData.GetDataPresent(DataFormats.Text) && !iData.GetDataPresent(DataFormats.Rtf))
|
||||
{
|
||||
MessageBox.Show("Cannot paste, text has special characters or symbols that will not paste correctly.");
|
||||
}
|
||||
else
|
||||
{
|
||||
// if contains bad rtf (from Word), paste as text, otherwise, do the paste here.
|
||||
if (!PasteRtfAsText(true)) Paste();
|
||||
if (SelectionLength == 0 && MyStyleFont != null) SelectionFont = MyStyleFont.WindowsFont; // B2017-023 null reference check for empty workdraft set information dialog
|
||||
}
|
||||
}
|
||||
}
|
||||
} // end using
|
||||
e.Handled = true;
|
||||
return;
|
||||
|
||||
case Keys.Home:
|
||||
StepRTB_HomeEndPressed(e);
|
||||
e.Handled = true;
|
||||
@@ -3409,6 +3466,7 @@ namespace Volian.Controls.Library
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// the grid uses this to reference the same instance of the spell checker
|
||||
public C1.Win.C1SpellChecker.C1SpellChecker SpellCheckerInstance
|
||||
{
|
||||
|
@@ -1468,26 +1468,33 @@ namespace Volian.Controls.Library
|
||||
try // RHM20150506 Multiline ItemID TextBox
|
||||
{
|
||||
IDataObject iData = Clipboard.GetDataObject();
|
||||
DataFormats.Format frm = DataFormats.GetFormat("Embed Source");
|
||||
System.Windows.Forms.RichTextBox richTextBox1;
|
||||
richTextBox1 = new System.Windows.Forms.RichTextBox();
|
||||
richTextBox1.Location = new System.Drawing.Point(35, 32);
|
||||
richTextBox1.Name = "richTextBox1";
|
||||
richTextBox1.Size = new System.Drawing.Size(67, 58);
|
||||
richTextBox1.TabIndex = 0;
|
||||
richTextBox1.Text = "";
|
||||
richTextBox1.ScrollBars = System.Windows.Forms.RichTextBoxScrollBars.None;
|
||||
bool noEquationData = true;
|
||||
try
|
||||
// part of bug B2017-117 we were running out of window handles when printing, found this similar use of
|
||||
// creating a new richtextbox just for some processing. Put a Using around this to ensure the window handle
|
||||
// is free'd
|
||||
using (System.Windows.Forms.RichTextBox richTextBox1 = new System.Windows.Forms.RichTextBox())
|
||||
{
|
||||
richTextBox1.Paste(frm);
|
||||
if (richTextBox1.Rtf.ToUpper().Contains("OBJCLASS EQU")) noEquationData = false;
|
||||
if (richTextBox1.Rtf.ToUpper().Contains("OBJCLASS VIS")) noEquationData = false;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
noEquationData = false;
|
||||
}
|
||||
DataFormats.Format frm = DataFormats.GetFormat("Embed Source");
|
||||
//System.Windows.Forms.RichTextBox richTextBox1;
|
||||
//richTextBox1 = new System.Windows.Forms.RichTextBox();
|
||||
richTextBox1.Location = new System.Drawing.Point(35, 32);
|
||||
richTextBox1.Name = "richTextBox1";
|
||||
richTextBox1.Size = new System.Drawing.Size(67, 58);
|
||||
richTextBox1.TabIndex = 0;
|
||||
richTextBox1.Text = "";
|
||||
richTextBox1.ScrollBars = System.Windows.Forms.RichTextBoxScrollBars.None;
|
||||
//bool noEquationData = true;
|
||||
try
|
||||
{
|
||||
richTextBox1.Paste(frm);
|
||||
if (richTextBox1.Rtf.ToUpper().Contains("OBJCLASS EQU")) noEquationData = false;
|
||||
if (richTextBox1.Rtf.ToUpper().Contains("OBJCLASS VIS")) noEquationData = false;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
noEquationData = false;
|
||||
}
|
||||
} // end using
|
||||
//btnEdit3CMPaste.Enabled = btnPasteText.Enabled = btnCMPasteText.Enabled = btnCMPaste.Enabled = btnPaste.Enabled = (iData.GetDataPresent(DataFormats.Text) || iData.GetDataPresent(DataFormats.Rtf));
|
||||
//btnPasteText.Enabled = btnPasteStepText.Enabled = btnPaste.Enabled = (iData.GetDataPresent(DataFormats.Text) || iData.GetDataPresent(DataFormats.Rtf));
|
||||
btnPaste.Enabled = noEquationData && (iData.GetDataPresent(DataFormats.Text) || iData.GetDataPresent(DataFormats.Rtf));
|
||||
|
Reference in New Issue
Block a user