Action11012PointCounting.cs 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. public class Action11012PointCounting : ActionAnalysis
  14. {
  15. public Action11012PointCounting()
  16. {
  17. //使用网格
  18. GrainSizePointCountingMethodModel microstructureBandModel = XmlSerializeHelper.DESerializer<GrainSizePointCountingMethodModel>(FileOperationHelper.ReadStringFromFile(Application.StartupPath + "\\Config\\" + "Default" + "\\GrainSizePointCountingMethodModel.xml", FileMode.Open));
  19. BooleanObject[] booleanObjects;
  20. if (microstructureBandModel.GridStyleList != null && microstructureBandModel.GridStyleList.Count > 0)
  21. {
  22. booleanObjects = new BooleanObject[microstructureBandModel.GridStyleList.Count];
  23. int i = 0;
  24. foreach (var grid in microstructureBandModel.GridStyleList)
  25. {
  26. booleanObjects.SetValue(new BooleanObject(i.ToString(), grid.gridName, true, null), i);
  27. i++;
  28. }
  29. }
  30. else
  31. {
  32. booleanObjects = new BooleanObject[]
  33. {
  34. new BooleanObject("0", "网格1", true, null)
  35. };
  36. }
  37. ChoiseArray one = new ChoiseArray("selectedGrid", PdnResources.GetString("Menu.Usegrid.text"), booleanObjects);
  38. one.initialValue = 0;
  39. one.value = 0;
  40. lists.Add(one);
  41. }
  42. }
  43. }