Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / ndp / fx / src / CommonUI / System / Drawing / Advanced / AdjustableArrowCap.cs / 2 / AdjustableArrowCap.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Drawing.Drawing2D { using Microsoft.Win32; using System; using System.ComponentModel; using System.Diagnostics; using System.Drawing; using System.Drawing.Internal; using System.Runtime.InteropServices; ////// /// Represents an adjustable arrow-shaped line /// cap. /// public sealed class AdjustableArrowCap : CustomLineCap { internal AdjustableArrowCap(IntPtr nativeCap) : base(nativeCap) {} ////// /// Initializes a new instance of the public AdjustableArrowCap(float width, float height) : this(width, height, true) {} ///class with the specified width and /// height. /// /// /// public AdjustableArrowCap(float width, float height, bool isFilled) { IntPtr nativeCap = IntPtr.Zero; int status = SafeNativeMethods.Gdip.GdipCreateAdjustableArrowCap( height, width, isFilled, out nativeCap); if (status != SafeNativeMethods.Gdip.Ok) throw SafeNativeMethods.Gdip.StatusException(status); SetNativeLineCap(nativeCap); } private void _SetHeight(float height) { int status = SafeNativeMethods.Gdip.GdipSetAdjustableArrowCapHeight(new HandleRef(this, nativeCap), height); if (status != SafeNativeMethods.Gdip.Ok) throw SafeNativeMethods.Gdip.StatusException(status); } private float _GetHeight() { float height; int status = SafeNativeMethods.Gdip.GdipGetAdjustableArrowCapHeight(new HandleRef(this, nativeCap), out height); if (status != SafeNativeMethods.Gdip.Ok) throw SafeNativeMethods.Gdip.StatusException(status); return height; } ////// Initializes a new instance of the ///class with the specified width, /// height, and fill property. /// /// /// Gets or sets the height of the arrow cap. /// public float Height { get { return _GetHeight(); } set { _SetHeight(value); } } private void _SetWidth(float width) { int status = SafeNativeMethods.Gdip.GdipSetAdjustableArrowCapWidth(new HandleRef(this, nativeCap), width); if (status != SafeNativeMethods.Gdip.Ok) throw SafeNativeMethods.Gdip.StatusException(status); } private float _GetWidth() { float width; int status = SafeNativeMethods.Gdip.GdipGetAdjustableArrowCapWidth(new HandleRef(this, nativeCap), out width); if (status != SafeNativeMethods.Gdip.Ok) throw SafeNativeMethods.Gdip.StatusException(status); return width; } ////// /// Gets or sets the width of the arrow cap. /// public float Width { get { return _GetWidth(); } set { _SetWidth(value); } } private void _SetMiddleInset(float middleInset) { int status = SafeNativeMethods.Gdip.GdipSetAdjustableArrowCapMiddleInset(new HandleRef(this, nativeCap), middleInset); if (status != SafeNativeMethods.Gdip.Ok) throw SafeNativeMethods.Gdip.StatusException(status); } private float _GetMiddleInset() { float middleInset; int status = SafeNativeMethods.Gdip.GdipGetAdjustableArrowCapMiddleInset(new HandleRef(this, nativeCap), out middleInset); if (status != SafeNativeMethods.Gdip.Ok) throw SafeNativeMethods.Gdip.StatusException(status); return middleInset; } ////// /// public float MiddleInset { get { return _GetMiddleInset(); } set { _SetMiddleInset(value); } } private void _SetFillState(bool isFilled) { int status = SafeNativeMethods.Gdip.GdipSetAdjustableArrowCapFillState(new HandleRef(this, nativeCap), isFilled); if (status != SafeNativeMethods.Gdip.Ok) throw SafeNativeMethods.Gdip.StatusException(status); } private bool _IsFilled() { bool isFilled = false; int status = SafeNativeMethods.Gdip.GdipGetAdjustableArrowCapFillState(new HandleRef(this, nativeCap), out isFilled); if (status != SafeNativeMethods.Gdip.Ok) throw SafeNativeMethods.Gdip.StatusException(status); return isFilled; } ////// Gets or set the number of pixels between the outline of the arrow cap and the fill. /// ////// /// Gets or sets a value indicating whether the /// arrow cap is filled. /// public bool Filled { get { return _IsFilled(); } set { _SetFillState(value); } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Drawing.Drawing2D { using Microsoft.Win32; using System; using System.ComponentModel; using System.Diagnostics; using System.Drawing; using System.Drawing.Internal; using System.Runtime.InteropServices; ////// /// Represents an adjustable arrow-shaped line /// cap. /// public sealed class AdjustableArrowCap : CustomLineCap { internal AdjustableArrowCap(IntPtr nativeCap) : base(nativeCap) {} ////// /// Initializes a new instance of the public AdjustableArrowCap(float width, float height) : this(width, height, true) {} ///class with the specified width and /// height. /// /// /// public AdjustableArrowCap(float width, float height, bool isFilled) { IntPtr nativeCap = IntPtr.Zero; int status = SafeNativeMethods.Gdip.GdipCreateAdjustableArrowCap( height, width, isFilled, out nativeCap); if (status != SafeNativeMethods.Gdip.Ok) throw SafeNativeMethods.Gdip.StatusException(status); SetNativeLineCap(nativeCap); } private void _SetHeight(float height) { int status = SafeNativeMethods.Gdip.GdipSetAdjustableArrowCapHeight(new HandleRef(this, nativeCap), height); if (status != SafeNativeMethods.Gdip.Ok) throw SafeNativeMethods.Gdip.StatusException(status); } private float _GetHeight() { float height; int status = SafeNativeMethods.Gdip.GdipGetAdjustableArrowCapHeight(new HandleRef(this, nativeCap), out height); if (status != SafeNativeMethods.Gdip.Ok) throw SafeNativeMethods.Gdip.StatusException(status); return height; } ////// Initializes a new instance of the ///class with the specified width, /// height, and fill property. /// /// /// Gets or sets the height of the arrow cap. /// public float Height { get { return _GetHeight(); } set { _SetHeight(value); } } private void _SetWidth(float width) { int status = SafeNativeMethods.Gdip.GdipSetAdjustableArrowCapWidth(new HandleRef(this, nativeCap), width); if (status != SafeNativeMethods.Gdip.Ok) throw SafeNativeMethods.Gdip.StatusException(status); } private float _GetWidth() { float width; int status = SafeNativeMethods.Gdip.GdipGetAdjustableArrowCapWidth(new HandleRef(this, nativeCap), out width); if (status != SafeNativeMethods.Gdip.Ok) throw SafeNativeMethods.Gdip.StatusException(status); return width; } ////// /// Gets or sets the width of the arrow cap. /// public float Width { get { return _GetWidth(); } set { _SetWidth(value); } } private void _SetMiddleInset(float middleInset) { int status = SafeNativeMethods.Gdip.GdipSetAdjustableArrowCapMiddleInset(new HandleRef(this, nativeCap), middleInset); if (status != SafeNativeMethods.Gdip.Ok) throw SafeNativeMethods.Gdip.StatusException(status); } private float _GetMiddleInset() { float middleInset; int status = SafeNativeMethods.Gdip.GdipGetAdjustableArrowCapMiddleInset(new HandleRef(this, nativeCap), out middleInset); if (status != SafeNativeMethods.Gdip.Ok) throw SafeNativeMethods.Gdip.StatusException(status); return middleInset; } ////// /// public float MiddleInset { get { return _GetMiddleInset(); } set { _SetMiddleInset(value); } } private void _SetFillState(bool isFilled) { int status = SafeNativeMethods.Gdip.GdipSetAdjustableArrowCapFillState(new HandleRef(this, nativeCap), isFilled); if (status != SafeNativeMethods.Gdip.Ok) throw SafeNativeMethods.Gdip.StatusException(status); } private bool _IsFilled() { bool isFilled = false; int status = SafeNativeMethods.Gdip.GdipGetAdjustableArrowCapFillState(new HandleRef(this, nativeCap), out isFilled); if (status != SafeNativeMethods.Gdip.Ok) throw SafeNativeMethods.Gdip.StatusException(status); return isFilled; } ////// Gets or set the number of pixels between the outline of the arrow cap and the fill. /// ////// /// Gets or sets a value indicating whether the /// arrow cap is filled. /// public bool Filled { get { return _IsFilled(); } set { _SetFillState(value); } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- PriorityBinding.cs
- DbSource.cs
- PenContexts.cs
- TrackBarRenderer.cs
- HwndStylusInputProvider.cs
- XmlDesigner.cs
- EventDescriptor.cs
- precedingsibling.cs
- GregorianCalendarHelper.cs
- XmlNode.cs
- SrgsText.cs
- SecurityElement.cs
- ArgIterator.cs
- FieldNameLookup.cs
- RegexCode.cs
- DbParameterCollectionHelper.cs
- parserscommon.cs
- EventArgs.cs
- XPathArrayIterator.cs
- XmlDigitalSignatureProcessor.cs
- IndexedString.cs
- CompileXomlTask.cs
- XmlNamespaceDeclarationsAttribute.cs
- PersonalizablePropertyEntry.cs
- TextRenderer.cs
- storepermission.cs
- XmlNavigatorStack.cs
- LambdaCompiler.Logical.cs
- arabicshape.cs
- CommandID.cs
- MDIWindowDialog.cs
- AllMembershipCondition.cs
- CacheEntry.cs
- Vector3DAnimationBase.cs
- AbsoluteQuery.cs
- MethodBuilderInstantiation.cs
- StylusPointProperties.cs
- _LoggingObject.cs
- EntityTemplateUserControl.cs
- StreamHelper.cs
- DATA_BLOB.cs
- PackageRelationshipSelector.cs
- _ConnectionGroup.cs
- XmlSchemaElement.cs
- PathStreamGeometryContext.cs
- AppDomainProtocolHandler.cs
- xsdvalidator.cs
- AspNetPartialTrustHelpers.cs
- CompositeActivityCodeGenerator.cs
- Assert.cs
- XPathNode.cs
- ConnectionProviderAttribute.cs
- CalendarSelectionChangedEventArgs.cs
- CollectionBuilder.cs
- HashCodeCombiner.cs
- DynamicQueryableWrapper.cs
- ListViewInsertionMark.cs
- SqlWebEventProvider.cs
- EditorPartChrome.cs
- FrameworkElementFactory.cs
- TableLayoutColumnStyleCollection.cs
- OleCmdHelper.cs
- ToolStripOverflowButton.cs
- ObjectStateFormatter.cs
- UnknownBitmapDecoder.cs
- IdentityHolder.cs
- FormViewInsertedEventArgs.cs
- ComplexTypeEmitter.cs
- ToolStripSplitButton.cs
- __ConsoleStream.cs
- AssemblyCache.cs
- RequiredAttributeAttribute.cs
- XmlExtensionFunction.cs
- CacheModeConverter.cs
- OdbcConnectionString.cs
- FieldToken.cs
- Base64Decoder.cs
- DataGridRowEventArgs.cs
- MatrixStack.cs
- EllipticalNodeOperations.cs
- DrawingGroupDrawingContext.cs
- BaseInfoTable.cs
- ObjectCloneHelper.cs
- LambdaCompiler.Unary.cs
- LocatorBase.cs
- MemberRelationshipService.cs
- AssemblyBuilder.cs
- XMLSyntaxException.cs
- DiscoveryDocument.cs
- ParameterCollection.cs
- OdbcCommand.cs
- WriteableBitmap.cs
- MessageBox.cs
- SoapObjectReader.cs
- AddInController.cs
- FileFormatException.cs
- PageRanges.cs
- PathFigureCollection.cs
- AlternateView.cs
- DiscoveryClientReferences.cs