This commit is contained in:
@@ -478,15 +478,20 @@ namespace Volian.Controls.Library
|
||||
|
||||
private void cbxTextSearchAnnotation_Leave(object sender, EventArgs e)
|
||||
{
|
||||
if (!cbxTextSearchAnnotation.Text.Equals(string.Empty))
|
||||
{
|
||||
string tstr = cbxTextSearchAnnotation.Text;
|
||||
if (!cbxTextSearchAnnotation.Items.Contains(tstr))
|
||||
cbxTextSearchAnnotation.Items.Add(tstr);
|
||||
}
|
||||
InsertAnnotationSearchCriteria();
|
||||
|
||||
}
|
||||
|
||||
private void InsertAnnotationSearchCriteria()
|
||||
{
|
||||
if (!cbxTextSearchAnnotation.Text.Equals(string.Empty))
|
||||
{
|
||||
string tstr = cbxTextSearchAnnotation.Text;
|
||||
if (!cbxTextSearchAnnotation.Items.Contains(tstr))
|
||||
cbxTextSearchAnnotation.Items.Insert(0, tstr);
|
||||
}
|
||||
}
|
||||
|
||||
private void gpSrchAnnoText_EnabledChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (gpSrchAnnoText.Enabled)
|
||||
@@ -768,88 +773,105 @@ namespace Volian.Controls.Library
|
||||
|
||||
private void btnSearch_Click(object sender, EventArgs e)
|
||||
{
|
||||
string[] strSearchText = null;
|
||||
lbSrchResults.DataSource = null;
|
||||
lbSrchResults.Items.Clear();
|
||||
toolTip1.SetToolTip(lbSrchResults, null);
|
||||
Cursor savcursor = Cursor;
|
||||
try
|
||||
{
|
||||
string[] strSearchText = null;
|
||||
lbSrchResults.DataSource = null;
|
||||
lbSrchResults.Items.Clear();
|
||||
toolTip1.SetToolTip(lbSrchResults, null);
|
||||
|
||||
strSearchText = BuildSearchString();
|
||||
Cursor savcursor = Cursor;
|
||||
Cursor = Cursors.WaitCursor;
|
||||
SearchResults = null;
|
||||
bool includeRTFformat = false;
|
||||
bool includeSpecialChars = true;
|
||||
if (tabSearchTypes.SelectedTab == tabSearchTypes.Tabs[0]) // Text Search
|
||||
{
|
||||
if (cbxSrchTypeUsage.Checked) // find just the usage of the selected types
|
||||
{
|
||||
if (lstCheckedStepTypes.Count ==0)
|
||||
{
|
||||
MessageBox.Show("Please select one or more types then press the Search button", "No Types Selected");
|
||||
xpStepTypes.Expanded = true;
|
||||
advTreeStepTypes.Focus();
|
||||
xpStepTypes.TitleStyle.BackColor1.Color = Color.Crimson;
|
||||
}
|
||||
else
|
||||
{
|
||||
SearchResults = ItemInfoList.GetListFromTextSearch(strSearchText[0], strSearchText[1], "", cbxCaseSensitive.Checked, ItemSearchIncludeLinks.Value, includeRTFformat, includeSpecialChars);
|
||||
cmbResultsStyle.SelectedIndex = 1; //display step locations in results
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (strSearchText[2].Equals(""))
|
||||
{
|
||||
MessageBox.Show("Please enter some search text, then click the Search button", "No Search Text");
|
||||
cbxTextSearchText.Focus();
|
||||
}
|
||||
else
|
||||
{
|
||||
SearchResults = ItemInfoList.GetListFromTextSearch(strSearchText[0], strSearchText[1], strSearchText[2], cbxCaseSensitive.Checked, cbxIncROTextSrch.Checked ? ItemSearchIncludeLinks.Value : ItemSearchIncludeLinks.Nothing, includeRTFformat, includeSpecialChars);
|
||||
cmbResultsStyle.SelectedIndex = 3; // display step text in results
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (tabSearchTypes.SelectedTab == tabSearchTypes.Tabs[1]) // Annotation Search
|
||||
{
|
||||
//string srchStr = ConvertSpecialChars(cbxTextSearchAnnotation.Text);//cbxTextSearchAnnotation.Text;
|
||||
strSearchText = BuildSearchString();
|
||||
Cursor = Cursors.WaitCursor;
|
||||
SearchResults = null;
|
||||
bool includeRTFformat = false;
|
||||
bool includeSpecialChars = true;
|
||||
if (tabSearchTypes.SelectedTab == tabSearchTypes.Tabs[0]) // Text Search
|
||||
{
|
||||
if (cbxSrchTypeUsage.Checked) // find just the usage of the selected types
|
||||
{
|
||||
if (lstCheckedStepTypes.Count == 0)
|
||||
{
|
||||
MessageBox.Show("Please select one or more types then press the Search button", "No Types Selected");
|
||||
xpStepTypes.Expanded = true;
|
||||
advTreeStepTypes.Focus();
|
||||
xpStepTypes.TitleStyle.BackColor1.Color = Color.Crimson;
|
||||
}
|
||||
else
|
||||
{
|
||||
SearchResults = ItemInfoList.GetListFromTextSearch(strSearchText[0], strSearchText[1], "", cbxBooleanTxtSrch.Checked ? 2 : cbxCaseSensitive.Checked ? 1 : 0, ItemSearchIncludeLinks.Value, includeRTFformat, includeSpecialChars);
|
||||
cmbResultsStyle.SelectedIndex = 1; //display step locations in results
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (strSearchText[2].Equals(""))
|
||||
{
|
||||
MessageBox.Show("Please enter some search text, then click the Search button", "No Search Text");
|
||||
cbxTextSearchText.Focus();
|
||||
}
|
||||
else
|
||||
{
|
||||
SearchResults = ItemInfoList.GetListFromTextSearch(strSearchText[0], strSearchText[1], strSearchText[2], cbxBooleanTxtSrch.Checked ? 2 : cbxCaseSensitive.Checked ? 1 : 0, cbxIncROTextSrch.Checked ? ItemSearchIncludeLinks.Value : ItemSearchIncludeLinks.Nothing, includeRTFformat, includeSpecialChars);
|
||||
cmbResultsStyle.SelectedIndex = 3; // display step text in results
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (tabSearchTypes.SelectedTab == tabSearchTypes.Tabs[1]) // Annotation Search
|
||||
{
|
||||
//string srchStr = ConvertSpecialChars(cbxTextSearchAnnotation.Text);//cbxTextSearchAnnotation.Text;
|
||||
|
||||
//SearchResults = ItemInfoList.GetListFromAnnotationSearch(strSearchText[0], strSearchText[1], strSearchText[2], srchStr, cbxCaseSensitiveAnnoText.Checked);
|
||||
SearchResults = ItemInfoList.GetListFromAnnotationSearch(strSearchText[0], strSearchText[1], strSearchText[2], cbxTextSearchAnnotation.Text, cbxCaseSensitiveAnnoText.Checked);
|
||||
//UpdateAnnotationSearchResults();
|
||||
cmbResultsStyle.SelectedIndex = 2; // display annotation text in results
|
||||
}
|
||||
else if (tabSearchTypes.SelectedTab == tabSearchTypes.Tabs[2]) // RO Search
|
||||
{
|
||||
if (cbxFndUnLnkROVals.Enabled && cbxFndUnLnkROVals.Checked)
|
||||
{
|
||||
SearchResults = ItemInfoList.GetListFromTextSearch(strSearchText[0], strSearchText[1], strSearchText[2], cbxCaseSensitive.Checked, ItemSearchIncludeLinks.Nothing, includeRTFformat, includeSpecialChars);
|
||||
cmbResultsStyle.SelectedIndex = 3; // display step text in results
|
||||
}
|
||||
else
|
||||
{
|
||||
SearchResults = ItemInfoList.GetListFromROSearch(strSearchText[0], strSearchText[1], strSearchText[2]);
|
||||
cmbResultsStyle.SelectedIndex = 3; // display step text in results
|
||||
}
|
||||
}
|
||||
DisplayResults();
|
||||
Cursor = savcursor;
|
||||
if (SearchResults != null && SearchResults.Count == 0)
|
||||
{
|
||||
MessageBox.Show("No Matches Found.", "Search");
|
||||
}
|
||||
}
|
||||
//SearchResults = ItemInfoList.GetListFromAnnotationSearch(strSearchText[0], strSearchText[1], strSearchText[2], srchStr, cbxCaseSensitiveAnnoText.Checked);
|
||||
SearchResults = ItemInfoList.GetListFromAnnotationSearch(strSearchText[0], strSearchText[1], strSearchText[2], cbxTextSearchAnnotation.Text, cbxCaseSensitiveAnnoText.Checked);
|
||||
//UpdateAnnotationSearchResults();
|
||||
cmbResultsStyle.SelectedIndex = 2; // display annotation text in results
|
||||
}
|
||||
else if (tabSearchTypes.SelectedTab == tabSearchTypes.Tabs[2]) // RO Search
|
||||
{
|
||||
if (cbxFndUnLnkROVals.Enabled && cbxFndUnLnkROVals.Checked)
|
||||
{
|
||||
SearchResults = ItemInfoList.GetListFromTextSearch(strSearchText[0], strSearchText[1], strSearchText[2], cbxBooleanTxtSrch.Checked ? 2 : cbxCaseSensitive.Checked ? 1 : 0, ItemSearchIncludeLinks.Nothing, includeRTFformat, includeSpecialChars);
|
||||
cmbResultsStyle.SelectedIndex = 3; // display step text in results
|
||||
}
|
||||
else
|
||||
{
|
||||
SearchResults = ItemInfoList.GetListFromROSearch(strSearchText[0], strSearchText[1], strSearchText[2]);
|
||||
cmbResultsStyle.SelectedIndex = 3; // display step text in results
|
||||
}
|
||||
}
|
||||
DisplayResults();
|
||||
if (SearchResults != null && SearchResults.Count == 0)
|
||||
{
|
||||
MessageBox.Show("No Matches Found.", "Search");
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
while (ex.InnerException != null)
|
||||
ex = ex.InnerException;
|
||||
MessageBox.Show(ex.Message, "Search Error: " + ex.GetType().Name);
|
||||
}
|
||||
finally
|
||||
{
|
||||
Cursor = savcursor;
|
||||
}
|
||||
}
|
||||
|
||||
private void cbxTextSearchText_Leave(object sender, EventArgs e)
|
||||
{
|
||||
if (!cbxTextSearchText.Text.Equals(string.Empty))
|
||||
{
|
||||
string tstr = cbxTextSearchText.Text;
|
||||
if (!cbxTextSearchText.Items.Contains(tstr))
|
||||
cbxTextSearchText.Items.Add(tstr);
|
||||
}
|
||||
InsertSearchCriteria();
|
||||
}
|
||||
|
||||
private void InsertSearchCriteria()
|
||||
{
|
||||
if (!cbxTextSearchText.Text.Equals(string.Empty))
|
||||
{
|
||||
string tstr = cbxTextSearchText.Text;
|
||||
if (!cbxTextSearchText.Items.Contains(tstr))
|
||||
cbxTextSearchText.Items.Insert(0, tstr);
|
||||
}
|
||||
}
|
||||
|
||||
private void cbxSrchTypeUsage_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
gpSrchText.Enabled = !cbxSrchTypeUsage.Checked;
|
||||
@@ -896,7 +918,11 @@ namespace Volian.Controls.Library
|
||||
{
|
||||
e.Handled = true;
|
||||
btnSearch_Click(sender, e);
|
||||
}
|
||||
if (sender == cbxTextSearchText)
|
||||
InsertSearchCriteria();
|
||||
else
|
||||
InsertAnnotationSearchCriteria();
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
@@ -963,6 +989,7 @@ namespace Volian.Controls.Library
|
||||
xpSetToSearch.Expanded = true;
|
||||
xpSetToSearch.TitleStyle.BackColor1.Color = Color.Crimson;
|
||||
btnSearch.Enabled = false;
|
||||
tabSearchTypes.Enabled = false; // disable all the search tabs
|
||||
//if (xpSetToSearch.Expanded)
|
||||
xpSetToSearch.TitleText = "Select Procedure Sets to Search";
|
||||
//else
|
||||
@@ -976,7 +1003,8 @@ namespace Volian.Controls.Library
|
||||
xpSetToSearch.TitleText = string.Format("{0} Procedure Sets Selected", lstCheckedDocVersions.Count);
|
||||
xpSetToSearch.TitleStyle.BackColor1.Color = Color.PapayaWhip;
|
||||
btnSearch.Enabled = true;
|
||||
}
|
||||
tabSearchTypes.Enabled = true; // enable all the search tabs
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user