C2021-006: Search results save/load only show xml file type as option

This commit is contained in:
Kathy Ruffing 2021-03-26 15:44:37 +00:00
parent 4168218dc9
commit 25b9af0d7c
2 changed files with 252 additions and 301 deletions

View File

@ -1414,8 +1414,8 @@ namespace Volian.Controls.Library
this.btnSaveSearchResults.Name = "btnSaveSearchResults"; this.btnSaveSearchResults.Name = "btnSaveSearchResults";
this.btnSaveSearchResults.RightToLeft = System.Windows.Forms.RightToLeft.No; this.btnSaveSearchResults.RightToLeft = System.Windows.Forms.RightToLeft.No;
this.btnSaveSearchResults.Size = new System.Drawing.Size(57, 28); this.btnSaveSearchResults.Size = new System.Drawing.Size(57, 28);
this.superTooltip1.SetSuperTooltip(this.btnSaveSearchResults, new DevComponents.DotNetBar.SuperTooltipInfo("Save Search Results", "", "This button saves the Search Results listed below into a named file in xml, csv, " + this.superTooltip1.SetSuperTooltip(this.btnSaveSearchResults, new DevComponents.DotNetBar.SuperTooltipInfo("Save Search Results", "", "This button saves the Search Results listed below into a named file in xml.",
"tab or basic format.", null, null, DevComponents.DotNetBar.eTooltipColor.Gray)); null, null, DevComponents.DotNetBar.eTooltipColor.Gray));
this.btnSaveSearchResults.TabIndex = 10; this.btnSaveSearchResults.TabIndex = 10;
this.btnSaveSearchResults.Text = "Save"; this.btnSaveSearchResults.Text = "Save";
this.btnSaveSearchResults.ThemeAware = true; this.btnSaveSearchResults.ThemeAware = true;
@ -1431,8 +1431,8 @@ namespace Volian.Controls.Library
this.btnLoadSearchResults.Name = "btnLoadSearchResults"; this.btnLoadSearchResults.Name = "btnLoadSearchResults";
this.btnLoadSearchResults.RightToLeft = System.Windows.Forms.RightToLeft.No; this.btnLoadSearchResults.RightToLeft = System.Windows.Forms.RightToLeft.No;
this.btnLoadSearchResults.Size = new System.Drawing.Size(57, 28); this.btnLoadSearchResults.Size = new System.Drawing.Size(57, 28);
this.superTooltip1.SetSuperTooltip(this.btnLoadSearchResults, new DevComponents.DotNetBar.SuperTooltipInfo("Save Search Results", "", "This button loads saved Search Results from a named file in xml, csv, tab or basi" + this.superTooltip1.SetSuperTooltip(this.btnLoadSearchResults, new DevComponents.DotNetBar.SuperTooltipInfo("Save Search Results", "", "This button loads saved Search Results from a named file in xml.",
"c format.", null, null, DevComponents.DotNetBar.eTooltipColor.Gray)); null, null, DevComponents.DotNetBar.eTooltipColor.Gray));
this.btnLoadSearchResults.TabIndex = 10; this.btnLoadSearchResults.TabIndex = 10;
this.btnLoadSearchResults.Text = "Load"; this.btnLoadSearchResults.Text = "Load";
this.btnLoadSearchResults.ThemeAware = true; this.btnLoadSearchResults.ThemeAware = true;
@ -1550,14 +1550,12 @@ namespace Volian.Controls.Library
// //
// sfdSearchResults // sfdSearchResults
// //
this.sfdSearchResults.Filter = "XML File (*.xml)|*.xml|Comma Separated Values (*.csv)|*.csv|Tab Separated Values " + this.sfdSearchResults.Filter = "XML File (*.xml)|*.xml";
"(*.tsv)|*.tsv|Basic Style Format (*.bsf)|*.bsf";
this.sfdSearchResults.InitialDirectory = "Personal"; this.sfdSearchResults.InitialDirectory = "Personal";
// //
// ofdSearchResults // ofdSearchResults
// //
this.ofdSearchResults.Filter = "XML File (*.xml)|*.xml|Comma Separated Values (*.csv)|*.csv|Tab Separated Values " + this.ofdSearchResults.Filter = "XML File (*.xml)|*.xml";
"(*.tsv)|*.tsv|Basic Style Format (*.bsf)|*.bsf";
this.ofdSearchResults.InitialDirectory = "Personal"; this.ofdSearchResults.InitialDirectory = "Personal";
// //
// xpSetToSearch // xpSetToSearch

