B2017-133 EDraw - DSO Framer Replacement
This commit is contained in:
parent
8048416576
commit
3f31210ccf
@ -17,7 +17,7 @@ namespace Volian.Controls.Library
|
|||||||
#region Private Fields
|
#region Private Fields
|
||||||
private DisplayTabControl _MyDisplayTabControl;
|
private DisplayTabControl _MyDisplayTabControl;
|
||||||
private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
||||||
private AxDSOFramer.AxFramerControl _MyDSOFramer;
|
private AxEDWordLib.AxEDWord _MyEdWord; // B2017-133 Edraw DSO Framer Replacement
|
||||||
private TransparentPanel _MyTransparentPanel;
|
private TransparentPanel _MyTransparentPanel;
|
||||||
private static int _Count = 0;
|
private static int _Count = 0;
|
||||||
private DocumentInfo _MyDocumentInfo;
|
private DocumentInfo _MyDocumentInfo;
|
||||||
@ -80,9 +80,10 @@ namespace Volian.Controls.Library
|
|||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
if (_MyDSOFramer == null) return false;
|
if (_MyEdWord == null) return false; // B2017-133 Edraw Is Dirty Property
|
||||||
LBDocumentClass doc = new LBDocumentClass(_MyDSOFramer.ActiveDocument);
|
return _MyEdWord.IsDirty();
|
||||||
return !doc.Saved;
|
//LBDocumentClass doc = new LBDocumentClass(_MyEdWord.ActiveDocument());
|
||||||
|
//return !doc.Saved;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private bool _OverrideClose = false;
|
private bool _OverrideClose = false;
|
||||||
@ -108,16 +109,48 @@ namespace Volian.Controls.Library
|
|||||||
_MyDocumentInfo = documentInfo;
|
_MyDocumentInfo = documentInfo;
|
||||||
SetupDSO();
|
SetupDSO();
|
||||||
_RefreshTimer = new Timer(); // Enabled is false and interval is 1/10th of second.
|
_RefreshTimer = new Timer(); // Enabled is false and interval is 1/10th of second.
|
||||||
|
_RefreshTimer.Interval = 1000;// B2017-133 Edraw
|
||||||
ClientSizeChanged += new EventHandler(DSOTabPanel_ClientSizeChanged);
|
ClientSizeChanged += new EventHandler(DSOTabPanel_ClientSizeChanged);
|
||||||
_RefreshTimer.Tick += new EventHandler(_RefreshTimer_Tick);
|
_RefreshTimer.Tick += new EventHandler(_RefreshTimer_Tick);
|
||||||
|
_MyEdWord.BeforeDocumentClosed += _MyEdWord_BeforeDocumentClosed;// B2017-133 Edraw
|
||||||
|
_MyEdWord.BeforeDocumentOpened += _MyEdWord_BeforeDocumentOpened;// B2017-133 Edraw
|
||||||
|
_MyEdWord.BeforeDocumentSaved += _MyEdWord_BeforeDocumentSaved;// B2017-133 Edraw
|
||||||
//_frm = new frmPG(_MyDSOFramer);
|
//_frm = new frmPG(_MyDSOFramer);
|
||||||
//_frm.Show();
|
//_frm.Show();
|
||||||
}
|
}
|
||||||
|
void _MyEdWord_BeforeDocumentSaved(object sender, EventArgs e)// B2017-133 Edraw
|
||||||
|
{
|
||||||
|
SaveDSO();
|
||||||
|
}
|
||||||
|
void _MyEdWord_BeforeDocumentOpened(object sender, EventArgs e)// B2017-133 Edraw
|
||||||
|
{
|
||||||
|
_MyEdWord.DisableFileCommand(EDWordLib.WdUIType.wdUIDisableClose, true);
|
||||||
|
_MyEdWord.DisableFileCommand(EDWordLib.WdUIType.wdUIDisableNew, true);
|
||||||
|
_MyEdWord.DisableFileCommand(EDWordLib.WdUIType.wdUIDisablePrint, true);
|
||||||
|
_MyEdWord.DisableFileCommand(EDWordLib.WdUIType.wdUIDisablePrintPreview, true);
|
||||||
|
_MyEdWord.DisableFileCommand(EDWordLib.WdUIType.wdUIDisablePrintQuick, true);
|
||||||
|
_MyEdWord.DisableFileCommand(EDWordLib.WdUIType.wdUIDisableSave, false);
|
||||||
|
_MyEdWord.DisableFileCommand(EDWordLib.WdUIType.wdUIDisableSaveAs, true);
|
||||||
|
_MyEdWord.DisableStandardCommand(EDWordLib.CommandType.cmdTypeSave, true);
|
||||||
|
_MyEdWord.DisableStandardCommand(EDWordLib.CommandType.cmdTypeClose, true);
|
||||||
|
_MyEdWord.DisableStandardCommand(EDWordLib.CommandType.cmdTypePrint, true);
|
||||||
|
_MyEdWord.DisableSaveHotKey(true);
|
||||||
|
_MyEdWord.DisablePrintHotKey(true);
|
||||||
|
}
|
||||||
|
void _MyEdWord_BeforeDocumentClosed(object sender, EventArgs e)// B2017-133 Edraw
|
||||||
|
{
|
||||||
|
Console.WriteLine("B2017-133 Edraw Before Document Closed");
|
||||||
|
}
|
||||||
void _RefreshTimer_Tick(object sender, EventArgs e)
|
void _RefreshTimer_Tick(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
_RefreshTimer.Enabled = false;
|
_RefreshTimer.Enabled = false;
|
||||||
if(_MyDSOFramer != null)
|
if (_MyEdWord != null)// B2017-133 Edraw
|
||||||
_MyDSOFramer.Focus();
|
{
|
||||||
|
_MyEdWord.Focus();
|
||||||
|
_MyEdWord.GotoItem(EDWordLib.WdGoToItem.wdGoToStart, EDWordLib.WdGoToDirection.wdGoToFirst);
|
||||||
|
//_MyEdWord.BringToFront();
|
||||||
|
//_MyEdWord.EndInit();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
void DSOTabPanel_ClientSizeChanged(object sender, EventArgs e)
|
void DSOTabPanel_ClientSizeChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
@ -135,13 +168,13 @@ namespace Volian.Controls.Library
|
|||||||
_Count++; // Increment the count of open Word documents (Limit = MSWordLimit)
|
_Count++; // Increment the count of open Word documents (Limit = MSWordLimit)
|
||||||
_MyCount = _Count;
|
_MyCount = _Count;
|
||||||
this._MyTransparentPanel = new TransparentPanel();
|
this._MyTransparentPanel = new TransparentPanel();
|
||||||
this._MyDSOFramer = new AxDSOFramer.AxFramerControl();
|
this._MyEdWord = new AxEDWordLib.AxEDWord();// B2017-133 Edraw
|
||||||
((System.ComponentModel.ISupportInitialize)(this._MyDSOFramer)).BeginInit();
|
_MyEdWord.BeginInit();
|
||||||
this.Controls.Add(this._MyDSOFramer);
|
this.Controls.Add(this._MyEdWord);
|
||||||
this.Controls.Add(this._MyTransparentPanel); // A transparent panel is added over top of the DSO Framer window so that
|
this.Controls.Add(this._MyTransparentPanel); // A transparent panel is added over top of the DSO Framer window so that
|
||||||
// the related tab can be activated when the user clicks on a Word Document. Since the Word document is actually running
|
// the related tab can be activated when the user clicks on a Word Document. Since the Word document is actually running
|
||||||
// in a different thread, it does not behave properly with focus events.
|
// in a different thread, it does not behave properly with focus events.
|
||||||
this.components.Add(this._MyDSOFramer);
|
this.components.Add(this._MyEdWord);// B2017-133 Edraw
|
||||||
this.components.Add(this._MyTransparentPanel);
|
this.components.Add(this._MyTransparentPanel);
|
||||||
this._MyTransparentPanel.Dock = System.Windows.Forms.DockStyle.Fill;
|
this._MyTransparentPanel.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||||
this._MyTransparentPanel.Font = new System.Drawing.Font("Tahoma", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
this._MyTransparentPanel.Font = new System.Drawing.Font("Tahoma", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||||
@ -152,20 +185,20 @@ namespace Volian.Controls.Library
|
|||||||
//this._MyTransPanel.Size = new System.Drawing.Size(370, 423);
|
//this._MyTransPanel.Size = new System.Drawing.Size(370, 423);
|
||||||
//this._MyTransPanel.TabIndex = 1;
|
//this._MyTransPanel.TabIndex = 1;
|
||||||
this._MyTransparentPanel.Click += new EventHandler(_MyTransparentPanel_Click);
|
this._MyTransparentPanel.Click += new EventHandler(_MyTransparentPanel_Click);
|
||||||
this._MyDSOFramer.Dock = System.Windows.Forms.DockStyle.Fill;
|
this._MyEdWord.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||||
//System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(WordDSOTab));
|
//System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(WordDSOTab));
|
||||||
//this._DSOFramer.OcxState = ((System.Windows.Forms.AxHost.State)(resources.GetObject("_FC.OcxState")));
|
//this._DSOFramer.OcxState = ((System.Windows.Forms.AxHost.State)(resources.GetObject("_FC.OcxState")));
|
||||||
((System.ComponentModel.ISupportInitialize)(this._MyDSOFramer)).EndInit();
|
_MyEdWord.EndInit();
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
this._MyDSOFramer.Open(MyDSOFile.MyFile.FullName);
|
this._MyEdWord.LicenseName = "Volian7573291802";// B2017-133 Edraw
|
||||||
//this._MyDSOFramer.Open(MyDSOFile.MyFile.FullName,false,"Word.Document","","");
|
this._MyEdWord.LicenseCode = "EDW8-5527-1201-AB8A";// B2017-133 Edraw
|
||||||
|
this._MyEdWord.Open(MyDSOFile.MyFile.FullName);
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
_MyLog.Warn("dso fraimer error", ex); // put exception message in the error log
|
|
||||||
System.IO.FileStream fs = MyDSOFile.MyFile.Create();
|
System.IO.FileStream fs = MyDSOFile.MyFile.Create();
|
||||||
using (DocumentAuditInfoList dail = DocumentAuditInfoList.Get(MyDocumentInfo.DocID))
|
using (DocumentAuditInfoList dail = DocumentAuditInfoList.Get(MyDocumentInfo.DocID))
|
||||||
{
|
{
|
||||||
@ -194,36 +227,14 @@ namespace Volian.Controls.Library
|
|||||||
MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
|
MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
|
||||||
}
|
}
|
||||||
fs.Close();
|
fs.Close();
|
||||||
this._MyDSOFramer.Open(MyDSOFile.MyFile.FullName);
|
this._MyEdWord.Open(MyDSOFile.MyFile.FullName);// B2017-133 Edraw
|
||||||
}
|
}
|
||||||
LBDocumentClass doc = new LBDocumentClass(_MyDSOFramer.ActiveDocument);
|
LBDocumentClass doc = new LBDocumentClass(_MyEdWord.ActiveDocument());
|
||||||
Console.WriteLine("Version {0}", doc.Application.Version);
|
Console.WriteLine("Version {0}", doc.Application.Version);
|
||||||
float ver;
|
float ver;
|
||||||
if (!float.TryParse(doc.Application.Version, out ver))
|
if (!float.TryParse(doc.Application.Version, out ver))
|
||||||
ver = 12.0F;
|
ver = 12.0F;
|
||||||
this._MyDSOFramer.Menubar = ver < 12.0F;
|
|
||||||
this._MyDSOFramer.set_EnableFileCommand(DSOFramer.dsoFileCommandType.dsoFileClose, false);
|
|
||||||
this._MyDSOFramer.set_EnableFileCommand(DSOFramer.dsoFileCommandType.dsoFileNew, false);
|
|
||||||
this._MyDSOFramer.set_EnableFileCommand(DSOFramer.dsoFileCommandType.dsoFilePageSetup, false);
|
|
||||||
this._MyDSOFramer.set_EnableFileCommand(DSOFramer.dsoFileCommandType.dsoFilePrint, false);
|
|
||||||
this._MyDSOFramer.set_EnableFileCommand(DSOFramer.dsoFileCommandType.dsoFilePrintPreview, false);
|
|
||||||
this._MyDSOFramer.set_EnableFileCommand(DSOFramer.dsoFileCommandType.dsoFileProperties, false);
|
|
||||||
this._MyDSOFramer.set_EnableFileCommand(DSOFramer.dsoFileCommandType.dsoFileSave, false);
|
|
||||||
this._MyDSOFramer.set_EnableFileCommand(DSOFramer.dsoFileCommandType.dsoFileSaveAs, false);
|
|
||||||
this._MyDSOFramer.Titlebar = false;
|
|
||||||
//if (_MyCount < 20)
|
|
||||||
// this._MyDSOFramer.FrameHookPolicy = DSOFramer.dsoFrameHookPolicy.dsoResetNow;
|
|
||||||
//this._MyDSOFramer.BeforeDocumentClosed += new AxDSOFramer._DFramerCtlEvents_BeforeDocumentClosedEventHandler(_MyDSOFramer_BeforeDocumentClosed);
|
|
||||||
//this._MyDSOFramer.OnSaveCompleted += new AxDSOFramer._DFramerCtlEvents_OnSaveCompletedEventHandler(_MyDSOFramer_OnSaveCompleted);
|
|
||||||
//this._MyDSOFramer.LostFocus += new EventHandler(_MyDSOFramer_LostFocus);
|
|
||||||
//this._MyDSOFramer.GotFocus += new EventHandler(_MyDSOFramer_GotFocus);
|
|
||||||
//this._MyDSOFramer.Enter += new EventHandler(_MyDSOFramer_Enter);
|
|
||||||
//this._MyDSOFramer.Leave += new EventHandler(_MyDSOFramer_Leave);
|
|
||||||
//this._MyDSOFramer.OnActivationChange += new AxDSOFramer._DFramerCtlEvents_OnActivationChangeEventHandler(_MyDSOFramer_OnActivationChange);
|
|
||||||
this.Enter += new EventHandler(DSOTabPanel_Enter);
|
this.Enter += new EventHandler(DSOTabPanel_Enter);
|
||||||
//this.Leave += new EventHandler(DSOTabPanel_Leave);
|
|
||||||
//this.GotFocus += new EventHandler(DSOTabPanel_GotFocus);
|
|
||||||
//this.LostFocus += new EventHandler(DSOTabPanel_LostFocus);
|
|
||||||
Application.DoEvents();
|
Application.DoEvents();
|
||||||
// The following line corrects Symbol characters in MSWord Sections
|
// The following line corrects Symbol characters in MSWord Sections
|
||||||
// CheckForSymbolCharacters(doc);
|
// CheckForSymbolCharacters(doc);
|
||||||
@ -240,7 +251,7 @@ namespace Volian.Controls.Library
|
|||||||
}
|
}
|
||||||
public void FixSymbolCharacters()
|
public void FixSymbolCharacters()
|
||||||
{
|
{
|
||||||
CheckForSymbolCharacters(new LBDocumentClass(_MyDSOFramer.ActiveDocument));
|
CheckForSymbolCharacters(new LBDocumentClass(_MyEdWord.ActiveDocument()));// B2017-133 Edraw
|
||||||
}
|
}
|
||||||
private void CheckForSymbolCharacters(LBDocumentClass doc)
|
private void CheckForSymbolCharacters(LBDocumentClass doc)
|
||||||
{
|
{
|
||||||
@ -298,7 +309,7 @@ namespace Volian.Controls.Library
|
|||||||
{
|
{
|
||||||
if (SearchString == null) return;
|
if (SearchString == null) return;
|
||||||
// Get the Document
|
// Get the Document
|
||||||
LBDocumentClass wordDoc = new LBDocumentClass(_MyDSOFramer.ActiveDocument);
|
LBDocumentClass wordDoc = new LBDocumentClass(_MyEdWord.ActiveDocument());
|
||||||
//LBSelection sel = wordDoc.Application.Selection;
|
//LBSelection sel = wordDoc.Application.Selection;
|
||||||
LBFind find = wordDoc.Application.Selection.Find;
|
LBFind find = wordDoc.Application.Selection.Find;
|
||||||
find.ClearFormatting();
|
find.ClearFormatting();
|
||||||
@ -314,7 +325,7 @@ namespace Volian.Controls.Library
|
|||||||
{
|
{
|
||||||
if (txt == null || txt.Length == 0) return; //nothing to insert
|
if (txt == null || txt.Length == 0) return; //nothing to insert
|
||||||
// Get the Document
|
// Get the Document
|
||||||
LBDocumentClass wordDoc = new LBDocumentClass(_MyDSOFramer.ActiveDocument);
|
LBDocumentClass wordDoc = new LBDocumentClass(_MyEdWord.ActiveDocument());
|
||||||
//This will get the selected range or just the current cursor position
|
//This will get the selected range or just the current cursor position
|
||||||
LBSelection sel = wordDoc.Application.Selection;
|
LBSelection sel = wordDoc.Application.Selection;
|
||||||
// This will replace the selection or insert at current position
|
// This will replace the selection or insert at current position
|
||||||
@ -323,7 +334,7 @@ namespace Volian.Controls.Library
|
|||||||
|
|
||||||
public string GetSelectedString()
|
public string GetSelectedString()
|
||||||
{
|
{
|
||||||
LBDocumentClass wordDoc = new LBDocumentClass(_MyDSOFramer.ActiveDocument);
|
LBDocumentClass wordDoc = new LBDocumentClass(_MyEdWord.ActiveDocument());
|
||||||
//This will get the selected range or just the current cursor position
|
//This will get the selected range or just the current cursor position
|
||||||
LBSelection sel = wordDoc.Application.Selection;
|
LBSelection sel = wordDoc.Application.Selection;
|
||||||
// if the start & end are the same, nothing is selected:
|
// if the start & end are the same, nothing is selected:
|
||||||
@ -415,10 +426,10 @@ namespace Volian.Controls.Library
|
|||||||
MessageBox.Show("Currently in VIEW mode,\r\n cannot Save " + _MyDisplayTabItem.Tooltip);
|
MessageBox.Show("Currently in VIEW mode,\r\n cannot Save " + _MyDisplayTabItem.Tooltip);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
LBDocumentClass doc = new LBDocumentClass(_MyDSOFramer.ActiveDocument);
|
LBDocumentClass doc = new LBDocumentClass(_MyEdWord.ActiveDocument());
|
||||||
while (doc.Saved = false)
|
//while (doc.Saved = false)
|
||||||
Application.DoEvents();
|
// Application.DoEvents();
|
||||||
string tmp = GetReflectiveProperty(_MyDSOFramer.ActiveDocument, "FullName");
|
string tmp = GetReflectiveProperty(_MyEdWord.ActiveDocument(), "FullName");
|
||||||
if (System.IO.File.Exists(tmp))
|
if (System.IO.File.Exists(tmp))
|
||||||
MyDSOFile.FullName = tmp;
|
MyDSOFile.FullName = tmp;
|
||||||
else
|
else
|
||||||
@ -475,51 +486,6 @@ namespace Volian.Controls.Library
|
|||||||
_MyLog.Warn("Before Closing Document ", ex);
|
_MyLog.Warn("Before Closing Document ", ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public static bool IgnoreEnter = false;
|
|
||||||
private bool _In_DSOTabPanel_Enter=false;
|
|
||||||
/// <summary>
|
|
||||||
/// When a Word document is selected make sure it's tab is activated and
|
|
||||||
/// the SelectedItem for the DisplayTabControl is updated.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="sender"></param>
|
|
||||||
/// <param name="e"></param>
|
|
||||||
private void DSOTabPanel_Enter(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
if (IgnoreEnter) return;
|
|
||||||
_MyTransparentPanel.SendToBack();
|
|
||||||
|
|
||||||
// Set whether this worddoc is in view/edit mode by checking whether the
|
|
||||||
// procedure is in view/edit mode (based on the steppanel. This occurs on
|
|
||||||
// the enter event so that the mode is determined any time this panel becomes
|
|
||||||
// active.
|
|
||||||
// find steptabpanel and its view/edit. If it doesn't have a steptabpanel
|
|
||||||
// use default - edit. Later when we have ownership, need to use that.
|
|
||||||
PanelViewEditMode = E_ViewMode.Edit; // default to edit
|
|
||||||
if (MyDisplayTabItem.MyItemInfo != null) // lib doc with no associated active procedure defaults to edit
|
|
||||||
{
|
|
||||||
StepTabPanel stpanel = _MyDisplayTabControl.GetProcedureTabPanel(MyDisplayTabItem.MyItemInfo);
|
|
||||||
PanelViewEditMode = (stpanel == null) ? E_ViewMode.Edit : stpanel.MyStepPanel.VwMode;
|
|
||||||
}
|
|
||||||
try
|
|
||||||
{
|
|
||||||
//_MyDSOFramer.EventsEnabled = true;
|
|
||||||
_MyDSOFramer.FrameHookPolicy = DSOFramer.dsoFrameHookPolicy.dsoResetNow;
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
if (_MyLog.IsErrorEnabled) _MyLog.ErrorFormat("DSOTabPage_Enter", ex);
|
|
||||||
}
|
|
||||||
if (_In_DSOTabPanel_Enter) return;
|
|
||||||
//vlnStackTrace.ShowStack("DSOTabPanel_Enter {0} DocID {1} Index {2} {3}",_In_DSOTabPanel_Enter, this._MyDocumentInfo.DocID, _MyDisplayTabControl.MyBar.SelectedDockTab, sender.GetType().FullName);
|
|
||||||
_In_DSOTabPanel_Enter = true;
|
|
||||||
if (MyDisplayTabItem.MyItemInfo != null)
|
|
||||||
_MyDisplayTabControl.OnItemSelectedChanged(this,new ItemSelectedChangedEventArgs(MyDisplayTabItem.MyItemInfo));
|
|
||||||
_MyDSOFramer.Focus();
|
|
||||||
_In_DSOTabPanel_Enter = false;
|
|
||||||
_MyDisplayTabControl.SelectedDisplayTabItem = MyDisplayTabItem;
|
|
||||||
}
|
|
||||||
#endregion
|
|
||||||
#region Public Methods
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Save the contents of the Word Document to a file
|
/// Save the contents of the Word Document to a file
|
||||||
/// and save the file to the database
|
/// and save the file to the database
|
||||||
@ -530,7 +496,8 @@ namespace Volian.Controls.Library
|
|||||||
bool result = true;
|
bool result = true;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
_MyDSOFramer.Save();
|
bool stat = _MyEdWord.Save();// B2017-133 Edraw
|
||||||
|
Console.WriteLine("Save = {0}", stat);
|
||||||
SaveDSO_Phase2();
|
SaveDSO_Phase2();
|
||||||
//_MyDSOFramer_OnSaveCompleted(this, null);
|
//_MyDSOFramer_OnSaveCompleted(this, null);
|
||||||
// These are handled in the method above
|
// These are handled in the method above
|
||||||
@ -570,6 +537,51 @@ namespace Volian.Controls.Library
|
|||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
public static bool IgnoreEnter = false;
|
||||||
|
private bool _In_DSOTabPanel_Enter=false;
|
||||||
|
/// <summary>
|
||||||
|
/// When a Word document is selected make sure it's tab is activated and
|
||||||
|
/// the SelectedItem for the DisplayTabControl is updated.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sender"></param>
|
||||||
|
/// <param name="e"></param>
|
||||||
|
private void DSOTabPanel_Enter(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (IgnoreEnter) return;
|
||||||
|
_MyTransparentPanel.SendToBack();
|
||||||
|
|
||||||
|
// Set whether this worddoc is in view/edit mode by checking whether the
|
||||||
|
// procedure is in view/edit mode (based on the steppanel. This occurs on
|
||||||
|
// the enter event so that the mode is determined any time this panel becomes
|
||||||
|
// active.
|
||||||
|
// find steptabpanel and its view/edit. If it doesn't have a steptabpanel
|
||||||
|
// use default - edit. Later when we have ownership, need to use that.
|
||||||
|
PanelViewEditMode = E_ViewMode.Edit; // default to edit
|
||||||
|
if (MyDisplayTabItem.MyItemInfo != null) // lib doc with no associated active procedure defaults to edit
|
||||||
|
{
|
||||||
|
StepTabPanel stpanel = _MyDisplayTabControl.GetProcedureTabPanel(MyDisplayTabItem.MyItemInfo);
|
||||||
|
PanelViewEditMode = (stpanel == null) ? E_ViewMode.Edit : stpanel.MyStepPanel.VwMode;
|
||||||
|
}
|
||||||
|
try
|
||||||
|
{
|
||||||
|
//_MyDSOFramer.EventsEnabled = true;
|
||||||
|
//_MyEdWord.FrameHookPolicy = DSOFramer.dsoFrameHookPolicy.dsoResetNow;
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
if (_MyLog.IsErrorEnabled) _MyLog.ErrorFormat("DSOTabPage_Enter", ex);
|
||||||
|
}
|
||||||
|
if (_In_DSOTabPanel_Enter) return;
|
||||||
|
//vlnStackTrace.ShowStack("DSOTabPanel_Enter {0} DocID {1} Index {2} {3}",_In_DSOTabPanel_Enter, this._MyDocumentInfo.DocID, _MyDisplayTabControl.MyBar.SelectedDockTab, sender.GetType().FullName);
|
||||||
|
_In_DSOTabPanel_Enter = true;
|
||||||
|
if (MyDisplayTabItem.MyItemInfo != null)
|
||||||
|
_MyDisplayTabControl.OnItemSelectedChanged(this,new ItemSelectedChangedEventArgs(MyDisplayTabItem.MyItemInfo));
|
||||||
|
_MyEdWord.Focus();
|
||||||
|
_In_DSOTabPanel_Enter = false;
|
||||||
|
_MyDisplayTabControl.SelectedDisplayTabItem = MyDisplayTabItem;
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
#region Public Methods
|
||||||
private bool _IsBeingDeleted = false;
|
private bool _IsBeingDeleted = false;
|
||||||
public bool IsBeingDeleted
|
public bool IsBeingDeleted
|
||||||
{
|
{
|
||||||
@ -595,14 +607,14 @@ namespace Volian.Controls.Library
|
|||||||
bool result = true;
|
bool result = true;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (_MyDSOFramer != null)
|
if (_MyEdWord != null)
|
||||||
{
|
{
|
||||||
SaveDSO_Phase1();
|
SaveDSO_Phase1();
|
||||||
_MyDSOFramer.Close();
|
_MyEdWord.CloseDoc();
|
||||||
Controls.Remove(_MyDSOFramer);
|
Controls.Remove(_MyEdWord);
|
||||||
components.Remove(_MyDSOFramer);
|
components.Remove(_MyEdWord);
|
||||||
_MyDSOFramer.Dispose();
|
_MyEdWord.Dispose();
|
||||||
_MyDSOFramer = null;
|
_MyEdWord = null;
|
||||||
_Count--;
|
_Count--;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -620,9 +632,9 @@ namespace Volian.Controls.Library
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
this._MyDSOFramer.Activate();
|
//this._MyEdWord.Activate();
|
||||||
if (_MyCount <= MSWordLimit)
|
//if (_MyCount <= MSWordLimit)
|
||||||
this._MyDSOFramer.FrameHookPolicy = DSOFramer.dsoFrameHookPolicy.dsoResetNow;
|
// this._MyEdWord.FrameHookPolicy = DSOFramer.dsoFrameHookPolicy.dsoResetNow;
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user