Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / ndp / fx / src / Misc / GDI / WindowsSolidBrush.cs / 1 / WindowsSolidBrush.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- #if WINFORMS_NAMESPACE namespace System.Windows.Forms.Internal #elif DRAWING_NAMESPACE namespace System.Drawing.Internal #else namespace System.Experimental.Gdi #endif { using System; using System.Internal; using System.Runtime.InteropServices; using System.ComponentModel; using System.Diagnostics; using System.Drawing; using System.Globalization; #if WINFORMS_PUBLIC_GRAPHICS_LIBRARY public #else internal #endif sealed class WindowsSolidBrush : WindowsBrush { protected override void CreateBrush() { IntPtr nativeHandle = IntSafeNativeMethods.CreateSolidBrush(ColorTranslator.ToWin32( this.Color)); if(nativeHandle == IntPtr.Zero) // Don't use Debug.Assert, DbgUtil.GetLastErrorStr would always be evaluated. { Debug.Fail("CreateSolidBrush failed : " + DbgUtil.GetLastErrorStr()); } this.NativeHandle = nativeHandle; // sets the handle value in the base class. } public WindowsSolidBrush(DeviceContext dc) : base(dc) { // CreateBrush() on demand. } public WindowsSolidBrush(DeviceContext dc, Color color) : base( dc, color ) { // CreateBrush() on demand. } public override object Clone() { return new WindowsSolidBrush(this.DC, this.Color); } public override string ToString() { return String.Format( CultureInfo.InvariantCulture, "{0}: Color={1}", this.GetType().Name, this.Color ); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ContextStack.cs
- FormClosedEvent.cs
- XmlSchemaNotation.cs
- CompiledIdentityConstraint.cs
- ExpandedWrapper.cs
- XmlObjectSerializer.cs
- MultiPageTextView.cs
- CompositionCommandSet.cs
- KnownBoxes.cs
- BaseCodeDomTreeGenerator.cs
- DataKey.cs
- DebugView.cs
- ConfigPathUtility.cs
- DesignerVerb.cs
- Bitmap.cs
- WinFormsComponentEditor.cs
- CssTextWriter.cs
- Material.cs
- SymmetricCryptoHandle.cs
- TrimSurroundingWhitespaceAttribute.cs
- ASCIIEncoding.cs
- NotSupportedException.cs
- CachingHintValidation.cs
- ColorComboBox.cs
- EdmPropertyAttribute.cs
- EditorPartChrome.cs
- CachedBitmap.cs
- AttributeTableBuilder.cs
- Task.cs
- FixedPageStructure.cs
- ComponentConverter.cs
- ReversePositionQuery.cs
- OracleDataAdapter.cs
- TablePattern.cs
- TcpSocketManager.cs
- ItemAutomationPeer.cs
- DbConnectionInternal.cs
- ToolStripSeparator.cs
- ExtensionWindowResizeGrip.cs
- DivideByZeroException.cs
- StatusBar.cs
- ConditionalExpression.cs
- FontSource.cs
- RedirectionProxy.cs
- ElementsClipboardData.cs
- NamedPipeTransportBindingElement.cs
- AttachInfo.cs
- ThicknessAnimationUsingKeyFrames.cs
- CqlParser.cs
- ImageField.cs
- FileUtil.cs
- BrowserDefinition.cs
- WorkflowViewStateService.cs
- SingleStorage.cs
- WebBrowserDesigner.cs
- PageAsyncTask.cs
- ThicknessAnimationUsingKeyFrames.cs
- DataGridColumnHeader.cs
- LineInfo.cs
- IntSumAggregationOperator.cs
- Activator.cs
- KnownColorTable.cs
- PasswordBox.cs
- TextProperties.cs
- Image.cs
- Deflater.cs
- ObjectMemberMapping.cs
- CacheMode.cs
- FileUpload.cs
- EditableLabelControl.cs
- XmlAnyElementAttribute.cs
- Mappings.cs
- SynthesizerStateChangedEventArgs.cs
- Bits.cs
- SlotInfo.cs
- DbProviderConfigurationHandler.cs
- EventLogEntryCollection.cs
- ViewCellRelation.cs
- ObjectToken.cs
- ParallelEnumerable.cs
- ConfigurationStrings.cs
- NullExtension.cs
- MaskInputRejectedEventArgs.cs
- SafeFileHandle.cs
- AutomationPropertyInfo.cs
- PeerToPeerException.cs
- JsonServiceDocumentSerializer.cs
- Vertex.cs
- ScriptingAuthenticationServiceSection.cs
- COM2IDispatchConverter.cs
- LogicalExpr.cs
- TypeUtils.cs
- WebPartConnectionsCancelVerb.cs
- SByteStorage.cs
- TextEditorCopyPaste.cs
- SerializerDescriptor.cs
- DateTimeOffsetStorage.cs
- LabelLiteral.cs
- AutoGeneratedField.cs
- ClientWindowsAuthenticationMembershipProvider.cs