Action11021.cs 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. using PaintDotNet.Data.Param;
  2. using System;
  3. using System.Collections;
  4. using System.Collections.Generic;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. namespace PaintDotNet.Data.Action
  10. {
  11. public class Action11021 : ParamObject
  12. {
  13. public Action11021() {
  14. this.MenuId = ActionType.QualityOfEdge;
  15. //线宽
  16. IntegerNumber four = new IntegerNumber(1, 50);
  17. four.key = "parameter1";
  18. four.name = "线宽";
  19. four.initialValue = 50;
  20. four.value = 50;
  21. lists.Add(four);
  22. //线段颜色
  23. ColorNumber five = new ColorNumber();
  24. five.key = "parameter2";
  25. five.name = "线段颜色";
  26. five.Value = Color.Green.ToArgb();
  27. lists.Add(five);
  28. System.Drawing.Text.InstalledFontCollection fonts = new System.Drawing.Text.InstalledFontCollection();
  29. BooleanObject[] booleanObjects = new BooleanObject[fonts.Families.Length];
  30. int i = 0;
  31. int defaultIndex = 0;
  32. foreach (FontFamily fontFamily in fonts.Families)
  33. {
  34. if (fontFamily.Name.Equals("宋体")) {
  35. defaultIndex = i;
  36. booleanObjects.SetValue(new BooleanObject(i.ToString(), fontFamily.Name, true, null), i);
  37. i++;
  38. continue;
  39. }
  40. booleanObjects.SetValue(new BooleanObject(i.ToString(), fontFamily.Name,false,null),i);
  41. i++;
  42. }
  43. //字体
  44. ChoiseArray six = new ChoiseArray("parameter6", PdnResources.GetString("Menu.Font.text"),booleanObjects, defaultIndex);
  45. lists.Add(six);
  46. //字号
  47. IntegerNumber seven = new IntegerNumber(1, 50);
  48. seven.key = "parameter3";
  49. seven.name = PdnResources.GetString("Menu.Fontsize.text");
  50. seven.initialValue = 1;
  51. seven.value = 1;
  52. lists.Add(seven);
  53. //字体颜色
  54. ColorNumber eight = new ColorNumber();
  55. eight.key = "parameter4";
  56. eight.name = PdnResources.GetString("Menu.fontcolor.text");
  57. eight.Value = Color.Red.ToArgb();
  58. lists.Add(eight);
  59. IntegerNumber CalculatorDecimalDigits = new IntegerNumber(0, 10);
  60. CalculatorDecimalDigits.key = "CalculatorDecimalDigits";
  61. CalculatorDecimalDigits.name = "小数点位数";
  62. CalculatorDecimalDigits.initialValue = 2;
  63. CalculatorDecimalDigits.value = 2;
  64. lists.Add(CalculatorDecimalDigits);
  65. lists.Add(new BooleanObject("OpenWhileExportReport", "生成报告时打开设置", true, null));
  66. }
  67. }
  68. }