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
- TextTreeInsertUndoUnit.cs
- TemplatePartAttribute.cs
- Triplet.cs
- InvalidTimeZoneException.cs
- Executor.cs
- TaskFormBase.cs
- TriggerActionCollection.cs
- StreamingContext.cs
- StandardBindingElementCollection.cs
- DisplayInformation.cs
- ISAPIApplicationHost.cs
- ObjectItemLoadingSessionData.cs
- IApplicationTrustManager.cs
- ArgIterator.cs
- ListViewGroupItemCollection.cs
- TraceListeners.cs
- UserControl.cs
- ResizeGrip.cs
- PathFigure.cs
- RequiredFieldValidator.cs
- WindowsSpinner.cs
- DetailsViewUpdateEventArgs.cs
- MultiDataTrigger.cs
- DuplicateWaitObjectException.cs
- GridViewRowCollection.cs
- SiteIdentityPermission.cs
- HttpCacheParams.cs
- InheritedPropertyChangedEventArgs.cs
- UnsafeNativeMethods.cs
- processwaithandle.cs
- XMLUtil.cs
- ReachPageContentCollectionSerializerAsync.cs
- ReadOnlyDataSourceView.cs
- Block.cs
- AuthorizationSection.cs
- RC2CryptoServiceProvider.cs
- IndexOutOfRangeException.cs
- BaseProcessor.cs
- StyleTypedPropertyAttribute.cs
- UriTemplateTable.cs
- JsonCollectionDataContract.cs
- ResourcesChangeInfo.cs
- ContourSegment.cs
- WebServiceEnumData.cs
- Enlistment.cs
- StringOutput.cs
- DataDocumentXPathNavigator.cs
- PageWrapper.cs
- WebPartDisplayMode.cs
- DispatcherEventArgs.cs
- TransformDescriptor.cs
- BrushValueSerializer.cs
- SHA384Cng.cs
- DeviceFilterEditorDialog.cs
- RootBrowserWindowAutomationPeer.cs
- UiaCoreApi.cs
- VolatileEnlistmentState.cs
- EncoderBestFitFallback.cs
- NameValueSectionHandler.cs
- Span.cs
- TextRangeSerialization.cs
- Track.cs
- ILGenerator.cs
- RenamedEventArgs.cs
- ProfessionalColorTable.cs
- CompositeFontInfo.cs
- ParameterReplacerVisitor.cs
- BitmapEffectGroup.cs
- Base64Encoder.cs
- AnnotationComponentChooser.cs
- Comparer.cs
- DataGridViewBand.cs
- StickyNoteHelper.cs
- TimelineClockCollection.cs
- XmlSignatureProperties.cs
- ProfilePropertyNameValidator.cs
- ObjectQuery.cs
- Page.cs
- DataGridViewRowCollection.cs
- ThemeInfoAttribute.cs
- StaticFileHandler.cs
- AsymmetricKeyExchangeFormatter.cs
- State.cs
- SymLanguageVendor.cs
- PipelineComponent.cs
- ListSortDescriptionCollection.cs
- WizardPanel.cs
- ObjectReaderCompiler.cs
- XmlExtensionFunction.cs
- EntityDataSourceContextDisposingEventArgs.cs
- ResourceBinder.cs
- CachedTypeface.cs
- UndoEngine.cs
- DisplayNameAttribute.cs
- SchemaObjectWriter.cs
- MsmqIntegrationAppDomainProtocolHandler.cs
- IndexedString.cs
- HwndSourceKeyboardInputSite.cs
- ElementProxy.cs
- WindowsScrollBar.cs