Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / wpf / src / Core / CSharp / System / Windows / Media / Brush.cs / 2 / 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 : adsmith - 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 MS.Internal.Serialization; 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 Realization Support ////// Derived classes must override this method and update realizations on dependent /// resources if required. /// internal virtual void UpdateRealizations(Rect fillShapeBounds, RealizationContext ctx) { return; } #endregion #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.EnglishUSCulture, context); if ((brush != null) && (freezer != null)) { 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 : adsmith - 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 MS.Internal.Serialization; 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 Realization Support ////// Derived classes must override this method and update realizations on dependent /// resources if required. /// internal virtual void UpdateRealizations(Rect fillShapeBounds, RealizationContext ctx) { return; } #endregion #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.EnglishUSCulture, context); if ((brush != null) && (freezer != null)) { 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
- WeakReadOnlyCollection.cs
- ClrPerspective.cs
- MediaScriptCommandRoutedEventArgs.cs
- BoundColumn.cs
- ContextBase.cs
- CardSpaceSelector.cs
- MsmqIntegrationAppDomainProtocolHandler.cs
- PathSegment.cs
- NativeMethods.cs
- Expr.cs
- ListViewAutomationPeer.cs
- GridViewHeaderRowPresenter.cs
- OpCodes.cs
- ProcessHostConfigUtils.cs
- MultilineStringEditor.cs
- UriTemplateTableMatchCandidate.cs
- IndicCharClassifier.cs
- FlowDocumentReaderAutomationPeer.cs
- FrameworkEventSource.cs
- ListBoxItemAutomationPeer.cs
- ParameterReplacerVisitor.cs
- StreamingContext.cs
- MaskInputRejectedEventArgs.cs
- PagedDataSource.cs
- WpfWebRequestHelper.cs
- DocumentAutomationPeer.cs
- BitmapEffectCollection.cs
- TextRangeEditTables.cs
- DynamicActionMessageFilter.cs
- SymLanguageType.cs
- MemberHolder.cs
- Filter.cs
- ToolStripManager.cs
- sqlnorm.cs
- EpmHelper.cs
- TableLayoutPanelResizeGlyph.cs
- StylusPointPropertyUnit.cs
- MouseEvent.cs
- TableSectionStyle.cs
- parserscommon.cs
- DataGridItemCollection.cs
- WindowsRebar.cs
- XmlText.cs
- DbConnectionStringBuilder.cs
- SingleKeyFrameCollection.cs
- BookmarkInfo.cs
- PreProcessor.cs
- ObjectQuery_EntitySqlExtensions.cs
- XmlStreamNodeWriter.cs
- XmlCharType.cs
- Table.cs
- Win32PrintDialog.cs
- ExpressionBuilderContext.cs
- Exceptions.cs
- DataGridItemEventArgs.cs
- CodeMemberProperty.cs
- ListArgumentProvider.cs
- XslAstAnalyzer.cs
- BadImageFormatException.cs
- Operators.cs
- AnimationClockResource.cs
- BorderGapMaskConverter.cs
- LineBreakRecord.cs
- PackWebRequestFactory.cs
- DynamicRendererThreadManager.cs
- DynamicActivity.cs
- RemotingAttributes.cs
- RepeatBehavior.cs
- ColorConvertedBitmapExtension.cs
- TraceContext.cs
- CompositeFontParser.cs
- CapacityStreamGeometryContext.cs
- XmlSubtreeReader.cs
- Mutex.cs
- MsmqIntegrationAppDomainProtocolHandler.cs
- BaseResourcesBuildProvider.cs
- WebDescriptionAttribute.cs
- GenericPrincipal.cs
- AtomEntry.cs
- SafeMemoryMappedFileHandle.cs
- HashCodeCombiner.cs
- ParserStreamGeometryContext.cs
- CommandEventArgs.cs
- FormsAuthenticationConfiguration.cs
- DynamicPropertyHolder.cs
- TextParagraphView.cs
- VisualCollection.cs
- PathGeometry.cs
- XmlSchemaSimpleType.cs
- Vars.cs
- WebPartTracker.cs
- SQLMembershipProvider.cs
- CryptoApi.cs
- RadioButtonRenderer.cs
- SqlCaseSimplifier.cs
- SmiRequestExecutor.cs
- TypeListConverter.cs
- BooleanSwitch.cs
- WebPartConnectionCollection.cs
- TagPrefixInfo.cs