AdjustableArrowCap.cs 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. //
  2. // System.Drawing.Drawing2D.AdjustableArrowCap.cs
  3. //
  4. // Authors:
  5. // Dennis Hayes ([email protected])
  6. // Ravindra ([email protected])
  7. //
  8. // Copyright (C) 2002/3 Ximian, Inc. http://www.ximian.com
  9. // Copyright (C) 2004 Novell, Inc. http://www.novell.com
  10. //
  11. //
  12. // Copyright (C) 2004 Novell, Inc (http://www.novell.com)
  13. //
  14. // Permission is hereby granted, free of charge, to any person obtaining
  15. // a copy of this software and associated documentation files (the
  16. // "Software"), to deal in the Software without restriction, including
  17. // without limitation the rights to use, copy, modify, merge, publish,
  18. // distribute, sublicense, and/or sell copies of the Software, and to
  19. // permit persons to whom the Software is furnished to do so, subject to
  20. // the following conditions:
  21. //
  22. // The above copyright notice and this permission notice shall be
  23. // included in all copies or substantial portions of the Software.
  24. //
  25. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  26. // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  27. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  28. // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
  29. // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
  30. // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
  31. // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  32. //
  33. using System;
  34. namespace System.Drawing.Drawing2D
  35. {
  36. /// <summary>
  37. /// Summary description for AdjustableArrowCap.
  38. /// </summary>
  39. public sealed class AdjustableArrowCap : CustomLineCap
  40. {
  41. // Constructors
  42. internal AdjustableArrowCap (IntPtr ptr) : base (ptr)
  43. {
  44. }
  45. public AdjustableArrowCap (float width, float height) : this (width, height, true)
  46. {
  47. }
  48. public AdjustableArrowCap (float width, float height, bool isFilled)
  49. {
  50. Status status = GDIPlus.GdipCreateAdjustableArrowCap (height, width, isFilled, out nativeObject);
  51. GDIPlus.CheckStatus (status);
  52. }
  53. // Public Properities
  54. public bool Filled {
  55. get {
  56. bool isFilled;
  57. Status status = GDIPlus.GdipGetAdjustableArrowCapFillState (nativeObject, out isFilled);
  58. GDIPlus.CheckStatus (status);
  59. return isFilled;
  60. }
  61. set {
  62. Status status = GDIPlus.GdipSetAdjustableArrowCapFillState (nativeObject, value);
  63. GDIPlus.CheckStatus (status);
  64. }
  65. }
  66. public float Width {
  67. get {
  68. float width;
  69. Status status = GDIPlus.GdipGetAdjustableArrowCapWidth (nativeObject, out width);
  70. GDIPlus.CheckStatus (status);
  71. return width;
  72. }
  73. set {
  74. Status status = GDIPlus.GdipSetAdjustableArrowCapWidth (nativeObject, value);
  75. GDIPlus.CheckStatus (status);
  76. }
  77. }
  78. public float Height {
  79. get {
  80. float height;
  81. Status status = GDIPlus.GdipGetAdjustableArrowCapHeight (nativeObject, out height);
  82. GDIPlus.CheckStatus (status);
  83. return height;
  84. }
  85. set {
  86. Status status = GDIPlus.GdipSetAdjustableArrowCapHeight (nativeObject, value);
  87. GDIPlus.CheckStatus (status);
  88. }
  89. }
  90. public float MiddleInset {
  91. get {
  92. float middleInset;
  93. Status status = GDIPlus.GdipGetAdjustableArrowCapMiddleInset (nativeObject, out middleInset);
  94. GDIPlus.CheckStatus (status);
  95. return middleInset;
  96. }
  97. set {
  98. Status status = GDIPlus.GdipSetAdjustableArrowCapMiddleInset (nativeObject, value);
  99. GDIPlus.CheckStatus (status);
  100. }
  101. }
  102. }
  103. }