Code:
/ FX-1434 / FX-1434 / 1.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
- DataGridViewRowEventArgs.cs
- DataServiceQueryOfT.cs
- TCEAdapterGenerator.cs
- HelpInfo.cs
- RuntimeArgument.cs
- SliderAutomationPeer.cs
- ClientConvert.cs
- LineSegment.cs
- NumberFormatter.cs
- DebugManager.cs
- SerializerWriterEventHandlers.cs
- WeakReference.cs
- ItemAutomationPeer.cs
- UnhandledExceptionEventArgs.cs
- ThemeableAttribute.cs
- XmlAttribute.cs
- QuotedPrintableStream.cs
- WindowsFormsEditorServiceHelper.cs
- WindowVisualStateTracker.cs
- RegistryKey.cs
- WebScriptMetadataFormatter.cs
- HTMLTextWriter.cs
- ToolStripSeparator.cs
- SafeSecurityHandles.cs
- DateTimeConverter.cs
- UserPersonalizationStateInfo.cs
- SignatureResourcePool.cs
- TextSelectionProcessor.cs
- WindowsScrollBar.cs
- FloatUtil.cs
- DBSchemaRow.cs
- ThreadInterruptedException.cs
- LostFocusEventManager.cs
- LayoutManager.cs
- DataBoundControl.cs
- DCSafeHandle.cs
- HttpSysSettings.cs
- TargetFrameworkAttribute.cs
- LocalizedNameDescriptionPair.cs
- SqlResolver.cs
- PolyLineSegment.cs
- ChildTable.cs
- MissingMethodException.cs
- SHA384CryptoServiceProvider.cs
- Guid.cs
- GraphicsContainer.cs
- ComplexLine.cs
- updateconfighost.cs
- MemberExpressionHelper.cs
- LinqDataSourceStatusEventArgs.cs
- CriticalHandle.cs
- XamlTreeBuilderBamlRecordWriter.cs
- DependencySource.cs
- SmiContext.cs
- TargetControlTypeCache.cs
- IdentityManager.cs
- ValidatingPropertiesEventArgs.cs
- RepeaterItemCollection.cs
- DataGridViewSelectedRowCollection.cs
- ExternalFile.cs
- XamlClipboardData.cs
- InstallerTypeAttribute.cs
- QueueProcessor.cs
- MatrixStack.cs
- SystemFonts.cs
- WsatAdminException.cs
- SqlStream.cs
- SqlServices.cs
- AsyncCallback.cs
- TypeUtils.cs
- XmlHierarchyData.cs
- ResXResourceReader.cs
- UpdatePanel.cs
- BackgroundFormatInfo.cs
- SafeWaitHandle.cs
- ObjectSet.cs
- TransformPattern.cs
- ConditionedDesigner.cs
- DesignerVerb.cs
- Metadata.cs
- MetadataCache.cs
- TimeoutValidationAttribute.cs
- Tile.cs
- TrackBarRenderer.cs
- autovalidator.cs
- UnsafeNativeMethods.cs
- StateInitialization.cs
- ColorConverter.cs
- MergeFailedEvent.cs
- pingexception.cs
- PointCollection.cs
- ServiceNameElement.cs
- ListViewEditEventArgs.cs
- ConstraintManager.cs
- DateTimeConverter2.cs
- CellPartitioner.cs
- AutoGeneratedField.cs
- SystemPens.cs
- AnonymousIdentificationModule.cs
- FreezableDefaultValueFactory.cs