Show message box if library document is already open
This commit is contained in:
parent
73bf820df0
commit
ad8de088bf
@ -411,7 +411,14 @@ namespace Volian.Controls.Library
|
|||||||
EntryInfo myEntry = myItemInfo.MyContent.MyEntry;
|
EntryInfo myEntry = myItemInfo.MyContent.MyEntry;
|
||||||
string key = "Doc - " + myEntry.DocID;
|
string key = "Doc - " + myEntry.DocID;
|
||||||
if (_MyDisplayTabItems.ContainsKey(key)) // If document page open use it
|
if (_MyDisplayTabItems.ContainsKey(key)) // If document page open use it
|
||||||
|
{
|
||||||
pg = _MyDisplayTabItems[key];
|
pg = _MyDisplayTabItems[key];
|
||||||
|
if (pg.MyItemInfo.ItemID != myItemInfo.ItemID)
|
||||||
|
{
|
||||||
|
string msg = string.Format("{0} is already open", myItemInfo.MyContent.MyEntry.MyDocument.LibTitle);
|
||||||
|
MessageBox.Show(msg, "Library Document is Already Open", MessageBoxButtons.OK);
|
||||||
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (DSOTabPanel.Count > 18) // Limit the number of open document pages to 18
|
if (DSOTabPanel.Count > 18) // Limit the number of open document pages to 18
|
||||||
@ -419,8 +426,10 @@ namespace Volian.Controls.Library
|
|||||||
MessageBox.Show("Too many Word Documents Open. Please close one of the Documents before attempting to open another");
|
MessageBox.Show("Too many Word Documents Open. Please close one of the Documents before attempting to open another");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
if ((myItemInfo.MyContent.MyEntry.MyDocument.LibTitle ?? "") != "")
|
||||||
|
MessageBox.Show("WARNING: All edits made to this Library Document will be applied to all uses of the Document");
|
||||||
pg = new DisplayTabItem(this.components, this, myItemInfo, key); // Open a new document page
|
pg = new DisplayTabItem(this.components, this, myItemInfo, key); // Open a new document page
|
||||||
_MyDisplayTabItems.Add(key, pg);
|
_MyDisplayTabItems.Add(key, pg);
|
||||||
}
|
}
|
||||||
SelectedDisplayTabItem = pg;
|
SelectedDisplayTabItem = pg;
|
||||||
pg.MyDSOTabPanel.EnterPanel();
|
pg.MyDSOTabPanel.EnterPanel();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user