Action110151.cs 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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 Action110151: Action11015
  14. {
  15. public Action110151() {
  16. this.MenuId = ActionType.BandedStructureASTME1268;
  17. //使用网格
  18. MicrostructureBandModel microstructureBandModel = XmlSerializeHelper.DESerializer<MicrostructureBandModel>(FileOperationHelper.ReadStringFromFile(Application.StartupPath + "\\Config\\" + "Default" + "\\MicrostructureBandModel.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("parameter1", PdnResources.GetString("Menu.Usegrid.text"), booleanObjects);
  38. one.initialValue = 0;
  39. one.value = 0;
  40. lists.Add(one);
  41. }
  42. }
  43. }