B2024-038: tree view menuing for paste/replace of sections #386
@ -672,8 +672,10 @@ namespace Volian.Controls.Library
|
||||
if (_MyDisplayTabItems.ContainsKey(key) && pasteType != ItemInfo.EAddpingPart.Replace) // If procedure page open use it unless replace
|
||||
{
|
||||
DisplayTabItem pg = _MyDisplayTabItems[key];
|
||||
// B2024-038: if section, refresh the editor even if the section is not expanded.
|
||||
bool isSec = myItemInfo.IsSection;
|
||||
if (pg.MyStepTabPanel.MyStepPanel._LookupEditItems.ContainsKey(myItemInfo.ItemID) &&
|
||||
pg.MyStepTabPanel.MyStepPanel._LookupEditItems[myItemInfo.ItemID].Expanded)
|
||||
(pg.MyStepTabPanel.MyStepPanel._LookupEditItems[myItemInfo.ItemID].Expanded || isSec))
|
||||
{
|
||||
EditItem edtitm = pg.MyStepTabPanel.MyStepPanel._LookupEditItems[myItemInfo.ItemID];
|
||||
switch (pasteType)
|
||||
@ -710,7 +712,8 @@ namespace Volian.Controls.Library
|
||||
}
|
||||
else if (_MyDisplayTabItems.ContainsKey(key) && pasteType == ItemInfo.EAddpingPart.Replace)
|
||||
{
|
||||
CloseTabItem(_MyDisplayTabItems["Item - " + myItemInfo.ItemID.ToString()]); //Grab itemID and set to close open tab.
|
||||
// B2024-038: changed tab key to procedure (was item, which caused crash if section)
|
||||
CloseTabItem(_MyDisplayTabItems["Item - " + proc.ItemID.ToString()]); //Grab itemID and set to close open tab.
|
||||
return false; //B2017-179 PasteReplace will return null if was aborted
|
||||
}
|
||||
return false;
|
||||
|
@ -1740,10 +1740,13 @@ namespace Volian.Controls.Library
|
||||
// 1) 'to' & 'from' both 'non', i.e. Neither can have enhanced config data (be source or enhanced)
|
||||
// can do Before/After/Replace
|
||||
// 2) 'to' section is 'source' and 'from' section is 'non' (has no MyEnhancedDocuments)
|
||||
// can do Before/After - no links exist in pasted section.
|
||||
// cannot do Replace
|
||||
// can do Before/After - no links exist in pasted section so cannot do Replace
|
||||
// 3) 'to' section is 'source' and 'from' section is same docversion 'source'
|
||||
// can do Before/After/Replace
|
||||
// can do Before/After (B2024-038 removes replace)
|
||||
// 4) 'to' section is not 'source' and 'from' section is source
|
||||
// can do Before/After but not replace - would have to manage
|
||||
// links for 'from' section (B2024-038 added this case)
|
||||
|
||||
SectionConfig secToCfg = iiPasteHere.MyConfig as SectionConfig;
|
||||
SectionConfig secFromCfg = iiClipboard.MyConfig as SectionConfig;
|
||||
|
||||
@ -1758,7 +1761,16 @@ namespace Volian.Controls.Library
|
||||
secCanPaste = true;
|
||||
okToReplace = false;
|
||||
}
|
||||
else if (secToIsSource && iiPasteHere.MyDocVersion.VersionID == iiClipboard.MyDocVersion.VersionID) secCanPaste = true; // 3)
|
||||
else if (secToIsSource && iiPasteHere.MyDocVersion.VersionID == iiClipboard.MyDocVersion.VersionID)
|
||||
{
|
||||
secCanPaste = true; // 3)
|
||||
okToReplace = false;
|
||||
}
|
||||
else if (!secToIsSource && secFromIsSource)
|
||||
{
|
||||
secCanPaste = true; // 4
|
||||
okToReplace = false;
|
||||
}
|
||||
if (iiClipboard.IsRtfRaw) secCanPaste = okToReplace = false; // never paste an equation.
|
||||
if (secCanPaste) cm.MenuItems.Add("Paste Section Before", new EventHandler(mi_Click));
|
||||
if (okToReplace && secCanPaste) cm.MenuItems.Add("Replace Existing Section", new EventHandler(mi_Click));
|
||||
|
Loading…
x
Reference in New Issue
Block a user