View File

@ -2328,11 +2328,7 @@ namespace Volian.Controls.Library
if (unitPrefix.EndsWith("#")) if (unitPrefix.EndsWith("#"))
unitPrefix = unitPrefix.Replace("#", ""); unitPrefix = unitPrefix.Replace("#", "");
SearchResults = ItemInfoList.GetByContentID(0); SearchResults = ItemInfoList.GetByContentID(0);
int k = ofdSearchResults.FilterIndex; // C2021-006: removed all file type options except xml
switch (k)
{
case 1: //xml
{
System.Xml.XmlDocument xd = new System.Xml.XmlDocument(); System.Xml.XmlDocument xd = new System.Xml.XmlDocument();
xd.Load(ofdSearchResults.FileName); xd.Load(ofdSearchResults.FileName);
// B2020-107: Add missing attributes/nodes for loading of search results, include procsets & steptypes: // B2020-107: Add missing attributes/nodes for loading of search results, include procsets & steptypes:
@ -2464,21 +2460,6 @@ namespace Volian.Controls.Library
break; break;
} }
} }
break;
}
case 2: //csv
{
break;
}
case 3: //tsv
{
break;
}
case 4: //bsf
{
break;
}
}
Cursor = Cursors.Default; Cursor = Cursors.Default;
} }
btnTranCvtAllToTxt.Enabled = IncTransCvtAllToTextPerm(); // C2020-033: does user have access to at least one item btnTranCvtAllToTxt.Enabled = IncTransCvtAllToTextPerm(); // C2020-033: does user have access to at least one item
@ -2497,11 +2478,7 @@ namespace Volian.Controls.Library
sfdSearchResults.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + @"\VEPROMS"; sfdSearchResults.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + @"\VEPROMS";
if (sfdSearchResults.ShowDialog(this) == DialogResult.OK) if (sfdSearchResults.ShowDialog(this) == DialogResult.OK)
{ {
int k = sfdSearchResults.FilterIndex; // C2021-006: removed all file type options except xml
switch (k)
{
case 1: //xml
{
System.Xml.XmlDocument xd = new System.Xml.XmlDocument(); System.Xml.XmlDocument xd = new System.Xml.XmlDocument();
System.Xml.XmlElement xe = xd.CreateElement("search"); System.Xml.XmlElement xe = xd.CreateElement("search");
xd.AppendChild(xe); xd.AppendChild(xe);
@ -2642,30 +2619,6 @@ namespace Volian.Controls.Library
break; break;
} }
} }
break;
}
case 2: //csv
case 3: //tsv
case 4: //bsf
{
FlexibleMessageBox.Show(this, "Saving Search Results to this file type is under construction.", "Under Construction", MessageBoxButtons.OK);
break;
}
}
//string fn = sfdSearchResults.FileName;
//StringBuilder sb = new StringBuilder();
//sb.Append("\"Location\"\t\"Type\"\t\"Text\"\t\"High-Level\"\t\"Annotations\"");
//foreach (ItemInfo myItem in myList)
//{
// sb.Append(string.Format("\r\n\"{0}\"\t\"{1}\"\t\"{2}\"\t\"{3}\"", myItem.ShortPath, myItem.ToolTip,
// myItem.DisplayText, !myItem.IsSection && !myItem.IsHigh ? (myItem.MyHLS == null ? "" : myItem.MyHLS.DisplayText) : ""));
// if (myItem.ItemAnnotationCount > 0)
// foreach (AnnotationInfo myAnnotation in myItem.ItemAnnotations)
// sb.Append(string.Format("\t\"{0}\"", myAnnotation.SearchText));
//}
//Clipboard.Clear();
//Clipboard.SetText(sb.ToString());
//MessageBox.Show("Results Copied to Clipboard", "Copy Results", MessageBoxButtons.OK, MessageBoxIcon.Information);
} }
} }