Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / wpf / src / Core / CSharp / System / Windows / Media / Brush.cs / 1 / 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, CultureInfo.GetCultureInfo("en-us"), 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, CultureInfo.GetCultureInfo("en-us"), 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
- ControlParameter.cs
- SettingsPropertyIsReadOnlyException.cs
- TreeView.cs
- CodeGenerator.cs
- NativeMethods.cs
- ListControlConvertEventArgs.cs
- UpdateManifestForBrowserApplication.cs
- ContentDisposition.cs
- SoapHeaders.cs
- XPathAxisIterator.cs
- OleDbConnection.cs
- TypeNameConverter.cs
- ToolStripOverflow.cs
- figurelength.cs
- CodeEntryPointMethod.cs
- SoapReflectionImporter.cs
- SiteMapDataSource.cs
- SiteMembershipCondition.cs
- ProcessHostMapPath.cs
- LinqDataSourceContextEventArgs.cs
- SafeNativeMethodsOther.cs
- EntityDataSourceValidationException.cs
- DiscoveryDocumentLinksPattern.cs
- Metafile.cs
- shaperfactory.cs
- ChangePassword.cs
- SingleStorage.cs
- ListArgumentProvider.cs
- FontCacheUtil.cs
- SecurityProtocol.cs
- PerformanceCounterManager.cs
- Vector3D.cs
- PolygonHotSpot.cs
- XmlSchemaSimpleTypeUnion.cs
- Columns.cs
- TreeViewCancelEvent.cs
- AnimatedTypeHelpers.cs
- ElementAction.cs
- FixedSOMFixedBlock.cs
- ObjectQueryProvider.cs
- safelinkcollection.cs
- AudioSignalProblemOccurredEventArgs.cs
- EntityDataSourceConfigureObjectContextPanel.cs
- Parsers.cs
- DbDataAdapter.cs
- RightNameExpirationInfoPair.cs
- GlobalizationSection.cs
- BamlLocalizationDictionary.cs
- filewebresponse.cs
- BackStopAuthenticationModule.cs
- ApplicationException.cs
- SqlDataSourceEnumerator.cs
- EDesignUtil.cs
- TypeBuilder.cs
- EntityProviderFactory.cs
- PageCodeDomTreeGenerator.cs
- ToolBarButtonDesigner.cs
- WmlLiteralTextAdapter.cs
- Component.cs
- FolderBrowserDialog.cs
- XmlLanguage.cs
- SafeFileMappingHandle.cs
- XMLUtil.cs
- EntityCommandDefinition.cs
- ModelPropertyImpl.cs
- XpsFixedDocumentSequenceReaderWriter.cs
- EditorPartCollection.cs
- BookmarkEventArgs.cs
- XmlUrlResolver.cs
- PerformanceCounterNameAttribute.cs
- XmlReflectionMember.cs
- StrongBox.cs
- BitmapEffect.cs
- TextRangeEditLists.cs
- NetworkInformationPermission.cs
- EastAsianLunisolarCalendar.cs
- URLEditor.cs
- MenuItem.cs
- ListViewGroupConverter.cs
- DeviceContext.cs
- DataGridViewRowCancelEventArgs.cs
- ZipIOExtraField.cs
- SystemSounds.cs
- ThicknessAnimation.cs
- MetadataCollection.cs
- RelationshipManager.cs
- QualifiedCellIdBoolean.cs
- QilFunction.cs
- ButtonBaseAdapter.cs
- ConsoleTraceListener.cs
- ItemCheckedEvent.cs
- TargetException.cs
- Matrix3DValueSerializer.cs
- Command.cs
- XhtmlBasicPanelAdapter.cs
- DataSet.cs
- OutputScope.cs
- MimeMapping.cs
- LambdaCompiler.Binary.cs
- CodeBinaryOperatorExpression.cs