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
- ValidateNames.cs
- Identity.cs
- LoadRetryConstantStrategy.cs
- DetailsViewDeleteEventArgs.cs
- HMAC.cs
- EncoderFallback.cs
- ConstructorBuilder.cs
- MsmqActivation.cs
- WorkflowExecutor.cs
- CompilationSection.cs
- DataException.cs
- Component.cs
- XmlProcessingInstruction.cs
- HotCommands.cs
- XpsFilter.cs
- Cell.cs
- ResourceManagerWrapper.cs
- ControlBindingsCollection.cs
- HttpCookie.cs
- RuleSettingsCollection.cs
- TypeSystem.cs
- DBPropSet.cs
- SystemIcmpV6Statistics.cs
- SerializationUtility.cs
- OptimalTextSource.cs
- UriSection.cs
- ErrorsHelper.cs
- IndexedSelectQueryOperator.cs
- ComplexPropertyEntry.cs
- DocumentXmlWriter.cs
- HttpGetServerProtocol.cs
- OdbcDataAdapter.cs
- SqlDataAdapter.cs
- WebEvents.cs
- SoapHeaders.cs
- XD.cs
- Message.cs
- ObjectConverter.cs
- TemplateFactory.cs
- UnsafePeerToPeerMethods.cs
- CurrentTimeZone.cs
- HealthMonitoringSectionHelper.cs
- RootProjectionNode.cs
- Image.cs
- DefaultEvaluationContext.cs
- TextDecorations.cs
- PngBitmapDecoder.cs
- BamlTreeUpdater.cs
- OdbcCommandBuilder.cs
- __Filters.cs
- RadioButtonList.cs
- SessionIDManager.cs
- Profiler.cs
- DataGridViewAutoSizeModeEventArgs.cs
- MasterPage.cs
- EnumConverter.cs
- Metadata.cs
- TargetConverter.cs
- IPAddressCollection.cs
- CursorInteropHelper.cs
- WindowsFormsHostPropertyMap.cs
- ScrollEvent.cs
- SamlSubjectStatement.cs
- WebPartsPersonalization.cs
- CheckBoxField.cs
- PrintSchema.cs
- sqlstateclientmanager.cs
- InkCanvasInnerCanvas.cs
- XPathSelectionIterator.cs
- Matrix3D.cs
- NumericPagerField.cs
- TaiwanCalendar.cs
- XPathParser.cs
- WindowProviderWrapper.cs
- SHA384Managed.cs
- ArrayList.cs
- CommentAction.cs
- CompatibleComparer.cs
- EtwTrackingBehavior.cs
- PermissionToken.cs
- ModifiableIteratorCollection.cs
- Base64Stream.cs
- GroupBox.cs
- ClientSettingsSection.cs
- XslCompiledTransform.cs
- SqlFlattener.cs
- SpeechSynthesizer.cs
- LocatorManager.cs
- DiscoveryViaBehavior.cs
- ISFTagAndGuidCache.cs
- RadioButtonAutomationPeer.cs
- WebBrowserUriTypeConverter.cs
- LocalizabilityAttribute.cs
- FileDialogPermission.cs
- PipelineModuleStepContainer.cs
- XmlEntity.cs
- CookielessData.cs
- RoutedEvent.cs
- ApplicationServiceHelper.cs
- Graph.cs