Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Misc / GDI / WindowsSolidBrush.cs / 1305376 / WindowsSolidBrush.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- #if [....]_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; using System.Runtime.Versioning; #if [....]_PUBLIC_GRAPHICS_LIBRARY public #else internal #endif sealed class WindowsSolidBrush : WindowsBrush { [ResourceExposure(ResourceScope.Process)] [ResourceConsumption(ResourceScope.Process)] 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. } [ResourceExposure(ResourceScope.Process)] [ResourceConsumption(ResourceScope.Process)] public WindowsSolidBrush(DeviceContext dc) : base(dc) { // CreateBrush() on demand. } [ResourceExposure(ResourceScope.Process)] [ResourceConsumption(ResourceScope.Process)] public WindowsSolidBrush(DeviceContext dc, Color color) : base( dc, color ) { // CreateBrush() on demand. } [ResourceExposure(ResourceScope.Process)] [ResourceConsumption(ResourceScope.Process)] 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ProfileGroupSettingsCollection.cs
- AudioSignalProblemOccurredEventArgs.cs
- TextDecorationCollection.cs
- GroupBoxAutomationPeer.cs
- IteratorDescriptor.cs
- ControlDesignerState.cs
- WebPartActionVerb.cs
- WebServiceClientProxyGenerator.cs
- StreamMarshaler.cs
- PointAnimationClockResource.cs
- MediaSystem.cs
- EnumerableCollectionView.cs
- ContextMarshalException.cs
- IisNotInstalledException.cs
- SqlProvider.cs
- CharConverter.cs
- InternalCache.cs
- Token.cs
- Page.cs
- MonthCalendar.cs
- NativeMethods.cs
- Command.cs
- LayoutUtils.cs
- EncoderReplacementFallback.cs
- TextProviderWrapper.cs
- IncrementalHitTester.cs
- XmlNotation.cs
- CodeAttributeDeclarationCollection.cs
- SmtpFailedRecipientsException.cs
- InternalRelationshipCollection.cs
- TextEditorSelection.cs
- StringResourceManager.cs
- SQLUtility.cs
- HttpListenerResponse.cs
- ProxyHwnd.cs
- InputBindingCollection.cs
- UrlMappingsSection.cs
- TraceContextRecord.cs
- BitmapEffectGroup.cs
- WorkflowInstanceUnhandledExceptionRecord.cs
- WebEvents.cs
- IgnoreSectionHandler.cs
- IntegrationExceptionEventArgs.cs
- ApplicationDirectoryMembershipCondition.cs
- DocumentPage.cs
- SecurityRuntime.cs
- DBBindings.cs
- BrowserCapabilitiesFactoryBase.cs
- GZipStream.cs
- ServicePointManagerElement.cs
- EventDescriptorCollection.cs
- AnimationStorage.cs
- RichTextBoxConstants.cs
- InternalRelationshipCollection.cs
- AssemblyHash.cs
- StreamWriter.cs
- IntegerValidatorAttribute.cs
- SByteConverter.cs
- ObjectToken.cs
- LongValidatorAttribute.cs
- TrackingAnnotationCollection.cs
- SplineKeyFrames.cs
- _ServiceNameStore.cs
- ErrorWebPart.cs
- CheckBoxPopupAdapter.cs
- DotAtomReader.cs
- StorageSetMapping.cs
- Vars.cs
- WebEventCodes.cs
- ADRoleFactory.cs
- RequestCacheValidator.cs
- NotifyIcon.cs
- FloaterBaseParaClient.cs
- RectAnimation.cs
- FormsAuthenticationUserCollection.cs
- LicenseManager.cs
- EpmSourceTree.cs
- LocalizableAttribute.cs
- GridItem.cs
- RawStylusActions.cs
- CapiSymmetricAlgorithm.cs
- DisplayNameAttribute.cs
- NamespaceEmitter.cs
- dtdvalidator.cs
- DrawingBrush.cs
- ChannelHandler.cs
- RootBrowserWindow.cs
- FilteredXmlReader.cs
- BufferedGenericXmlSecurityToken.cs
- GeometryCollection.cs
- CollaborationHelperFunctions.cs
- UpdatableWrapper.cs
- PathData.cs
- PtsCache.cs
- TableRow.cs
- ProfileService.cs
- OLEDB_Util.cs
- SiteOfOriginPart.cs
- Attribute.cs
- CommandExpr.cs