Upped revision number to 1.8

C2020-033: 2021 UPGRADE Handling of incoming transitions on delete or review
This commit is contained in:
2021-01-06 15:07:57 +00:00
parent ba2e72baeb
commit fdd59a5d6b
18 changed files with 1564 additions and 1005 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -31,6 +31,28 @@ namespace Volian.Controls.Library
}
#endregion
#region Properties
// C2020-033: SearchIncTransII represents the item that the transitions go to. It can be either the item the user
// tried to delete or that the user selected to get Incoming Transitions from tree view or ribbon.
private ItemInfo _SearchIncTransII = null;
public ItemInfo SearchIncTransII
{
get
{
return _SearchIncTransII;
}
set
{
_SearchIncTransII = value;
if (_SearchIncTransII != null) lblSrchIncTran.Text = _SearchIncTransII.Path;
else lblSrchIncTran.Text = "";
}
}
private static UserInfo _MyUserInfo = null;
public static UserInfo MyUserInfo
{
get { return _MyUserInfo; }
set { _MyUserInfo = value; }
}
private string _strSrchText = "";
private List<DocVersionInfo> lstCheckedDocVersions = new List<DocVersionInfo>();
private List<int> lstCheckedStepTypes = new List<int>();
@@ -61,6 +83,7 @@ namespace Volian.Controls.Library
void _SearchResults_ListChanged(object sender, ListChangedEventArgs e)
{
lbSrchResults.SelectedIndex = -1; // Don't select an item from the new list
lbSrchResultsIncTrans.SelectedIndex = -1;
}
private string _DisplayMember = "SearchPath";
@@ -167,7 +190,20 @@ namespace Volian.Controls.Library
if(wordSectionTreeNode != null) //B2020-070 NULL reference check
wordSectionTreeNode.Enabled = true;
btnSearch.Enabled = true;
if (e.NewTab == tabROSearch)
xpSetToSearch.Enabled = true;
xpStepTypes.Enabled = true;
lbSrchResults.Visible = true;
lbSrchResultsIncTrans.Visible = false;
if (e.NewTab == tabIncTrans) // C2020-033: Incoming transitions
{
xpSetToSearch.Enabled = false;
xpStepTypes.Enabled = false;
lbSrchResults.Visible = false;
lbSrchResultsIncTrans.Visible = true;
lbSrchResultsIncTrans.CheckBoxesVisible = true;
lbSrchResultsIncTrans.AutoScroll = true;
}
else if (e.NewTab == tabROSearch)
{
LoadROComboTree();
}
@@ -175,7 +211,7 @@ namespace Volian.Controls.Library
{
if (wordSectionTreeNode != null) //B2020-070 NULL reference check
{
wordSectionTreeNode.Enabled = false; // C2020-010: Disable Word Section choice for Transition search
wordSectionTreeNode.Enabled = false; // C2020-010: Disable Word Section choice for Transition search
wordSectionTreeNode.Checked = false;
}
btnSearch.Enabled = (cbxTranCategory.Items.Count > 0); // B2017-038 disable search button if no format selected
@@ -187,7 +223,7 @@ namespace Volian.Controls.Library
foreach (DevComponents.AdvTree.Node n in dicExpandedFolderNodes.Keys)
{
DocVersionInfo dvi = (DocVersionInfo)n.Tag;
if(cbxTranVersion.Tag.ToString().Contains(dvi.VersionID.ToString()))
if (cbxTranVersion.Tag.ToString().Contains(dvi.VersionID.ToString()))
n.Enabled = true;
else
n.Enabled = false;
@@ -1036,18 +1072,27 @@ namespace Volian.Controls.Library
private void DisplayResults()
{
_LoadingList = true;
lbSrchResults.DisplayMember = _DisplayMember;
// C2020-033: Incoming Transition tab. Note that this tab uses a different control for the search
// results, it uses the dotnetbar list that has check boxes. Because of this, various places throughout
// the code will check for what tab is displayed and will work eith the associated list box, either
// lbSrchResults or lbSrchResultsIncTrans
if (tabSearchTypes.SelectedTab != tabSearchTypes.Tabs[4]) lbSrchResults.DisplayMember = _DisplayMember;
else lbSrchResultsIncTrans.DisplayMember = _DisplayMember;
if (_SearchResults != null)
{
if (cbSorted.Checked)
{
Csla.SortedBindingList<ItemInfo> sortedResults = new Csla.SortedBindingList<ItemInfo>(_SearchResults);
sortedResults.ApplySort(_DisplayMember, ListSortDirection.Ascending);
lbSrchResults.DataSource = sortedResults;
if (tabSearchTypes.SelectedTab != tabSearchTypes.Tabs[4]) lbSrchResults.DataSource = sortedResults;
else lbSrchResultsIncTrans.DataSource = sortedResults;
}
else
{
//PopulatelbSrcResults(_SearchResults);
lbSrchResults.DataSource = _SearchResults;
if (tabSearchTypes.SelectedTab != tabSearchTypes.Tabs[4]) lbSrchResults.DataSource = _SearchResults;
else lbSrchResultsIncTrans.DataSource = _SearchResults;
}
grpPanSearchResults.Text = string.Format("Search Results Found: {0}", _SearchResults.Count);
grpPanSearchResults.Style.BackColor = Color.LightGreen;// Color.YellowGreen; Color.DarkSeaGreen;
}
@@ -1057,7 +1102,7 @@ namespace Volian.Controls.Library
grpPanSearchResults.Style.BackColor = saveGrpPanSearchResults;
}
// Turn Print and Results display style on/off based on whether there are search results
if (lbSrchResults.Items.Count > 0)
if (_SearchResults != null && _SearchResults.Count > 0)
{
btnPrnSrchRslts.Enabled = true;
btnClearSearchResults.Enabled = true;
@@ -1075,6 +1120,7 @@ namespace Volian.Controls.Library
}
lbSrchResults.SelectedIndex = -1;
lbSrchResultsIncTrans.SelectedIndex = -1;
LastResultsMouseOverIndex = -1;
_LoadingList = false;
@@ -1125,24 +1171,56 @@ namespace Volian.Controls.Library
LastResultsMouseOverIndex = ResultsMouseOverIndex;
}
}
// C2020-033: lbSrchResultsIncTrans_ItemClicked is used to check permissions of a selection before allowing an
// item to be clicked and to turn on/off the btnTranCvtSelToTxt button for converting selected to test.
// Two variables are used to keep track if items are checked in the list box:
// JustDidSelection - selecting an item event goes into both SelectedValueChanged & ItemClicked
// but need to keep track of itemclicked which is event for checking/unchecking of Incoming Transition
// items in lbSrchResultsIncTrans
// IncTransSelectedCount is used to keep track if any items are checked
private int IncTransSelectedCount = 0;
bool JustDidSelection = false;
private void lbSrchResultsIncTrans_ItemClicked(object sender, EventArgs e)
{
ListBoxItem lbi = sender as ListBoxItem;
ItemBindingData ibd = lbi.Tag as ItemBindingData;
ItemInfo ii = ibd.DataItem as ItemInfo;
bool allowNonAdmin = IncTranCvtPerm();
if (lbi.CheckState == CheckState.Checked && ii != null)
{
if (!allowNonAdmin && !UserInfo.CanEdit(MyUserInfo, ii.MyDocVersion))
{
FlexibleMessageBox.Show("You do not have permission to edit the procedure, section, or step.",
"Convert Transition to Text", MessageBoxButtons.OK, MessageBoxIcon.Information);
lbi.CheckState = CheckState.Unchecked;
}
else
if (!JustDidSelection) IncTransSelectedCount++;
}
else
if (!JustDidSelection && IncTransSelectedCount > 0) IncTransSelectedCount--; // user unchecked an item
if (!JustDidSelection) btnTranCvtSelToTxt.Enabled = IncTransSelectedCount > 0;
JustDidSelection = false;
}
private bool _ProcessingSelectedValueChanged = false;
private void lbSrchResults_SelectedValueChanged(object sender, EventArgs e)
{
if (_LoadingList) return;
if (_ProcessingSelectedValueChanged) return;
_ProcessingSelectedValueChanged = true;
JustDidSelection = true;
// If the list is being refreshed, then set the selection index to -1 (no selection)
if (_SearchResults.RefreshingList && lbSrchResults.SelectedIndex != -1)
lbSrchResults.SelectedIndex = -1;
lbSrchResultsIncTrans.SelectedIndex = lbSrchResults.SelectedIndex = -1;
else
{
_ItemInfo = lbSrchResults.SelectedValue as ItemInfo;
_ItemInfo = (tabSearchTypes.SelectedTab == tabSearchTypes.Tabs[4])? lbSrchResultsIncTrans.SelectedValue as ItemInfo : lbSrchResults.SelectedValue as ItemInfo;
if ((tabSearchTypes.SelectedTab == tabSearchTypes.Tabs[1]) && (_ItemInfo != null))
{
// B2020-019: Don't set the CurrentAnnotation to an annotation in a procedure that cannot be opened.
AnnotationInfo tmpca = AnnotationInfo.Get(_ItemInfo.SearchAnnotationID);
DisplayTabItem dti = null;
if (tmpca != null) dti = _TabControl.OpenItem(tmpca.MyItem); // open the corresponding procedure text
if (tmpca != null) dti = _TabControl.OpenItem(tmpca.MyItem); // open the corresponding procedure text
if (dti != null)
{
_AnnotationDetails.CurrentAnnotation = tmpca;
@@ -1359,6 +1437,7 @@ namespace Volian.Controls.Library
private void btnSearch_Click(object sender, EventArgs e)
{
IncTransSelectedCount = 0;
_fromLoad = false;
DateTime start = DateTime.Now;
Cursor savcursor = Cursor;
@@ -1368,9 +1447,18 @@ namespace Volian.Controls.Library
try
{
LastSearchWasAnnotations = false; // B2019-119 only refresh annotation search results if an annotation search was done
lbSrchResults.DataSource = null;
lbSrchResults.Items.Clear();
toolTip1.SetToolTip(lbSrchResults, null);
if (tabSearchTypes.SelectedTab != tabSearchTypes.Tabs[4])
{
lbSrchResults.DataSource = null;
lbSrchResults.Items.Clear();
toolTip1.SetToolTip(lbSrchResults, null);
}
else // C2020-033: Incoming Transiiotns
{
lbSrchResultsIncTrans.DataSource = null;
lbSrchResultsIncTrans.Items.Clear();
toolTip1.SetToolTip(lbSrchResultsIncTrans, null);
}
Cursor = Cursors.WaitCursor;
SearchResults = null;
bool includeRTFformat = false;
@@ -1407,7 +1495,7 @@ namespace Volian.Controls.Library
ReportTitle = "Step Element Report"; //"Proms - Search by Type: " + typstr;
TypesSelected = "Filtered By: " + typstr;
SearchString = null;
SearchResults = ItemInfoList.GetListFromTextSearch(DVISearchList, TypeSearchList, "", cbxBooleanTxtSrch.Checked ? 2 : cbxCaseSensitive.Checked ? 1 : 0, ItemSearchIncludeLinks.Value, includeRTFformat, includeSpecialChars, unitPrefix,"","");
SearchResults = ItemInfoList.GetListFromTextSearch(DVISearchList, TypeSearchList, "", cbxBooleanTxtSrch.Checked ? 2 : cbxCaseSensitive.Checked ? 1 : 0, ItemSearchIncludeLinks.Value, includeRTFformat, includeSpecialChars, unitPrefix, "", "");
cmbResultsStyleIndex = 1; //display step locations in results
}
}
@@ -1433,19 +1521,19 @@ namespace Volian.Controls.Library
// does not allow the preceding/following text to have a number, '.', letter or other rtf
// commands. If the search string starts/ends with a letter, then use an expression that does not
// find the preceding/following text that is text, i.e. a letter.
if (Regex.IsMatch(TextSearchString, @"^[\d\.]")) // starts with a number or '.' decimal pt
if (Regex.IsMatch(TextSearchString, @"^[\d\.]")) // starts with a number or '.' decimal pt
{
byWordPrefix = @"[^0-9a-zA-Z.vbpi:\\-]";
}
else if (Regex.IsMatch(TextSearchString, @"^[a-zA-Z]")) // starts with a letter
else if (Regex.IsMatch(TextSearchString, @"^[a-zA-Z]")) // starts with a letter
{
byWordPrefix = @"[^a-zA-Z]";
}
if (Regex.IsMatch(TextSearchString, @"[\d\.]$")) // ends with a number or decimal
if (Regex.IsMatch(TextSearchString, @"[\d\.]$")) // ends with a number or decimal
{
byWordSuffix = @"[^0-9a-zA-Z.vbpi:\\-]";
}
else if (Regex.IsMatch(TextSearchString, @"[a-zA-Z]$")) // ends with a letter
else if (Regex.IsMatch(TextSearchString, @"[a-zA-Z]$")) // ends with a letter
{
byWordSuffix = @"[^a-zA-Z]";
}
@@ -1465,7 +1553,7 @@ namespace Volian.Controls.Library
//ReportTitle = string.Format("Proms - Annotation Search for '{0}'", cbxTextSearchAnnotation.Text);
if (cbxTextSearchAnnotation.Text == null || cbxTextSearchAnnotation.Text == "")
{
ReportTitle = string.Format("Find {0}{1}", cbxAnnoTypes.Text, (cbxAnnoTypes.SelectedIndex > 0)?" Annotations" : "" );
ReportTitle = string.Format("Find {0}{1}", cbxAnnoTypes.Text, (cbxAnnoTypes.SelectedIndex > 0) ? " Annotations" : "");
}
else
{
@@ -1477,7 +1565,7 @@ namespace Volian.Controls.Library
//SearchResults = ItemInfoList.GetListFromAnnotationSearch(dviSearchList, typeSearchList, textSearchString, srchStr, cbxCaseSensitiveAnnoText.Checked);
SearchResults = ItemInfoList.GetListFromAnnotationSearch(DVISearchList, TypeSearchList, AnnotationSearchType, cbxTextSearchAnnotation.Text, cbxCaseSensitiveAnnoText.Checked,unitPrefix);
SearchResults = ItemInfoList.GetListFromAnnotationSearch(DVISearchList, TypeSearchList, AnnotationSearchType, cbxTextSearchAnnotation.Text, cbxCaseSensitiveAnnoText.Checked, unitPrefix);
//UpdateAnnotationSearchResults();
cmbResultsStyleIndex = 2; // display annotation text in results
}
@@ -1498,7 +1586,7 @@ namespace Volian.Controls.Library
cmbResultsStyleIndex = 3; // display step text in results
}
}
else if (tabSearchTypes.SelectedTab == tabSearchTypes.Tabs[3]) //Transition Search
else if (tabSearchTypes.SelectedTab == tabSearchTypes.Tabs[3]) //Transition Search
{
ReportTitle = string.Format("Search For Transitions: Transition Type: {0}, Transition Category: {1}", cbxTranFormat.SelectedItem, cbxTranCategory.SelectedItem);
string docVersionList = string.Empty;
@@ -1520,6 +1608,44 @@ namespace Volian.Controls.Library
SearchResults = ItemInfoList.GetListFromTransitionSearch(docVersionList, cbxTranFormat.SelectedIndex - 1, cbxTranCategory.SelectedItem.ToString() == "All" ? "" : cbxTranCategory.SelectedItem.ToString(), TypeSearchList);
cmbResultsStyleIndex = 3; // display step text in results
}
else if (tabSearchTypes.SelectedTab == tabSearchTypes.Tabs[4])
{
// C2020-033: Incoming Transitions: Make an iteminfolist from the list returned from
// GetExternalTransitionsToChildren (also gets transitions to the item itself)
ItemInfo trII = SearchIncTransII;
if (trII != null)
{
ReportTitle = string.Format("Search For Incoming Transitions to {0}: ", trII.Path);
TypesSelected = "Filtered By: " + typstr;
using (TransitionInfoList exTrans = TransitionInfoList.GetExternalTransitionsToChildren(trII.ItemID))
{
ItemInfoList iil = null;
bool first = true;
foreach (TransitionInfo ti in exTrans)
{
if (first)
{
ContentInfo ci = ContentInfo.Get(ti.FromID);
ItemInfo tmp = ci.ContentItems[0];
iil = new ItemInfoList(tmp);
first = false;
}
else
{
ContentInfo ci = ContentInfo.Get(ti.FromID);
ItemInfo tmp = ci.ContentItems[0];
iil.AddItem(tmp);
}
}
SearchResults = iil;
if (SearchResults == null || SearchResults.Count == 0)
{
FlexibleMessageBox.Show("No Matches Found.", "Search");
}
cmbResultsStyleIndex = 1; //display step locations in results
}
}
}
if (SearchResults != null)
{
AddMessageForEmptyAnnotations();
@@ -1531,6 +1657,7 @@ namespace Volian.Controls.Library
FlexibleMessageBox.Show("No Matches Found.", "Search");
}
}
btnTranCvtAllToTxt.Enabled = IncTransCvtAllToTextPerm(); // C2020-033: does user have access to at least one item
}
catch (Exception ex)
{
@@ -1556,7 +1683,7 @@ namespace Volian.Controls.Library
bool hasAnnot = false;
foreach (ItemInfo ii in SearchResults)
{
if (ii.ItemAnnotationCount > 0)
if (ii.ItemAnnotations != null && ii.ItemAnnotationCount > 0)
{
// RHM - can an iteminfo have an itemannotationcount>0 and not have searchannotationtext.
if (ii.SearchAnnotationText == null) ii.SearchAnnotationText = AnnotationInfo.Get(ii.ItemAnnotations[0].AnnotationID).SearchText;
@@ -2153,9 +2280,16 @@ namespace Volian.Controls.Library
}
private void btnClearSearchResults_Click(object sender, EventArgs e)
{
lbSrchResults.DataSource = null;
if (tabSearchTypes.SelectedTab == tabIncTrans) // C2020-033: Clear the Incoming Transitions list box
{
lbSrchResultsIncTrans.DataSource = null;
lbSrchResultsIncTrans.Items.Clear();
}
else
lbSrchResults.DataSource = null;
_SearchResults = null;
DisplayResults();
btnTranCvtAllToTxt.Enabled = false;
}
// A timer updated the step type tree but if it was loaded from xml the timer update overwrite what
@@ -2163,6 +2297,7 @@ namespace Volian.Controls.Library
private bool _fromLoad = false;
private void btnLoadSearchResults_Click(object sender, System.EventArgs e)
{
IncTransSelectedCount = 0;
_fromLoad = true;
_LoadingList = true;
ofdSearchResults.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + @"\VEPROMS";
@@ -2290,7 +2425,27 @@ namespace Volian.Controls.Library
break;
}
case 2: //referenced object
case 3: // transitions
{
FlexibleMessageBox.Show(this, "Loading Referenced Objects and Transitions searches is under construction.", "Under Construction", MessageBoxButtons.OK);
break;
}
case 4: // Incoming transitions
{
tabSearchTypes.SelectedTab = tabIncTrans;
cmbResultsStyle.Text = xd.SelectSingleNode("search/results/@style").InnerText;
string tmpi = xd.SelectSingleNode("search/results/@toid").InnerText;
SearchIncTransII = ItemInfo.Get(Convert.ToInt32(tmpi));
System.Xml.XmlNodeList nl = xd.SelectNodes("search/results/item");
foreach (System.Xml.XmlNode nd in nl)
{
int itemID = int.Parse(nd.Attributes.GetNamedItem("id").InnerText);
ItemInfo ii = ItemInfo.Get(itemID);
if (ii.SearchAnnotationText == null && ii.ItemAnnotations != null) ii.SearchAnnotationText = AnnotationInfo.Get(ii.ItemAnnotations[0].AnnotationID).SearchText;
SearchResults.AddItemInfo(ii);
}
lbSrchResultsIncTrans.DataSource = SearchResults;
DisplayResults();
break;
}
}
@@ -2311,12 +2466,14 @@ namespace Volian.Controls.Library
}
Cursor = Cursors.Default;
}
btnTranCvtAllToTxt.Enabled = IncTransCvtAllToTextPerm(); // C2020-033: does user have access to at least one item
_LoadingList = false;
}
private void btnSaveSearchResults_Click(object sender, System.EventArgs e)
{
ICollection<ItemInfo> myList = lbSrchResults.DataSource as ICollection<ItemInfo>;
if (tabSearchTypes.SelectedTab == tabSearchTypes.Tabs[4]) myList = lbSrchResultsIncTrans.DataSource as ICollection<ItemInfo>; // C2020-033: use Incoming transition list
if (tabSearchTypes.SelectedTabIndex == 2 || tabSearchTypes.SelectedTabIndex == 3) // ROs & Transitions are not coded yet
{
FlexibleMessageBox.Show(this, "Saving Referenced Objects and Transitions searches is under construction.", "Under Construction", MessageBoxButtons.OK);
@@ -2342,32 +2499,34 @@ namespace Volian.Controls.Library
// B2020-107: save procedures sets & step types
// do procsets selected
System.Xml.XmlElement xp = null;
if (lstCheckedDocVersions != null && lstCheckedDocVersions.Count > 0)
{
xp = xd.CreateElement("procsets");
foreach (DocVersionInfo dvi in lstCheckedDocVersions)
{
System.Xml.XmlElement xee = xd.CreateElement("set");
xa = xd.CreateAttribute("fid");
xa.InnerText = dvi.MyFolder.FolderID.ToString();
xee.Attributes.SetNamedItem(xa);
xp.AppendChild(xee);
}
}
System.Xml.XmlElement xst = null;
if (lstCheckedStepTypesStr != null && lstCheckedStepTypesStr.Count > 0)
if (sti != 4) // C2020-033: no procsets or step types for Incoming transitions
{
xst = xd.CreateElement("StepType");
foreach (string str in lstCheckedStepTypesStr) // Limited by step types
if (lstCheckedDocVersions != null && lstCheckedDocVersions.Count > 0)
{
System.Xml.XmlElement xee = xd.CreateElement("type");
xa = xd.CreateAttribute("str");
xa.InnerText = str;
xee.Attributes.SetNamedItem(xa);
xst.AppendChild(xee);
xp = xd.CreateElement("procsets");
foreach (DocVersionInfo dvi in lstCheckedDocVersions)
{
System.Xml.XmlElement xee = xd.CreateElement("set");
xa = xd.CreateAttribute("fid");
xa.InnerText = dvi.MyFolder.FolderID.ToString();
xee.Attributes.SetNamedItem(xa);
xp.AppendChild(xee);
}
}
if (lstCheckedStepTypesStr != null && lstCheckedStepTypesStr.Count > 0)
{
xst = xd.CreateElement("StepType");
foreach (string str in lstCheckedStepTypesStr) // Limited by step types
{
System.Xml.XmlElement xee = xd.CreateElement("type");
xa = xd.CreateAttribute("str");
xa.InnerText = str;
xee.Attributes.SetNamedItem(xa);
xst.AppendChild(xee);
}
}
}
switch (sti)
{
case 0: //text
@@ -2439,6 +2598,34 @@ namespace Volian.Controls.Library
xd.Save(sfdSearchResults.FileName);
break;
}
case 2: // ro
case 3: // transitions
{
FlexibleMessageBox.Show(this, "Saving Search Results for this search type is under construction.", "Under Construction", MessageBoxButtons.OK);
break;
}
case 4: // C2020-033: Incoming Transitions
{
// do results
xe = xd.CreateElement("results");
xa = xd.CreateAttribute("style");
xa.InnerText = cmbResultsStyle.Text;
xe.Attributes.SetNamedItem(xa);
xa = xd.CreateAttribute("toid");
xa.InnerText = SearchIncTransII.ItemID.ToString();
xe.Attributes.SetNamedItem(xa);
foreach (ItemInfo ii in myList)
{
System.Xml.XmlElement xee = xd.CreateElement("item");
xa = xd.CreateAttribute("id");
xa.InnerText = ii.ItemID.ToString();
xee.Attributes.SetNamedItem(xa);
xe.AppendChild(xee);
}
xd.DocumentElement.AppendChild(xe);
xd.Save(sfdSearchResults.FileName);
break;
}
}
break;
}
@@ -2470,6 +2657,7 @@ namespace Volian.Controls.Library
private void btnCopySearchResults_Click(object sender, EventArgs e)
{
ICollection<ItemInfo> myList = lbSrchResults.DataSource as ICollection<ItemInfo>;
if (tabSearchTypes.SelectedTab == tabSearchTypes.Tabs[4]) myList = lbSrchResultsIncTrans.DataSource as ICollection<ItemInfo>;
StringBuilder sb = new StringBuilder();
sb.Append("\"Location\"\t\"Type\"\t\"Text\"\t\"High-Level\"\t\"Annotations\"");
List<int> ItemsProcessed = new List<int>();
@@ -2513,18 +2701,188 @@ namespace Volian.Controls.Library
string sortedBy = "";
if (cbSorted.Checked)
sortedBy = string.Format("Sorted By: {0}", cmbResultsStyle.Text); //C2019-013 pass in sorted by information
OnPrintRequest(new DisplaySearchEventArgs(ReportTitle, TypesSelected, SearchString, lbSrchResults.DataSource as ICollection<ItemInfo>,sortedBy));
ICollection<ItemInfo> srchres = lbSrchResults.DataSource as ICollection<ItemInfo>;
// C2020-033: If on the Incoming Transitions tab, use that list.
if (tabSearchTypes.SelectedTab == tabSearchTypes.Tabs[4]) srchres = lbSrchResultsIncTrans.DataSource as ICollection<ItemInfo>;
OnPrintRequest(new DisplaySearchEventArgs(ReportTitle, TypesSelected, SearchString, srchres,sortedBy));
}
private void panSearchButtons_Resize(object sender, EventArgs e)
{
cmbResultsStyle.Left = labelX1.Right + 3;
cmbResultsStyle.Width = btnClearSearchResults.Left - cmbResultsStyle.Left - 3;
}
// C2020-033: Convert All (that have permissions) Incoming Transitions to text
private void btnTranCvtAllToTxt_Click(object sender, EventArgs e)
{
List<int> itmsEditable = TranCvtCheckPermission(true); // Get list based on permissions
if (itmsEditable == null || itmsEditable.Count == 0) return;
TranCvtToTxt(itmsEditable);
}
// C22020-033: Use IncTransCvtAllToTextPerm to see if user has at least edit permissions to 1 in list. This
// is used to see if Convert All button is enabled.
private bool IncTransCvtAllToTextPerm()
{
if (_SearchResults == null) return false;
int cnt = 0;
bool allowNonAdmin = IncTranCvtPerm();
foreach (ItemInfo ii in _SearchResults)
{
if (allowNonAdmin || UserInfo.CanEdit(MyUserInfo, ii.MyDocVersion)) return true;
}
return false;
}
// C2020-033: Update the search panel for Incoming transitions. This gets called from the tree view & the ribbon
public void UpdateSearchIncTransResults()
{
IncTransSelectedCount = 0;
tabSearchTypes.SelectedTab = tabSearchTypes.Tabs[4];
lbSrchResultsIncTrans.DataSource = null;
lbSrchResultsIncTrans.Items.Clear();
// Get item to do search for, either from tree or from editor
ItemInfo trII = SearchIncTransII;
if (trII != null)
{
ReportTitle = string.Format("Search For Incoming Transitions to {0}: ", trII.Path);
using (TransitionInfoList exTrans = TransitionInfoList.GetExternalTransitionsToChildren(trII.ItemID))
{
ItemInfoList iil = null;
bool first = true;
foreach (TransitionInfo ti in exTrans)
{
if (first)
{
ContentInfo ci = ContentInfo.Get(ti.FromID);
ItemInfo tmp = ci.ContentItems[0];
iil = new ItemInfoList(tmp);
first = false;
}
else
{
ContentInfo ci = ContentInfo.Get(ti.FromID);
ItemInfo tmp = ci.ContentItems[0];
iil.AddItem(tmp);
}
}
SearchResults = iil;
}
}
if (SearchResults != null && SearchResults.Count > 0)
{
AddMessageForEmptyAnnotations();
cmbResultsStyle.SelectedIndex = 1; //display step locations in results
DisplayResults();
}
else
{
btnPrnSrchRslts.Enabled = false;
btnClearSearchResults.Enabled = false;
btnCopySearchResults.Enabled = false;
btnSaveSearchResults.Enabled = false;
cmbResultsStyle.Enabled = false;
FlexibleMessageBox.Show("No Matches Found.", "Search");
}
btnTranCvtAllToTxt.Enabled = IncTransCvtAllToTextPerm();
btnTranCvtSelToTxt.Enabled = false;
}
public bool IncTranCvtPerm()
{
FolderInfo topFolder = FolderInfo.Get(1);
FolderConfig fc = topFolder.MyConfig as FolderConfig;
return fc.General_IncTranCvtPerm;
}
// C2020-033: Before allowing conversion of Incoming Transitions to text, get list of results that the user has permission edit.
private List<int> TranCvtCheckPermission(bool all)
{
// check if a non-reader can convert transitions to text even if a reader - this is set by an administrator on the top
// folder properties dialog
bool allowNonAdmin = IncTranCvtPerm();
List<int> itmsEditable = new List<int>(); // return this list
int listCount = 0;
if (all) // Check all in list
{
listCount = _SearchResults.Count;
foreach (ItemInfo ii in _SearchResults)
{
if (allowNonAdmin || UserInfo.CanEdit(MyUserInfo, ii.MyDocVersion)) itmsEditable.Add(ii.ContentID);
}
}
else // check only the items selected
{
listCount = lbSrchResultsIncTrans.CheckedItems.Count;
List<ListBoxItem> lbis = lbSrchResultsIncTrans.CheckedItems;
foreach (ListBoxItem lbi in lbis)
{
ItemBindingData tmpii = lbi.Tag as ItemBindingData;
ItemInfo ii = tmpii.DataItem as ItemInfo;
if (allowNonAdmin || UserInfo.CanEdit(MyUserInfo, ii.MyDocVersion)) itmsEditable.Add(ii.ContentID);
}
}
// Prompt user if convert to text should continue. If some items cannot be edited, also state that
// not all can be converted to text. If count of itmsEditable & lbis are different some cannot be edited.
if (itmsEditable.Count == 0)
{
FlexibleMessageBox.Show("You do not have permission to edit any of the procedures, sections, and/or steps" + (all ? "." : " that are selected."),
"Convert Transition to Text", MessageBoxButtons.OK, MessageBoxIcon.Information);
return null;
}
else if (itmsEditable.Count != listCount)
{
DialogResult ans = FlexibleMessageBox.Show("You only have permission to edit some of the procedures, sections, and/or steps that are selected.procedures, sections, and/or steps" + (all ? "." : " that are selected.") +
"\r\n\r\n Should the conversion of the transitions to text continue?",
"Convert Transition to Text", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (ans == DialogResult.No) return null;
}
else
{
DialogResult ans = FlexibleMessageBox.Show("Are you sure you want to convert the transitions to text?",
"Convert Transition to Text", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (ans == DialogResult.No) return null;
}
return itmsEditable;
}
// C2020-033: convert selected transitions to text
private void btnTranCvtSelToTxt_Click(object sender, EventArgs e)
{
// First see if all selected can be converted, i.e. user has permission to edit
List<ListBoxItem> lbis = lbSrchResultsIncTrans.CheckedItems;
List<int> itmsEditable = TranCvtCheckPermission(false);
if (itmsEditable == null || itmsEditable.Count == 0) return;
TranCvtToTxt(itmsEditable);
}
// C2020-033: For items in list, do the actual conversion of the Incoming Transition to text
private void TranCvtToTxt(List<int> itmsEditable)
{
ItemInfo trII = SearchIncTransII;
if (trII != null)
{
using (TransitionInfoList exTrans = TransitionInfoList.GetExternalTransitionsToChildren(trII.ItemID))
{
foreach (TransitionInfo ti in exTrans)
{
// See if the 'item to' id is to be converted and if so do it. To figure this out,
// see if it is in the list itmsEditable.
if (itmsEditable.Contains(ti.FromID))
{
ContentInfo ci = ContentInfo.Get(ti.FromID);
ItemInfo tmp = ci.ContentItems[0];
using (Content content = Content.Get(tmp.ContentID))
{
content.FixTransitionText(ti, true);
content.Save();
}
}
}
}
}
}
}
#region Annoation Search Type Class
// this class is used to generate the list of annotations to search.
// this also allow us to add a dummy type which is used to search for all annotations
public class AnnotationTypeSearch
#region Annoation Search Type Class
// this class is used to generate the list of annotations to search.
// this also allow us to add a dummy type which is used to search for all annotations
public class AnnotationTypeSearch
{
private string _Name;
public string Name

View File

@@ -13,6 +13,7 @@ using Volian.Base.Library;
namespace Volian.Controls.Library
{
public delegate ItemInfo DisplayTabControlEditorSearchIncTransEvent(object sender, vlnTreeItemInfoEventArgs args);
public delegate void DisplayTabControlEvent(object sender,EventArgs args);
public delegate void DisplayTabControlStatusEvent(object sender, DisplayTabControlStatusEventArgs args);
public partial class DisplayTabControlStatusEventArgs : EventArgs
@@ -150,6 +151,13 @@ namespace Volian.Controls.Library
if (OpenInSeparateWindow != null)
OpenInSeparateWindow(this, args);
}
// C2020-033: Provide way to expand/fill in Search/Incoming Transition panel
public event DisplayTabControlEditorSearchIncTransEvent SearchIncTrans;
public ItemInfo OnSearchIncTrans(object sender, vlnTreeItemInfoEventArgs args)
{
if (SearchIncTrans != null) return SearchIncTrans(sender, args);
return args.MyItemInfo;
}
public event ItemSelectedChangedEvent RefreshEnhancedDocument;
public void OnRefreshEnhancedDocument(ItemSelectedChangedEventArgs args)
{

View File

@@ -1030,114 +1030,51 @@ namespace Volian.Controls.Library
private void HandleSqlExceptionOnDelete(Exception ex)
{
// C2020-018 made the messaging consistent in the message boxes
// C2020-033: Expand/fill in the Search/Incoming Transition panel. Also, the dialog message was changed
// to give message to view panel and eliminate list in the dialog. This is done for each of cases.
if (ex.Message.Contains("has External Transitions and has no next step"))
{
MyStepPanel.MyStepTabPanel.MyDisplayTabControl.OnSearchIncTrans(this, new vlnTreeItemInfoEventArgs(MyStepRTB.MyItemInfo));
using (TransitionInfoList exTrans = TransitionInfoList.GetExternalTransitionsToChildren(MyID)) // B2020-109: look at substeps too
{
DialogResult ans = FlexibleMessageBox.Show("Transitions exist to this step and cannot be adjusted automatically." +
"\r\n\r\nDo you want to be placed at the " + (exTrans.Count > 1 ? "first " : "") + "location with the problem Transition?" +
"\r\n\r\nLocations with Problem Transitions" +
exTrans.Summarize(),
"Cannot Delete This Step", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (ans == DialogResult.Yes)
{
if (MyStepRTB.Text == "")
{
this.MyStepRTB.InsertSymbol(@"\u160?"); // since text was deleted, insert a hard space to prevent a looping effect B2016-082
using (Item itm = MyStepRTB.MyItemInfo.Get())
{
Annotation x = Annotation.MakeAnnotation(itm, AnnotationType.GetByName("Verification Required"), null, "A Hard Space was put in to keep the Transitions referencing here valid. \nPlease remove or re-assign these transitions before deleting this step.", null);
}
}
MyStepPanel.MyStepTabPanel.MyDisplayTabControl.OpenItem(exTrans[0].MyContent.ContentItems[0]);
}
else
SetFocus();
"\r\n\r\nThe list of all locations are shown in the Tools/Search/Incoming Transitions tab.",
"Cannot Delete This Step", MessageBoxButtons.OK, MessageBoxIcon.Information);
SetFocus();
}
}
else if (ex.Message.Contains("has External Transitions to Procedure"))
{
MyStepPanel.MyStepTabPanel.MyDisplayTabControl.OnSearchIncTrans(this, new vlnTreeItemInfoEventArgs(MyStepRTB.MyItemInfo));
using (TransitionInfoList exTrans = TransitionInfoList.GetExternalTransitionsToChildren(MyID))
{
DialogResult ans = FlexibleMessageBox.Show("Transitions exist to this procedure." +
"\r\n\r\nDo you want to be placed at the " + (exTrans.Count > 1 ? "first " : "") + "location with the problem Transition?" +
"\r\n\r\nLocations with Problem Transitions" +
exTrans.Summarize(),
"Cannot Delete This Procedure", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (ans == DialogResult.Yes)
{
if (MyStepRTB.Text == "")
{
this.MyStepRTB.InsertSymbol(@"\u160?"); // since text was deleted, insert a hard space to prevent a looping effect B2016-082
using (Item itm = MyStepRTB.MyItemInfo.Get())
{
Annotation x = Annotation.MakeAnnotation(itm, AnnotationType.GetByName("Verification Required"), null, "A Hard Space was put in to keep the Transitions referencing here valid. \nPlease remove or re-assign these transitions before deleting this step.", null);
}
}
MyStepPanel.MyStepTabPanel.MyDisplayTabControl.OpenItem(exTrans[0].MyContent.ContentItems[0]);
}
else
SetFocus();
"\r\n\r\nThe list of all locations are shown in the Tools/Search/Incoming Transitions tab.",
"Cannot Delete This Procedure", MessageBoxButtons.OK, MessageBoxIcon.Information);
SetFocus();
}
}
// B2020-097: If deleting a section that has transitions pointing to it, show list:
// B2020-098: If deleting a section that has transitions & select to remove 1st transition, crash on trying to delete section again
else if (ex.Message.Contains("has External Transitions to Section"))
{
MyStepPanel.MyStepTabPanel.MyDisplayTabControl.OnSearchIncTrans(this, new vlnTreeItemInfoEventArgs(MyStepRTB.MyItemInfo));
using (TransitionInfoList exTrans = TransitionInfoList.GetExternalTransitionsToChildren(MyID))
{
DialogResult ans = FlexibleMessageBox.Show("Transitions exist to this section and cannot be adjusted automatically." +
"\r\n\r\nDo you want to be placed at the " + (exTrans.Count > 1 ? "first " : "") + "location with the problem Transition?" +
"\r\n\r\nLocations with Problem Transitions" +
exTrans.Summarize(),
"Cannot Delete This Section", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (ans == DialogResult.Yes)
{
if (MyStepRTB.Text == "")
{
this.MyStepRTB.InsertSymbol(@"\u160?"); // since text was deleted, insert a hard space to prevent a looping effect B2016-082
using (Item itm = MyStepRTB.MyItemInfo.Get())
{
Annotation x = Annotation.MakeAnnotation(itm, AnnotationType.GetByName("Verification Required"), null, "A Hard Space was put in to keep the Transitions referencing here valid. \nPlease remove or re-assign these transitions before deleting this step.", null);
}
}
MyStepPanel.SelectedEditItem = this;
MyStepPanel.MyStepTabPanel.MyDisplayTabControl.OpenItem(exTrans[0].MyContent.ContentItems[0]);
}
else
MyStepPanel.SelectedEditItem = this;
"\r\n\r\nThe list of all locations are shown in the Tools/Search/Incoming Transitions tab.",
"Cannot Delete This Section", MessageBoxButtons.OK, MessageBoxIcon.Information);
MyStepPanel.SelectedEditItem = this;
}
}
else if (ex.Message.Contains("has External Transitions to it's children"))
{
MyStepPanel.MyStepTabPanel.MyDisplayTabControl.OnSearchIncTrans(this, new vlnTreeItemInfoEventArgs(MyStepRTB.MyItemInfo));
using (TransitionInfoList exTrans = TransitionInfoList.GetExternalTransitionsToChildren(MyID))
{
//DialogResult ans = FlexibleMessageBox.Show("Transitions exist to substeps of this step and cannot be adjusted automatically." +
// "\r\n\r\nDo you want to be placed on the " + (exTrans.Count > 1 ? "first " : "") + "substep with the problem Transition?" +
// "\r\n\r\nLocations with Problem Transitions:" +
// exTrans.Summarize(),
// "Cannot Delete This Step", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
DialogResult ans = FlexibleMessageBox.Show("Transitions exist to the substeps of this step and cannot be adjusted automatically." +
"\r\n\r\nDo you want to be placed at the " + (exTrans.Count > 1 ? "first " : "") + "location with the problem Transition?" +
"\r\n\r\nLocations with Problem Transitions:" +
exTrans.Summarize(),
"Cannot Delete This Step", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (ans == DialogResult.Yes)
{
// B2017-182: The following code was moved from top of this method to here (and to each if/else case and only done if the text was removed,
// not when the step was deleted)
if (MyStepRTB.Text == "")
{
this.MyStepRTB.InsertSymbol(@"\u160?"); // since text was deleted, insert a hard space to prevent a looping effect B2016-082
using (Item itm = MyStepRTB.MyItemInfo.Get())
{
Annotation x = Annotation.MakeAnnotation(itm, AnnotationType.GetByName("Verification Required"), null, "A Hard Space was put in to keep the Transitions referencing here valid. \nPlease remove or re-assign these transitions before deleting this step.", null);
}
}
MyStepPanel.MyStepTabPanel.MyDisplayTabControl.OpenItem(exTrans[0].MyContent.ContentItems[0]);
}
else
"\r\n\r\nThe list of all locations are shown in the Tools/Search/Incoming Transitions tab.",
"Cannot Delete This Step", MessageBoxButtons.OK, MessageBoxIcon.Information);
SetFocus();
}
}

View File

@@ -19,7 +19,7 @@ namespace Volian.Controls.Library.Properties {
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
@@ -270,6 +270,16 @@ namespace Volian.Controls.Library.Properties {
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap ChkRef {
get {
object obj = ResourceManager.GetObject("ChkRef", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>

View File

@@ -2031,22 +2031,30 @@
</data>
<data name="DecreaseFontSize_16x" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAADySURBVDhP1VGrDoMwFO0n7A/Gt+BRUzgEyczEND9BsEt9
JQI1NTE9h189ooIAsutpLlDIumEmdpKTnN4X53LZT9H3fWmoiSWFl3AKFlRK7Zqm0WEYWkIjRm0zTLHa
H4VmB24JjdgwDElVVdMAaMSobUbXdefrQ04DoBEzQ8osy6YB0IhR2xKm4Xa63DUI7dpP01THcWy1dw1j
LYBtsh649oUQuigKq71rrOHal1Lquq6t/rjGCNd+FEWac26JN+hdY4Rr/x2/rrG2b96Wm9aANRTDOv5+
27ZPSjFoXAM51PiukYxfJOaUgrPczW26xj+AsRf1SGVLeHvqDQAAAABJRU5ErkJggg==
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
wwAADsMBx2+oZAAAAPJJREFUOE/VUasOgzAU7SfsD8a34FFTOATJzMQ0P0GwS30lAjU1MT2HXz2iggCy
62kuUMi6YSZ2kpOc3hfnctlP0fd9aaiJJYWXcAoWVErtmqbRYRhaQiNGbTNMsdofhWYHbgmN2DAMSVVV
0wBoxKhtRtd15+tDTgOgETNDyizLpgHQiFHbEqbhdrrcNQjt2k/TVMdxbLV3DWMtgG2yHrj2hRC6KAqr
vWus4dqXUuq6rq3+uMYI134URZpzbok36F1jhGv/Hb+usbZv3pab1oA1FMM6/n7btk9KMWhcAznU+K6R
jF8k5pSCs9zNbbrGP4CxF/VIZUt4e+oNAAAAAElFTkSuQmCC
</value>
</data>
<data name="IncreaseFontSize_16x" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
wwAADsMBx2+oZAAAAO9JREFUOE+1UTEOgkAQvCf4BF/gI+hJTPyATzCW2PMKW0tjQY+tvsAXWFFcBZTn
zbF7LOtBYeIkkwyzsMzcmb/CWrvqus5JwqPxiL7v135oQWiy4e/runZZlgVCw6PxiLZt76fL04HQZBu/
8FaWZVwADY/GA/wHh8fr7czuHAgNj+PneR4XQMOb1EDszfEaF0DD0/GZXzWwcYYxflEUgdDJGhq+whZL
OH5VVYHQyRoaOn7TNIH8PHsbDBk/xcUaqdPXXKyh4+NFSfZna/iXJqePZxqF2eJt6Pg4efkXaH0bNBqA
F2BKyp78A0ka/QpjPuRAtoD1VSrCAAAAAElFTkSuQmCC
</value>
</data>
<data name="ChkRef" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAADvSURBVDhPtVExDoJAELwn+ARf4CPoSUz8gE8wltjzCltL
Y0GPrb7AF1hRXAWU582xeyzrQWHiJJMMs7DM3Jm/wlq76rrOScKj8Yi+79d+aEFosuHv67p2WZYFQsOj
8Yi2be+ny9OB0GQbv/BWlmVcAA2PxgP8B4fH6+3M7hwIDY/j53keF0DDm9RA7M3xGhdAw9PxmV81sHGG
MX5RFIHQyRoavsIWSzh+VVWB0MkaGjp+0zSB/Dx7GwwZP8XFGqnT11ysoePjRUn2Z2v4lyanj2cahdni
bej4OHn5F2h9GzQagBdgSsqe/ANJGv0KYz7kQLaA9VUqwgAAAABJRU5ErkJggg==
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAACASURBVDhPtY9LDoAgDAU5kmfgcOw5oUdgAWGLvqSNoJRv
nKQxKDOp6ldCCEeM0d2TakPX6rBsjEla6880Az0ZIwakta21Y4EcxLz3J2+Sb9QNvH8DT0hDAUnmAJ0d
XS8RZEfvizMpDy0Z3xFYlsGWDLZkkTwwLTMcWZIZiPOyUhdBN2onEKujgwAAAABJRU5ErkJggg==
</value>
</data>
</root>

View File

@@ -838,9 +838,10 @@ namespace Volian.Controls.Library
void _MyStepRTB_SelectionChanged(object sender, EventArgs e)
{
if (_MyStepRTB == null) return;
_TimeActivity.Open();
//B2019-154 This will prevent duplicate processing of the ribbon menu and refresh of step items, speeding up the editing experience
if (_MyStepRTB.MyItemInfo == lastItem && _MyStepRTB.SelectionStart == lastStart && _MyStepRTB.SelectionLength == lastLength && _MyStepRTB.SelectedText == lastText)
if (_MyStepRTB != null && _MyStepRTB.MyItemInfo == lastItem && _MyStepRTB.SelectionStart == lastStart && _MyStepRTB.SelectionLength == lastLength && _MyStepRTB.SelectedText == lastText)
return;
lastItem = _MyStepRTB.MyItemInfo;
lastStart = _MyStepRTB.SelectionStart;
@@ -3333,7 +3334,11 @@ namespace Volian.Controls.Library
StepPanelTabDisplayEventArgs args = new StepPanelTabDisplayEventArgs("LibDocs");
MyEditItem.MyStepPanel.OnTabDisplay(sender, args);
}
// C2020-033: Support the Review/Incoming Transition button to bring up Search/Incoming Transitions panel
private void btnSearchIncTrans_Click(object sender, EventArgs e)
{
MyEditItem.MyStepPanel.MyStepTabPanel.MyDisplayTabControl.OnSearchIncTrans(this, new vlnTreeItemInfoEventArgs(MyStepRTB.MyItemInfo));
}
public void btnAnnots_Click(object sender, EventArgs e)
{
StepPanelTabDisplayEventArgs args = new StepPanelTabDisplayEventArgs("Annots");

View File

@@ -36,6 +36,7 @@ namespace Volian.Controls.Library
public delegate void WordSectionDeletedEvent(object sender, WordSectionEventArgs args);
public delegate void vlnTreeViewPdfEvent(object sender, vlnTreeViewPdfArgs args);
public delegate string vlnTreeViewGetChangeIdEvent(object sender, vlnTreeItemInfoEventArgs args);
public delegate ItemInfo vlnTreeViewSearchIncTransEvent(object sender, vlnTreeItemInfoEventArgs args);
public partial class vlnTreeSectionInfoEventArgs
{
private bool _IsDeleting = false;
@@ -443,13 +444,13 @@ namespace Volian.Controls.Library
{
if (NodeMove != null) NodeMove(sender, args);
}
public event vlnTreeViewClipboardStatusEvent ClipboardStatus;
private ItemInfo OnClipboardStatus(object sender, vlnTreeEventArgs args)
{
ItemInfo rv = null;
if (ClipboardStatus != null) rv = ClipboardStatus(sender, args);
return rv;
}
public event vlnTreeViewClipboardStatusEvent ClipboardStatus;
private ItemInfo OnClipboardStatus(object sender, vlnTreeEventArgs args)
{
ItemInfo rv = null;
if (ClipboardStatus != null) rv = ClipboardStatus(sender, args);
return rv;
}
public event vlnTreeViewEvent NodeCopy;
private void OnNodeCopy(object sender, vlnTreeEventArgs args)
{
@@ -467,6 +468,13 @@ namespace Volian.Controls.Library
if (NodePSI != null) return NodePSI(sender, args);
return DialogResult.Cancel;
}
// C2020-033: Support the menu item to bring up Search/Incoming Transitions panel
public event vlnTreeViewSearchIncTransEvent SearchIncTrans;
private ItemInfo OnSearchIncTransIn(object sender, vlnTreeItemInfoEventArgs args)
{
if (SearchIncTrans != null) return SearchIncTrans(sender, args);
return args.MyItemInfo;
}
public event vlnTreeViewSIEvent NodeSI;
private DialogResult OnNodeSI(object sender, vlnTreeEventArgs args)
{
@@ -1003,12 +1011,19 @@ namespace Volian.Controls.Library
}
#endregion
//_MyLog.WarnFormat("Context Menu 6 - {0}", GC.GetTotalMemory(true));
#region Menu_ExternalTransitions
// C2020-033: Support the menu item to bring up Search/Incoming Transitions panel
ItemInfo iix = tn.VEObject as ItemInfo;
if (iix != null)
{
cm.MenuItems.Add("Incoming Transitions", new EventHandler(mi_Click));
}
#endregion
#region Menu_Properties
// Add Properties to the menu unless at the very 'top' node or on a grouping (partinfo)
// node (RNOs, Steps, Cautions, Notes) or at the step level.
// B2020-105 Allow Set Administrators to rename folder's (sets of procedures) to which they have been given access.
if( tn.VEObject is FolderInfo) ok = (ui.IsAdministrator() || ui.IsSetAdministrator(tn.VEObject as FolderInfo));
if ( tn.VEObject is FolderInfo) ok = (ui.IsAdministrator() || ui.IsSetAdministrator(tn.VEObject as FolderInfo));
else ok = (tn.VEObject is DocVersionInfo) ? (ui.IsAdministrator() || ui.IsSetAdministrator(tn.VEObject as DocVersionInfo))
: (ui.IsAdministrator() || (tn.VEObject is ItemInfo) && (ui.IsSetAdministrator((tn.VEObject as ItemInfo).MyProcedure.MyDocVersion)
|| ui.IsWriter((tn.VEObject as ItemInfo).MyProcedure.MyDocVersion)));
@@ -1782,6 +1797,11 @@ namespace Volian.Controls.Library
OnNodeSelect(this, new vlnTreeEventArgs(SelectedNode));
}
break;
case "Incoming Transitions": // C2020-033: Support the menu item to bring up Search/Incoming Transitions panel
VETreeNode tnx = SelectedNode as VETreeNode;
ItemInfo iii = tnx.VEObject as ItemInfo;
if (iii != null) OnSearchIncTransIn(this, new vlnTreeItemInfoEventArgs(iii));
break;
case "Properties..."://Show the properties for the selected node
SetLastValues((VETreeNode)SelectedNode);
SetupNodeProperties();
@@ -3257,8 +3277,18 @@ namespace Volian.Controls.Library
{
OnProcessing(false,"Delete Failed");
OnProcessingComplete(dtStart,"Delete Failed");
ItemInfo iii = ii.HandleSqlExceptionOnDelete(ex);
if(iii != null) OnOpenItem(this, new vlnTreeItemInfoEventArgs(iii));
// C2020-033: Support delete to bring up Search/Incoming Transitions panel
if (ex.Message.Contains("has External Transitions"))
{
ItemInfo iis = ItemInfo.Get(ii.ItemID);
OnSearchIncTransIn(this, new vlnTreeItemInfoEventArgs(iis));
iis = ii.HandleSqlExceptionOnDelete(ex);
}
else
{
ItemInfo iii = ii.HandleSqlExceptionOnDelete(ex);
if (iii != null) OnOpenItem(this, new vlnTreeItemInfoEventArgs(iii));
}
return false;
}
}