Action11011.cs 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. using PaintDotNet.Base.CommTool;
  2. using PaintDotNet.Base.SettingModel;
  3. using PaintDotNet.Data.Param;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.IO;
  7. using System.Linq;
  8. using System.Text;
  9. using System.Threading.Tasks;
  10. using System.Windows.Forms;
  11. namespace PaintDotNet.Data.Action
  12. {
  13. /// <summary>
  14. /// 定量分析
  15. /// </summary>
  16. public class Action11011: ActionAnalysis
  17. {
  18. public Action11011() {
  19. //使用网格
  20. QuantitativeAnalysisModel microstructureBandModel = XmlSerializeHelper.DESerializer<QuantitativeAnalysisModel>(FileOperationHelper.ReadStringFromFile(Application.StartupPath + "\\Config\\" + "Default" + "\\QuantitativeAnalysisModel.xml", FileMode.Open));
  21. BooleanObject[] booleanObjects;
  22. if (microstructureBandModel.GridStyleList != null && microstructureBandModel.GridStyleList.Count > 0)
  23. {
  24. booleanObjects = new BooleanObject[microstructureBandModel.GridStyleList.Count];
  25. int i = 0;
  26. foreach (var grid in microstructureBandModel.GridStyleList)
  27. {
  28. booleanObjects.SetValue(new BooleanObject(i.ToString(), grid.gridName, true, null), i);
  29. i++;
  30. }
  31. }
  32. else
  33. {
  34. booleanObjects = new BooleanObject[]
  35. {
  36. new BooleanObject("0", "网格1", true, null)
  37. };
  38. }
  39. ChoiseArray one = new ChoiseArray("parameter1", PdnResources.GetString("Menu.Usegrid.text"), booleanObjects);
  40. one.initialValue = 0;
  41. one.value = 0;
  42. lists.Add(one);
  43. //网格可移动
  44. BooleanObject two = new BooleanObject();
  45. two.key = "parameter2";
  46. two.name = PdnResources.GetString("Menu.Meshmobility.text");
  47. two.initialValue = false;
  48. two.Value = false;
  49. lists.Add(two);
  50. }
  51. }
  52. }