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
- BindingContext.cs
- RegexCaptureCollection.cs
- SqlDependency.cs
- DataBoundLiteralControl.cs
- InstanceOwnerQueryResult.cs
- ConfigXmlText.cs
- ProfileService.cs
- PersonalizationAdministration.cs
- XomlCompilerHelpers.cs
- IProvider.cs
- BaseValidator.cs
- UMPAttributes.cs
- InplaceBitmapMetadataWriter.cs
- FilterElement.cs
- ParallelSeparator.xaml.cs
- Internal.cs
- CheckedListBox.cs
- Dynamic.cs
- GrammarBuilderDictation.cs
- ProjectedWrapper.cs
- OdbcCommandBuilder.cs
- KeyConverter.cs
- TableSectionStyle.cs
- FileDialogPermission.cs
- HttpResponse.cs
- SmiGettersStream.cs
- ScaleTransform.cs
- CodeIdentifiers.cs
- SafeRightsManagementHandle.cs
- SizeAnimationBase.cs
- TypeForwardedToAttribute.cs
- RepeaterItemCollection.cs
- CodeEntryPointMethod.cs
- ProfileServiceManager.cs
- Tuple.cs
- DLinqDataModelProvider.cs
- webproxy.cs
- InkCanvasSelection.cs
- AssertSection.cs
- ExchangeUtilities.cs
- TextSimpleMarkerProperties.cs
- SslStream.cs
- ToolStripCustomTypeDescriptor.cs
- DisableDpiAwarenessAttribute.cs
- Dynamic.cs
- IsolatedStorageFile.cs
- safesecurityhelperavalon.cs
- FormatControl.cs
- ConnectionConsumerAttribute.cs
- SoundPlayerAction.cs
- XmlILAnnotation.cs
- UnsafeNativeMethods.cs
- OdbcInfoMessageEvent.cs
- DataBindingExpressionBuilder.cs
- Color.cs
- ProcessThreadCollection.cs
- DataRelationPropertyDescriptor.cs
- CryptoKeySecurity.cs
- ReferenceSchema.cs
- Converter.cs
- NetStream.cs
- ClusterRegistryConfigurationProvider.cs
- MouseDevice.cs
- ItemType.cs
- NotificationContext.cs
- ButtonChrome.cs
- IPipelineRuntime.cs
- QueryableDataSource.cs
- OutputScopeManager.cs
- ExceptionUtil.cs
- DataGridViewRowsAddedEventArgs.cs
- XmlSchemaException.cs
- AVElementHelper.cs
- PageCatalogPartDesigner.cs
- IDispatchConstantAttribute.cs
- _DigestClient.cs
- MobileRedirect.cs
- DependencyPropertyHelper.cs
- SemanticAnalyzer.cs
- WorkflowRuntime.cs
- DrawToolTipEventArgs.cs
- CaretElement.cs
- dataSvcMapFileLoader.cs
- ConfigurationStrings.cs
- BindingOperations.cs
- WizardPanel.cs
- localization.cs
- XmlQualifiedName.cs
- CompilationSection.cs
- HandledEventArgs.cs
- ClipboardData.cs
- StatusCommandUI.cs
- Attributes.cs
- CodeCommentStatementCollection.cs
- initElementDictionary.cs
- Pair.cs
- SByte.cs
- SourceItem.cs
- WebMethodAttribute.cs
- Nodes.cs