ReferenceLibrary.cs 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510
  1. using OTS.WinFormsUI.Docking;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.ComponentModel;
  5. using System.Data;
  6. using System.Drawing;
  7. using System.Linq;
  8. using System.Text;
  9. using System.Threading.Tasks;
  10. using System.Windows.Forms;
  11. using static System.Windows.Forms.VisualStyles.VisualStyleElement;
  12. namespace OTSPartA_STDEditor
  13. {
  14. public partial class ReferenceLibrary : DockContent
  15. {
  16. public SubMidWindow m_SubMidWindow = null;
  17. protected SourceGrid.Cells.Views.Cell m_CellGroupType = null;
  18. public Dictionary<int, STDdata> ReferenceDictionary = new Dictionary<int, STDdata>();
  19. System.Collections.Hashtable table_ReferenceLibrary;
  20. readonly Dictionary<int, string> ReferenceGroup = new Dictionary<int, string>();
  21. public ReferenceLibrary(SubMidWindow SubMidWindow)
  22. {
  23. InitializeComponent();
  24. m_SubMidWindow = SubMidWindow;
  25. }
  26. private void InitGrid()
  27. {
  28. int iColumnWidth = 20; // 第一列的宽度
  29. int width = this.Width;
  30. PropGrid.Redim(1, 12);
  31. PropGrid.Columns.SetWidth(0, iColumnWidth);
  32. PropGrid.Columns.AutoSizeColumn(2); // 固定进度条
  33. PropGrid.Columns.SetWidth(2, 1 * (width - iColumnWidth) / 30);
  34. PropGrid.Columns.SetWidth(3, 25 * (width - iColumnWidth) / 30);
  35. PropGrid.Columns.SetWidth(4, 3 * (width - iColumnWidth) / 30);
  36. PropGrid.Columns.SetWidth(5, 1 * (width - iColumnWidth) / 30);
  37. PropGrid.Columns.SetWidth(6, 1 * (width - iColumnWidth) / 30);
  38. PropGrid.Columns.SetWidth(7, 2 * (width - iColumnWidth) / 30);
  39. PropGrid.Columns.SetWidth(8, 1 * (width - iColumnWidth) / 30);
  40. PropGrid.Columns.SetWidth(9, 3 * (width - iColumnWidth) / 30);
  41. PropGrid.Columns.SetWidth(10, 10 * (width - iColumnWidth) / 30);
  42. PropGrid.Columns.SetWidth(11, 1 * (width - iColumnWidth) / 30);
  43. PropGrid.AutoStretchColumnsToFitWidth = true;
  44. // 创建列标题
  45. if (null == PropGrid[0, 1])
  46. {
  47. List<String> listColName = new List<string>();
  48. if (m_SubMidWindow.m_MainForm.lan.GetNameTable("Form_Main")["language"].ToString() == "ZH")
  49. {
  50. listColName.Add("规则名称");
  51. listColName.Add("颜色");
  52. listColName.Add("表达式");
  53. listColName.Add("必须存在元素");
  54. listColName.Add("硬度");
  55. listColName.Add("密度");
  56. listColName.Add("导电性");
  57. listColName.Add("BSE");
  58. listColName.Add("化学式");
  59. listColName.Add("元素");
  60. listColName.Add("分组名称");
  61. }
  62. else
  63. {
  64. listColName.Add("Rule Name");
  65. listColName.Add("Color");
  66. listColName.Add("Expression");
  67. listColName.Add("Elements must exist");
  68. listColName.Add("Hardness");
  69. listColName.Add("Density");
  70. listColName.Add("Conductivity");
  71. listColName.Add("BSE");
  72. listColName.Add("Formula");
  73. listColName.Add("Element");
  74. listColName.Add("GroupName");
  75. }
  76. for (int i = 0; i < listColName.Count; i++)
  77. {
  78. if (null == PropGrid[0, 1 + i])
  79. {
  80. PropGrid[0, 1 + i] = new SourceGrid.Cells.Cell(listColName[i]);
  81. }
  82. else
  83. {
  84. PropGrid[0, 1 + i].Value = listColName[i];
  85. }
  86. }
  87. PropGrid.FixedRows = 1; // 第一行是列标题不可以滚动
  88. PropGrid.Selection.EnableMultiSelection = false;
  89. PropGrid.Refresh();
  90. }
  91. }
  92. private void ComparativeLibrary_Load(object sender, EventArgs e)
  93. {
  94. m_SubMidWindow.m_MainForm.lan = new Language(this);
  95. table_ReferenceLibrary = m_SubMidWindow.m_MainForm.lan.GetNameTable("ReferenceLibrary");
  96. InitGrid();
  97. }
  98. bool LoadClassifyToDictionary(string DBAddress, ref Dictionary<int, STDdata> STDDictionary)
  99. {
  100. try
  101. {
  102. System.Data.SQLite.SQLiteConnection m_dbConnection = new System.Data.SQLite.SQLiteConnection("data source='" + DBAddress + "'");
  103. m_dbConnection.Open();
  104. //加载STD信息
  105. System.Data.SQLite.SQLiteDataAdapter m_dataAdapter = new System.Data.SQLite.SQLiteDataAdapter("select * from ClassifySTD", m_dbConnection);
  106. DataSet ds = new DataSet();
  107. m_dataAdapter.Fill(ds);
  108. DataTable dt = ds.Tables[0];
  109. ReferenceGroup.Clear();
  110. STDDictionary.Clear();
  111. if (dt != null)
  112. {
  113. if (dt.Rows.Count > 0)
  114. {
  115. foreach (DataRow item in dt.Rows)
  116. {
  117. STDdata new_STDdata = new STDdata
  118. {
  119. STDId = int.Parse(item["STDId"].ToString()),
  120. Hardness = item["Hardness"].ToString(),
  121. Density = item["Density"].ToString(),
  122. Electrical_conductivity = item["Electrical_conductivity"].ToString(),
  123. BSE = item["BSE"].ToString(),
  124. Formula = item["Formula"].ToString(),
  125. Element = item["Formula"].ToString(),
  126. StrName = item["StrName"].ToString(),
  127. Expression = item["Expression"].ToString(),
  128. Color = item["Color"].ToString(),
  129. KeyElementList = item["KeyElementList"].ToString(),
  130. SubElementList = item["SubElementList"].ToString(),
  131. GroupId = (int)item["GroupId"]
  132. };
  133. STDDictionary.Add(int.Parse(item["STDId"].ToString()), new_STDdata);
  134. }
  135. }
  136. }
  137. System.Data.SQLite.SQLiteDataAdapter m_dataAdapterGroup = new System.Data.SQLite.SQLiteDataAdapter("select Id,name from STDGroups", m_dbConnection);
  138. DataSet dsGroup = new DataSet();
  139. m_dataAdapterGroup.Fill(dsGroup);
  140. DataTable dtGroup = dsGroup.Tables[0];
  141. if (dtGroup != null)
  142. {
  143. if (dtGroup.Rows.Count >= 0)
  144. {
  145. foreach (DataRow item in dtGroup.Rows)
  146. {
  147. ReferenceGroup.Add(int.Parse(item["Id"].ToString()), item["name"].ToString());
  148. }
  149. if(!ReferenceGroup.Keys.Contains(0))
  150. {
  151. ReferenceGroup.Add(0, "Default");
  152. }
  153. }
  154. }
  155. return true;
  156. }
  157. catch (Exception)
  158. {
  159. MessageBox.Show("Reference library format error, please open the correct reference library!", "Tip");
  160. return false;
  161. }
  162. }
  163. void AddDataToRefereceLiberary(Dictionary<int, STDdata> RefDictionary)
  164. {
  165. PropGrid.Redim(RefDictionary.Count+1, 12);
  166. int i = 1;
  167. foreach (KeyValuePair<int, STDdata> kv in RefDictionary)
  168. {
  169. if (null == PropGrid[i, 0])
  170. {
  171. PropGrid[i, 0] = new SourceGrid.Cells.CheckBox(null, false);
  172. SourceGrid.Cells.Controllers.CheckBox clickEvent = new SourceGrid.Cells.Controllers.CheckBox();
  173. clickEvent.CheckedChanged += new EventHandler(clickEvent_Click);
  174. PropGrid[i, 0].AddController(clickEvent);
  175. }
  176. else
  177. {
  178. PropGrid[i, 0].Value = false;
  179. }
  180. PropGrid.Rows[i].Height = 25;
  181. PropGrid.Rows[i].Tag = kv.Value;
  182. PropGrid[i, 1] = new SourceGrid.Cells.Cell(kv.Value.StrName, typeof(string))
  183. {
  184. Tag = kv.Value
  185. };
  186. PropGrid[i, 2] = new SourceGrid.Cells.Cell("", typeof(string));
  187. SourceGrid.Cells.Views.Cell view = new SourceGrid.Cells.Views.Cell
  188. {
  189. BackColor = STDRuleslist.colorHx16toRGB(kv.Value.Color)
  190. };
  191. PropGrid[i, 2].View = view;
  192. PropGrid[i, 3] = new SourceGrid.Cells.Cell(kv.Value.Expression, typeof(string));
  193. PropGrid[i, 4] = new SourceGrid.Cells.Cell(kv.Value.KeyElementList, typeof(string));
  194. PropGrid[i, 5] = new SourceGrid.Cells.Cell(kv.Value.Hardness, typeof(string));
  195. PropGrid[i, 6] = new SourceGrid.Cells.Cell(kv.Value.Density, typeof(string));
  196. PropGrid[i, 7] = new SourceGrid.Cells.Cell(kv.Value.Electrical_conductivity, typeof(string));
  197. PropGrid[i, 8] = new SourceGrid.Cells.Cell(kv.Value.BSE, typeof(string));
  198. PropGrid[i, 9] = new SourceGrid.Cells.Cell(kv.Value.Formula, typeof(string));
  199. PropGrid[i, 10] = new SourceGrid.Cells.Cell(kv.Value.Element, typeof(string));
  200. PropGrid[i, 11] = new SourceGrid.Cells.Cell(ReferenceGroup[kv.Value.GroupId], typeof(string));
  201. i++;
  202. }
  203. PropGrid.AutoSizeCells();
  204. int iColumnWidth = 45; // 第一列的宽度
  205. int width = this.Width;
  206. PropGrid.Columns.SetWidth(0, iColumnWidth);
  207. PropGrid.Columns.SetWidth(2, 1 * (width - iColumnWidth) / 20);
  208. //PropGrid.Columns.SetWidth(3, 25 * (width - iColumnWidth) / 30);
  209. //PropGrid.Columns.SetWidth(4, 3 * (width - iColumnWidth) / 30);
  210. //PropGrid.Columns.SetWidth(5, 1 * (width - iColumnWidth) / 30);
  211. //PropGrid.Columns.SetWidth(6, 1 * (width - iColumnWidth) / 30);
  212. //PropGrid.Columns.SetWidth(7, 2 * (width - iColumnWidth) / 30);
  213. //PropGrid.Columns.SetWidth(8, 1 * (width - iColumnWidth) / 30);
  214. //PropGrid.Columns.SetWidth(9, 3 * (width - iColumnWidth) / 30);
  215. //PropGrid.Columns.SetWidth(10, 10 * (width - iColumnWidth) / 30);
  216. for (int ro = 0; ro < PropGrid.RowsCount; ro++)
  217. {
  218. PropGrid.Rows.SetHeight(ro,25);
  219. }
  220. for (int col = 1; col < PropGrid.ColumnsCount; col++)
  221. {
  222. for (int ro = 0; ro < PropGrid.RowsCount; ro++)
  223. {
  224. PropGrid[ro,col].AddController(SourceGrid.Cells.Controllers.Unselectable.Default);
  225. }
  226. }
  227. PropGrid.Refresh();
  228. //为修改bug 第一次点击sourcegrid滚动界面时,取数不准问题(载入数据时将第一次点击落在1,0单元格)
  229. if (PropGrid[1,0] != null)
  230. {
  231. SourceGrid.Position pos = new SourceGrid.Position(1, 0);
  232. PropGrid.Selection.Focus(pos, true);
  233. }
  234. }
  235. public void MakeCheckboxUnchecked()
  236. {
  237. for (int i = 1; i < PropGrid.RowsCount; i++)
  238. {
  239. if ((bool)PropGrid[i, 0].Value == true)
  240. {
  241. PropGrid[i, 0].Value = false;
  242. }
  243. }
  244. }
  245. private void clickEvent_Click(object sender, EventArgs e)
  246. {
  247. int t = PropGrid.Selection.ActivePosition.Column;
  248. if (t == 0)//选择事件
  249. {
  250. if ((bool)PropGrid[PropGrid.Selection.ActivePosition.Row, 0].Value == true)
  251. {
  252. PropGrid[PropGrid.Selection.ActivePosition.Row, 0].Value = false;
  253. }
  254. else
  255. {
  256. MakeCheckboxUnchecked();
  257. PropGrid[PropGrid.Selection.ActivePosition.Row, 0].Value = true;
  258. }
  259. PropGrid.Refresh();
  260. }
  261. }
  262. private void TSLoad_Click(object sender, EventArgs e)
  263. {
  264. OpenFileDialog fileSel = new OpenFileDialog
  265. {
  266. Filter = "(*.db)|*.db"
  267. };
  268. if (DialogResult.OK == fileSel.ShowDialog())
  269. {
  270. ReferenceDictionary.Clear();
  271. if (LoadClassifyToDictionary(fileSel.FileName, ref ReferenceDictionary))
  272. {
  273. AddDataToRefereceLiberary(ReferenceDictionary);
  274. this.Text = " " + fileSel.FileName;
  275. PropGrid.Refresh();
  276. }
  277. }
  278. }
  279. private void TSClose_Click(object sender, EventArgs e)
  280. {
  281. if (PropGrid.RowsCount > 1)
  282. {
  283. PropGrid.Rows.RemoveRange(1, PropGrid.RowsCount - 1);
  284. ReferenceDictionary.Clear();
  285. this.Text = this.Text.Split(' ')[0];
  286. PropGrid.Refresh();
  287. }
  288. else
  289. {
  290. ReferenceDictionary.Clear();
  291. this.Text = this.Text.Split(' ')[0];
  292. PropGrid.Refresh();
  293. }
  294. }
  295. private void PropGrid_MouseClick(object sender, MouseEventArgs e)
  296. {
  297. SourceGrid.Grid oSender = (SourceGrid.Grid)sender;
  298. oSender.Focus();
  299. // 表示右击的是无效区域, 则退出(第0行是标题)
  300. if (oSender.MouseCellPosition.Row < 1 || oSender.MouseCellPosition.Column < 0)
  301. {
  302. return;
  303. }
  304. // 右击的区域获取焦点
  305. PropGrid.Selection.Focus(new SourceGrid.Position(oSender.MouseCellPosition.Row, oSender.MouseCellPosition.Column), true);
  306. try
  307. {
  308. if (MouseButtons.Right == e.Button && e.Clicks == 1)
  309. {
  310. // 此处编写在什么情况下弹出右击菜单
  311. contextMenuStrip.Show(PointToScreen(e.Location));
  312. // 判断左侧区域是否已经选中了某个stdmineral
  313. bool bEnable = false;
  314. bEnable = null != m_SubMidWindow.m_MainForm.m_STDRuleslist.Predata;
  315. this.insertToolStripMenuItem.Enabled = bEnable;
  316. }
  317. }
  318. catch (Exception/* ex*/)
  319. {
  320. }
  321. }
  322. private void InsertToolStripMenuItem_Click(object sender, EventArgs e)
  323. {
  324. //if (m_SubMidWindow.m_MainForm.m_STDRuleslist.tabControl1.SelectedIndex == 0)
  325. //{
  326. // MessageBox.Show("Please do not operate the reference library in the grouping interface!");
  327. // return;
  328. //}
  329. //m_SubMidWindow.m_MainForm.m_STDRuleslist.Grid_Minerals.Focus(true);
  330. //int i = m_SubMidWindow.m_MainForm.m_STDRuleslist.Grid_Minerals.Selection.ActivePosition.Row;
  331. //int j = m_SubMidWindow.m_MainForm.m_STDRuleslist.Grid_Minerals.Selection.ActivePosition.Column;
  332. ///// 保证鼠标点击的GRID行和列是有效的
  333. //if (i >= 0 && j >= 0)
  334. //{
  335. // //规则名称不为空
  336. // if (m_SubMidWindow.m_MainForm.m_STDRuleslist.Grid_Minerals[i, 0].Value.ToString().Replace(" ", "").Trim() != "")
  337. // {
  338. // int id = ((STDdata)m_SubMidWindow.m_MainForm.m_STDRuleslist.Grid_Minerals[i, 0].Tag).STDId;
  339. // m_SubMidWindow.m_MainForm.SaveDataOfSelRule(id);
  340. // PropGrid.Focus(true);
  341. // int selrow = PropGrid.Selection.ActivePosition.Row;
  342. // int STDnum = ((STDdata)PropGrid[selrow, 1].Tag).STDId;
  343. // int STDId = 1;
  344. // foreach (KeyValuePair<int, STDdata> kv in m_SubMidWindow.m_MainForm._sTDEditor.STDDictionary)
  345. // {
  346. // if (STDId < kv.Key)
  347. // {
  348. // STDId = kv.Key;
  349. // }
  350. // }
  351. // STDdata sT = new STDdata();
  352. // sT.BSE = ReferenceDictionary[STDnum].BSE;
  353. // sT.StrName = ReferenceDictionary[STDnum].StrName;
  354. // sT.Color = ReferenceDictionary[STDnum].Color;
  355. // sT.Density = ReferenceDictionary[STDnum].Density;
  356. // sT.Expression = ReferenceDictionary[STDnum].Expression;
  357. // sT.Formula = ReferenceDictionary[STDnum].Formula;
  358. // sT.Hardness = ReferenceDictionary[STDnum].Hardness;
  359. // sT.UsingImgPropertyList = ReferenceDictionary[STDnum].UsingImgPropertyList;
  360. // sT.UsingOtherPropertyList = ReferenceDictionary[STDnum].UsingOtherPropertyList;
  361. // sT.KeyElementList = ReferenceDictionary[STDnum].KeyElementList;
  362. // sT.SubElementList = ReferenceDictionary[STDnum].SubElementList;
  363. // sT.Electrical_conductivity = ReferenceDictionary[STDnum].Electrical_conductivity;
  364. // sT.Element = ReferenceDictionary[STDnum].Element;
  365. // sT.GroupId = ReferenceDictionary[STDnum].GroupId;
  366. // sT.STDId = STDnum;
  367. // m_SubMidWindow.m_MainForm._sTDEditor.STDDictionary.Add(STDId + 1, sT);
  368. // m_SubMidWindow.m_MainForm.m_STDRuleslist.InsertNewRow(STDId + 1, sT.StrName, STDRuleslist.colorHx16toRGB(sT.Color));
  369. // m_SubMidWindow.m_MainForm.m_STDRuleslist.Refresh();
  370. // m_SubMidWindow.m_MainForm.m_STDRuleslist.Predata = (STDdata)m_SubMidWindow.m_MainForm.m_STDRuleslist.Grid_Minerals[i, 0].Tag;
  371. // }
  372. //}
  373. //else
  374. //{
  375. // AddIntoMainLab();
  376. //}
  377. }
  378. #region 因为复制容易引起用户误操作,故取消
  379. private void copyDataToolStripMenuItem_Click(object sender, EventArgs e)
  380. {
  381. //int selrow = PropGrid.Selection.ActivePosition.Row;
  382. //int STDnum = (int)PropGrid[selrow, 1].Tag;
  383. //int STDid = (int)m_SubMidWindow.m_MainForm.m_STDRuleslist.Grid_Minerals[m_SubMidWindow.m_MainForm.m_STDRuleslist.PreRow, 0].Tag;
  384. //m_SubMidWindow.m_MainForm.STDDictionary[STDid] = ReferenceDictionary[STDnum];
  385. //m_SubMidWindow.m_MainForm.m_STDRuleslist.ChangeStrName(m_SubMidWindow.m_MainForm.m_STDRuleslist.PreRow, ReferenceDictionary[STDnum].StrName);
  386. //m_SubMidWindow.m_MainForm.ChangeSTDEditorAndGrid_Attributes(STDid);
  387. //m_SubMidWindow.m_MainForm.m_STDRuleslist.Grid_Minerals.Refresh();
  388. }
  389. #endregion
  390. private void addIntoMainLabToolStripMenuItem_Click(object sender, EventArgs e)
  391. {
  392. foreach (TreeNode treeNode1 in m_SubMidWindow.m_MainForm.m_STDRuleslist.treeView_G.Nodes)
  393. {
  394. if (((STDGroups)treeNode1.Tag).name == "Default")
  395. {
  396. if (m_SubMidWindow.m_MainForm.m_STDRuleslist.Predata != null)
  397. {
  398. m_SubMidWindow.m_MainForm.SaveDataOfSelRule(m_SubMidWindow.m_MainForm.m_STDRuleslist.Predata.STDId);
  399. }
  400. STDdata ddata = AddIntoMainLab();
  401. int STDId = 40000;
  402. foreach (STDGroups grp in m_SubMidWindow.m_MainForm.m_STDRuleslist.GroupViewDic.Values)
  403. {
  404. foreach (STDdata ddata1 in grp.ContainSTD)
  405. {
  406. if (STDId < ddata1.STDId)
  407. {
  408. STDId = ddata1.STDId;
  409. }
  410. }
  411. }
  412. ddata.STDId = STDId + 1;
  413. TreeNode treeNode = new TreeNode();
  414. treeNode.Text = ddata.StrName;
  415. treeNode.Tag = ddata;
  416. ddata.ListNum = ((((STDGroups)treeNode1.Tag).ContainSTD).Count - 1).ToString();
  417. ddata.GroupId = ((STDGroups)treeNode1.Tag).id;
  418. ((STDGroups)treeNode1.Tag).ContainSTD.Add(ddata);
  419. m_SubMidWindow.m_MainForm.m_STDRuleslist.InitGroupView();
  420. foreach (TreeNode node in m_SubMidWindow.m_MainForm.m_STDRuleslist.treeView_G.Nodes)
  421. {
  422. foreach (TreeNode node1 in node.Nodes)
  423. {
  424. if (((STDdata)node1.Tag).STDId == ddata.STDId)
  425. {
  426. m_SubMidWindow.m_MainForm.ChangeSTDEditorAndGrid_Attributes(ddata);
  427. m_SubMidWindow.m_MainForm.m_STDRuleslist.Predata = (STDdata)treeNode.Tag;
  428. m_SubMidWindow.m_MainForm.m_STDRuleslist.treeView_G.SelectedNode = node1;
  429. m_SubMidWindow.m_MainForm.m_STDRuleslist.treeView_G.Focus();
  430. break;
  431. }
  432. }
  433. }
  434. }
  435. }
  436. }
  437. STDdata AddIntoMainLab()
  438. {
  439. PropGrid.Focus(true);
  440. int selrow = PropGrid.Selection.ActivePosition.Row;
  441. int STDnum = ((STDdata)PropGrid[selrow, 1].Tag).STDId;
  442. //int STDId = 40000;
  443. //foreach (KeyValuePair<int, STDdata> kv in m_SubMidWindow.m_MainForm._sTDEditor.STDDictionary)
  444. //{
  445. // if (STDId < kv.Key)
  446. // {
  447. // STDId = kv.Key;
  448. // }
  449. //}
  450. STDdata sT = new STDdata
  451. {
  452. BSE = ReferenceDictionary[STDnum].BSE,
  453. StrName = ReferenceDictionary[STDnum].StrName,
  454. Color = ReferenceDictionary[STDnum].Color,
  455. Density = ReferenceDictionary[STDnum].Density,
  456. Expression = ReferenceDictionary[STDnum].Expression,
  457. Formula = ReferenceDictionary[STDnum].Formula,
  458. Hardness = ReferenceDictionary[STDnum].Hardness,
  459. UsingImgPropertyList = ReferenceDictionary[STDnum].UsingImgPropertyList,
  460. UsingOtherPropertyList = ReferenceDictionary[STDnum].UsingOtherPropertyList,
  461. KeyElementList = ReferenceDictionary[STDnum].KeyElementList,
  462. SubElementList = ReferenceDictionary[STDnum].SubElementList,
  463. Electrical_conductivity = ReferenceDictionary[STDnum].Electrical_conductivity,
  464. Element = ReferenceDictionary[STDnum].Element
  465. };
  466. return sT;
  467. }
  468. }
  469. }