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
- StateBag.cs
- StyleTypedPropertyAttribute.cs
- PathFigure.cs
- ResolveNameEventArgs.cs
- ReceiveActivityDesigner.cs
- GeometryGroup.cs
- LeafCellTreeNode.cs
- UrlAuthorizationModule.cs
- indexingfiltermarshaler.cs
- OrderPreservingMergeHelper.cs
- arabicshape.cs
- CatalogPart.cs
- ColumnMap.cs
- JsonSerializer.cs
- EntityContainer.cs
- GroupAggregateExpr.cs
- KeyConverter.cs
- RefreshEventArgs.cs
- StrokeCollection.cs
- ParseHttpDate.cs
- UInt16.cs
- TextDataBindingHandler.cs
- NamespaceCollection.cs
- ContainsRowNumberChecker.cs
- EventEntry.cs
- WebEncodingValidatorAttribute.cs
- DbDataAdapter.cs
- TextTabProperties.cs
- EventDescriptorCollection.cs
- GregorianCalendar.cs
- Empty.cs
- FixedTextSelectionProcessor.cs
- WindowHideOrCloseTracker.cs
- DependencyPropertyAttribute.cs
- GenericWebPart.cs
- BrushValueSerializer.cs
- HitTestParameters.cs
- TextParentUndoUnit.cs
- TokenBasedSetEnumerator.cs
- TextBox.cs
- SchemaNotation.cs
- SqlNotificationRequest.cs
- Activity.cs
- WindowsListViewScroll.cs
- RangeBaseAutomationPeer.cs
- ProfileService.cs
- ToolStripSystemRenderer.cs
- ComponentDispatcherThread.cs
- ChannelHandler.cs
- TimeZone.cs
- XPathBinder.cs
- AttributeEmitter.cs
- DiscardableAttribute.cs
- WindowsMenu.cs
- TransportConfigurationTypeElementCollection.cs
- ModelPropertyDescriptor.cs
- ActivityExecutorSurrogate.cs
- PartialList.cs
- ColorEditor.cs
- PersistenceException.cs
- CodeGeneratorOptions.cs
- CodeCatchClauseCollection.cs
- PersonalizableAttribute.cs
- XPathMultyIterator.cs
- DaylightTime.cs
- StylusPoint.cs
- NavigationPropertyEmitter.cs
- StorageConditionPropertyMapping.cs
- MachineKeyConverter.cs
- WaitingCursor.cs
- AsyncStreamReader.cs
- controlskin.cs
- PackWebRequestFactory.cs
- MessageQueueTransaction.cs
- BaseProcessor.cs
- TreeViewCancelEvent.cs
- RunWorkerCompletedEventArgs.cs
- BStrWrapper.cs
- ContextMenuAutomationPeer.cs
- GlyphInfoList.cs
- Size.cs
- HtmlShimManager.cs
- PersonalizationState.cs
- RtfToken.cs
- StylusTip.cs
- SendActivityDesigner.cs
- DebugHandleTracker.cs
- SqlLiftIndependentRowExpressions.cs
- SymbolEqualComparer.cs
- ToolStripDropTargetManager.cs
- XmlILOptimizerVisitor.cs
- Thumb.cs
- ControlLocalizer.cs
- HashCryptoHandle.cs
- DynamicRendererThreadManager.cs
- InstancePersistenceCommand.cs
- LoginCancelEventArgs.cs
- JsonClassDataContract.cs
- MembershipUser.cs
- TCPClient.cs