Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Core / CSharp / System / Windows / Media / Brush.cs / 1305600 / Brush.cs
//---------------------------------------------------------------------------- // // Copyright (C) Microsoft Corporation. All rights reserved. // // File: Brush.cs // // Description: This file contains the implementation of Brush. // Brush is the abstract base class which describes how to fill // a geometric area. // // History: // 04/28/2003 : [....] - Created it. // //--------------------------------------------------------------------------- using MS.Internal; using System; using System.IO; using System.ComponentModel; using System.ComponentModel.Design.Serialization; using System.Diagnostics; using System.Globalization; using System.Runtime.InteropServices; using System.Windows; using System.Windows.Media; using System.Windows.Media.Animation; using System.Windows.Media.Composition; using System.Windows.Markup; using SR=MS.Internal.PresentationCore.SR; using SRID=MS.Internal.PresentationCore.SRID; namespace System.Windows.Media { ////// Brush - /// A brush is an object that represents a method to fill a plane. /// In addition to being able to fill a plane in an absolute way, /// Brushes are also able to adapt how they fill the plane to the /// size of the object that they are used to fill. /// [Localizability(LocalizationCategory.None, Readability=Readability.Unreadable)] public abstract partial class Brush : Animatable, IFormattable { #region Constructors ////// Protected constructor for Brush. /// Sets all values to their defaults. /// To set property values, use the constructor which accepts paramters /// protected Brush() { } #endregion Constructors #region ToString ////// Parse - this method is called by the type converter to parse a Brush's string /// (provided in "value") with the given IFormatProvider. /// ////// A Brush which was created by parsing the "value". /// /// String representation of a Brush. Cannot be null/empty. /// The ITypeDescriptorContext for this call. internal static Brush Parse(string value, ITypeDescriptorContext context) { Brush brush; IFreezeFreezables freezer = null; if (context != null) { freezer = (IFreezeFreezables)context.GetService(typeof(IFreezeFreezables)); if ((freezer != null) && freezer.FreezeFreezables) { brush = (Brush)freezer.TryGetFreezable(value); if (brush != null) { return brush; } } } brush = Parsers.ParseBrush(value, System.Windows.Markup.TypeConverterHelper.InvariantEnglishUS, context); if ((brush != null) && (freezer != null) && (freezer.FreezeFreezables)) { freezer.TryFreeze(value, brush); } return brush; } ////// Can serialze "this" to a string /// internal virtual bool CanSerializeToString() { return false; } #endregion } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. //---------------------------------------------------------------------------- // // Copyright (C) Microsoft Corporation. All rights reserved. // // File: Brush.cs // // Description: This file contains the implementation of Brush. // Brush is the abstract base class which describes how to fill // a geometric area. // // History: // 04/28/2003 : [....] - Created it. // //--------------------------------------------------------------------------- using MS.Internal; using System; using System.IO; using System.ComponentModel; using System.ComponentModel.Design.Serialization; using System.Diagnostics; using System.Globalization; using System.Runtime.InteropServices; using System.Windows; using System.Windows.Media; using System.Windows.Media.Animation; using System.Windows.Media.Composition; using System.Windows.Markup; using SR=MS.Internal.PresentationCore.SR; using SRID=MS.Internal.PresentationCore.SRID; namespace System.Windows.Media { ////// Brush - /// A brush is an object that represents a method to fill a plane. /// In addition to being able to fill a plane in an absolute way, /// Brushes are also able to adapt how they fill the plane to the /// size of the object that they are used to fill. /// [Localizability(LocalizationCategory.None, Readability=Readability.Unreadable)] public abstract partial class Brush : Animatable, IFormattable { #region Constructors ////// Protected constructor for Brush. /// Sets all values to their defaults. /// To set property values, use the constructor which accepts paramters /// protected Brush() { } #endregion Constructors #region ToString ////// Parse - this method is called by the type converter to parse a Brush's string /// (provided in "value") with the given IFormatProvider. /// ////// A Brush which was created by parsing the "value". /// /// String representation of a Brush. Cannot be null/empty. /// The ITypeDescriptorContext for this call. internal static Brush Parse(string value, ITypeDescriptorContext context) { Brush brush; IFreezeFreezables freezer = null; if (context != null) { freezer = (IFreezeFreezables)context.GetService(typeof(IFreezeFreezables)); if ((freezer != null) && freezer.FreezeFreezables) { brush = (Brush)freezer.TryGetFreezable(value); if (brush != null) { return brush; } } } brush = Parsers.ParseBrush(value, System.Windows.Markup.TypeConverterHelper.InvariantEnglishUS, context); if ((brush != null) && (freezer != null) && (freezer.FreezeFreezables)) { freezer.TryFreeze(value, brush); } return brush; } ////// Can serialze "this" to a string /// internal virtual bool CanSerializeToString() { return false; } #endregion } } // 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
- DataGridItemCollection.cs
- PlaceHolder.cs
- ExpressionList.cs
- MultilineStringConverter.cs
- EncoderParameters.cs
- HttpHostedTransportConfiguration.cs
- AppDomainManager.cs
- StrongNameHelpers.cs
- ListChangedEventArgs.cs
- PresentationTraceSources.cs
- AddInControllerImpl.cs
- MobileControl.cs
- BooleanConverter.cs
- HashSet.cs
- BaseComponentEditor.cs
- NamespaceDecl.cs
- ManifestSignatureInformation.cs
- FilterElement.cs
- SchemaNames.cs
- ChtmlTextWriter.cs
- BuildDependencySet.cs
- TouchFrameEventArgs.cs
- ContextMarshalException.cs
- DiscreteKeyFrames.cs
- DurableRuntimeValidator.cs
- SelectionEditingBehavior.cs
- HScrollProperties.cs
- GridView.cs
- Point3D.cs
- InterleavedZipPartStream.cs
- StateMachineWorkflowDesigner.cs
- CmsInterop.cs
- CurrentChangingEventArgs.cs
- EtwTrace.cs
- TargetInvocationException.cs
- SystemParameters.cs
- AspNetHostingPermission.cs
- XmlNodeChangedEventArgs.cs
- XmlWellformedWriter.cs
- __Filters.cs
- XmlNodeChangedEventArgs.cs
- Configuration.cs
- DefaultTraceListener.cs
- SystemUdpStatistics.cs
- TimeoutException.cs
- EncodingConverter.cs
- EncodedStreamFactory.cs
- FormsIdentity.cs
- Paragraph.cs
- ManagedWndProcTracker.cs
- QueryResponse.cs
- CatalogZoneBase.cs
- SafeLocalMemHandle.cs
- SqlOuterApplyReducer.cs
- RuntimeCompatibilityAttribute.cs
- CollectionConverter.cs
- ApplicationTrust.cs
- CollectionsUtil.cs
- unsafenativemethodstextservices.cs
- ProbeMatchesApril2005.cs
- _SecureChannel.cs
- wgx_exports.cs
- DataGridViewColumn.cs
- TextDecoration.cs
- MatrixTransform.cs
- SortKey.cs
- DeviceContexts.cs
- XmlDataSourceView.cs
- SrgsItemList.cs
- TimeoutTimer.cs
- ClusterSafeNativeMethods.cs
- SqlClientPermission.cs
- AlternationConverter.cs
- Point4D.cs
- TaskbarItemInfo.cs
- ServiceInfo.cs
- InstanceHandleReference.cs
- DispatcherHookEventArgs.cs
- InvokeGenerator.cs
- ButtonBaseAutomationPeer.cs
- ControlTemplate.cs
- LineBreakRecord.cs
- WebExceptionStatus.cs
- WebPartsSection.cs
- BinaryMethodMessage.cs
- XNodeNavigator.cs
- ProcessModelSection.cs
- RepeaterDesigner.cs
- ConstraintStruct.cs
- ClipboardData.cs
- IISMapPath.cs
- Delegate.cs
- DrawingBrush.cs
- SyndicationDeserializer.cs
- EntityDataSourceDataSelection.cs
- NeutralResourcesLanguageAttribute.cs
- ParameterInfo.cs
- InstanceStoreQueryResult.cs
- storepermissionattribute.cs
- TypeConverterAttribute.cs