Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / wpf / src / Core / CSharp / System / Windows / Media / Generated / DashStyle.cs / 1 / DashStyle.cs
//---------------------------------------------------------------------------- // //// Copyright (C) Microsoft Corporation. All rights reserved. // // // This file was generated, please do not edit it directly. // // Please see http://wiki/default.aspx/Microsoft.Projects.Avalon/MilCodeGen.html for more information. // //--------------------------------------------------------------------------- using MS.Internal; using MS.Internal.KnownBoxes; using MS.Internal.Collections; using MS.Internal.PresentationCore; using MS.Utility; using System; using System.Collections; using System.Collections.Generic; using System.ComponentModel; using System.Diagnostics; using System.Globalization; using System.Reflection; using System.Runtime.InteropServices; using System.ComponentModel.Design.Serialization; using System.Text; using System.Windows; using System.Windows.Media; using System.Windows.Media.Effects; using System.Windows.Media.Media3D; using System.Windows.Media.Animation; using System.Windows.Media.Composition; using System.Windows.Media.Imaging; using System.Windows.Markup; using System.Windows.Media.Converters; using System.Security; using System.Security.Permissions; using SR=MS.Internal.PresentationCore.SR; using SRID=MS.Internal.PresentationCore.SRID; // These types are aliased to match the unamanaged names used in interop using BOOL = System.UInt32; using WORD = System.UInt16; using Float = System.Single; namespace System.Windows.Media { sealed partial class DashStyle : Animatable, DUCE.IResource { //----------------------------------------------------- // // Public Methods // //----------------------------------------------------- #region Public Methods ////// Shadows inherited Clone() with a strongly typed /// version for convenience. /// public new DashStyle Clone() { return (DashStyle)base.Clone(); } ////// Shadows inherited CloneCurrentValue() with a strongly typed /// version for convenience. /// public new DashStyle CloneCurrentValue() { return (DashStyle)base.CloneCurrentValue(); } #endregion Public Methods //------------------------------------------------------ // // Public Properties // //----------------------------------------------------- private static void OffsetPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { DashStyle target = ((DashStyle) d); target.PropertyChanged(OffsetProperty); } private static void DashesPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { DashStyle target = ((DashStyle) d); target.PropertyChanged(DashesProperty); } #region Public Properties ////// Offset - double. Default value is 0.0. /// public double Offset { get { return (double) GetValue(OffsetProperty); } set { SetValueInternal(OffsetProperty, value); } } ////// Dashes - DoubleCollection. Default value is new FreezableDefaultValueFactory(DoubleCollection.Empty). /// public DoubleCollection Dashes { get { return (DoubleCollection) GetValue(DashesProperty); } set { SetValueInternal(DashesProperty, value); } } #endregion Public Properties //------------------------------------------------------ // // Protected Methods // //------------------------------------------------------ #region Protected Methods ////// Implementation of ///Freezable.CreateInstanceCore . ///The new Freezable. protected override Freezable CreateInstanceCore() { return new DashStyle(); } #endregion ProtectedMethods //----------------------------------------------------- // // Internal Methods // //------------------------------------------------------ #region Internal Methods ////// Critical: This code calls into an unsafe code block /// TreatAsSafe: This code does not return any critical data.It is ok to expose /// Channels are safe to call into and do not go cross domain and cross process /// [SecurityCritical,SecurityTreatAsSafe] internal override void UpdateResource(DUCE.Channel channel, bool skipOnChannelCheck) { // If we're told we can skip the channel check, then we must be on channel Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); if (skipOnChannelCheck || _duceResource.IsOnChannel(channel)) { base.UpdateResource(channel, skipOnChannelCheck); // Read values of properties into local variables DoubleCollection vDashes = Dashes; // Obtain handles for animated properties DUCE.ResourceHandle hOffsetAnimations = GetAnimationResourceHandle(OffsetProperty, channel); // Store the count of this resource's contained collections in local variables. int DashesCount = (vDashes == null) ? 0 : vDashes.Count; // Pack & send command packet DUCE.MILCMD_DASHSTYLE data; unsafe { data.Type = MILCMD.MilCmdDashStyle; data.Handle = _duceResource.GetHandle(channel); if (hOffsetAnimations.IsNull) { data.Offset = Offset; } data.hOffsetAnimations = hOffsetAnimations; data.DashesSize = (uint)(sizeof(Double) * DashesCount); channel.BeginCommand( (byte*)&data, sizeof(DUCE.MILCMD_DASHSTYLE), (int)(data.DashesSize) ); // Copy this collection's elements (or their handles) to reserved data for(int i = 0; i < DashesCount; i++) { Double resource = vDashes.Internal_GetItem(i); channel.AppendCommandData( (byte*)&resource, sizeof(Double) ); } channel.EndCommand(); } } } DUCE.ResourceHandle DUCE.IResource.AddRefOnChannel(DUCE.Channel channel) { using (CompositionEngineLock.Acquire()) { if (_duceResource.CreateOrAddRefOnChannel(channel, System.Windows.Media.Composition.DUCE.ResourceType.TYPE_DASHSTYLE)) { AddRefOnChannelAnimations(channel); UpdateResource(channel, true /* skip "on channel" check - we already know that we're on channel */ ); } return _duceResource.GetHandle(channel); } } void DUCE.IResource.ReleaseOnChannel(DUCE.Channel channel) { using (CompositionEngineLock.Acquire()) { Debug.Assert(_duceResource.IsOnChannel(channel)); if (_duceResource.ReleaseOnChannel(channel)) { ReleaseOnChannelAnimations(channel); } } } DUCE.ResourceHandle DUCE.IResource.GetHandle(DUCE.Channel channel) { DUCE.ResourceHandle h; // Reconsider the need for this lock when removing the MultiChannelResource. using (CompositionEngineLock.Acquire()) { h = _duceResource.GetHandle(channel); } return h; } int DUCE.IResource.GetChannelCount() { // must already be in composition lock here return _duceResource.GetChannelCount(); } DUCE.Channel DUCE.IResource.GetChannel(int index) { // in a lock already return _duceResource.GetChannel(index); } #endregion Internal Methods //----------------------------------------------------- // // Internal Properties // //----------------------------------------------------- #region Internal Properties // // This property finds the correct initial size for the _effectiveValues store on the // current DependencyObject as a performance optimization // // This includes: // Dashes // internal override int EffectiveValuesInitialSize { get { return 1; } } #endregion Internal Properties //----------------------------------------------------- // // Dependency Properties // //------------------------------------------------------ #region Dependency Properties ////// The DependencyProperty for the DashStyle.Offset property. /// public static readonly DependencyProperty OffsetProperty; ////// The DependencyProperty for the DashStyle.Dashes property. /// public static readonly DependencyProperty DashesProperty; #endregion Dependency Properties //----------------------------------------------------- // // Internal Fields // //------------------------------------------------------ #region Internal Fields internal System.Windows.Media.Composition.DUCE.MultiChannelResource _duceResource = new System.Windows.Media.Composition.DUCE.MultiChannelResource(); internal const double c_Offset = 0.0; internal static DoubleCollection s_Dashes = DoubleCollection.Empty; #endregion Internal Fields #region Constructors //------------------------------------------------------ // // Constructors // //----------------------------------------------------- static DashStyle() { // We check our static default fields which are of type Freezable // to make sure that they are not mutable, otherwise we will throw // if these get touched by more than one thread in the lifetime // of your app. (Windows OS Bug #947272) // Debug.Assert(s_Dashes == null || s_Dashes.IsFrozen, "Detected context bound default value DashStyle.s_Dashes (See OS Bug #947272)."); // Initializations Type typeofThis = typeof(DashStyle); OffsetProperty = RegisterProperty("Offset", typeof(double), typeofThis, 0.0, new PropertyChangedCallback(OffsetPropertyChanged), null, /* isIndependentlyAnimated = */ true, /* coerceValueCallback */ null); DashesProperty = RegisterProperty("Dashes", typeof(DoubleCollection), typeofThis, new FreezableDefaultValueFactory(DoubleCollection.Empty), new PropertyChangedCallback(DashesPropertyChanged), null, /* isIndependentlyAnimated = */ false, /* coerceValueCallback */ null); } #endregion Constructors } } // 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. // // // This file was generated, please do not edit it directly. // // Please see http://wiki/default.aspx/Microsoft.Projects.Avalon/MilCodeGen.html for more information. // //--------------------------------------------------------------------------- using MS.Internal; using MS.Internal.KnownBoxes; using MS.Internal.Collections; using MS.Internal.PresentationCore; using MS.Utility; using System; using System.Collections; using System.Collections.Generic; using System.ComponentModel; using System.Diagnostics; using System.Globalization; using System.Reflection; using System.Runtime.InteropServices; using System.ComponentModel.Design.Serialization; using System.Text; using System.Windows; using System.Windows.Media; using System.Windows.Media.Effects; using System.Windows.Media.Media3D; using System.Windows.Media.Animation; using System.Windows.Media.Composition; using System.Windows.Media.Imaging; using System.Windows.Markup; using System.Windows.Media.Converters; using System.Security; using System.Security.Permissions; using SR=MS.Internal.PresentationCore.SR; using SRID=MS.Internal.PresentationCore.SRID; // These types are aliased to match the unamanaged names used in interop using BOOL = System.UInt32; using WORD = System.UInt16; using Float = System.Single; namespace System.Windows.Media { sealed partial class DashStyle : Animatable, DUCE.IResource { //----------------------------------------------------- // // Public Methods // //----------------------------------------------------- #region Public Methods ////// Shadows inherited Clone() with a strongly typed /// version for convenience. /// public new DashStyle Clone() { return (DashStyle)base.Clone(); } ////// Shadows inherited CloneCurrentValue() with a strongly typed /// version for convenience. /// public new DashStyle CloneCurrentValue() { return (DashStyle)base.CloneCurrentValue(); } #endregion Public Methods //------------------------------------------------------ // // Public Properties // //----------------------------------------------------- private static void OffsetPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { DashStyle target = ((DashStyle) d); target.PropertyChanged(OffsetProperty); } private static void DashesPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { DashStyle target = ((DashStyle) d); target.PropertyChanged(DashesProperty); } #region Public Properties ////// Offset - double. Default value is 0.0. /// public double Offset { get { return (double) GetValue(OffsetProperty); } set { SetValueInternal(OffsetProperty, value); } } ////// Dashes - DoubleCollection. Default value is new FreezableDefaultValueFactory(DoubleCollection.Empty). /// public DoubleCollection Dashes { get { return (DoubleCollection) GetValue(DashesProperty); } set { SetValueInternal(DashesProperty, value); } } #endregion Public Properties //------------------------------------------------------ // // Protected Methods // //------------------------------------------------------ #region Protected Methods ////// Implementation of ///Freezable.CreateInstanceCore . ///The new Freezable. protected override Freezable CreateInstanceCore() { return new DashStyle(); } #endregion ProtectedMethods //----------------------------------------------------- // // Internal Methods // //------------------------------------------------------ #region Internal Methods ////// Critical: This code calls into an unsafe code block /// TreatAsSafe: This code does not return any critical data.It is ok to expose /// Channels are safe to call into and do not go cross domain and cross process /// [SecurityCritical,SecurityTreatAsSafe] internal override void UpdateResource(DUCE.Channel channel, bool skipOnChannelCheck) { // If we're told we can skip the channel check, then we must be on channel Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); if (skipOnChannelCheck || _duceResource.IsOnChannel(channel)) { base.UpdateResource(channel, skipOnChannelCheck); // Read values of properties into local variables DoubleCollection vDashes = Dashes; // Obtain handles for animated properties DUCE.ResourceHandle hOffsetAnimations = GetAnimationResourceHandle(OffsetProperty, channel); // Store the count of this resource's contained collections in local variables. int DashesCount = (vDashes == null) ? 0 : vDashes.Count; // Pack & send command packet DUCE.MILCMD_DASHSTYLE data; unsafe { data.Type = MILCMD.MilCmdDashStyle; data.Handle = _duceResource.GetHandle(channel); if (hOffsetAnimations.IsNull) { data.Offset = Offset; } data.hOffsetAnimations = hOffsetAnimations; data.DashesSize = (uint)(sizeof(Double) * DashesCount); channel.BeginCommand( (byte*)&data, sizeof(DUCE.MILCMD_DASHSTYLE), (int)(data.DashesSize) ); // Copy this collection's elements (or their handles) to reserved data for(int i = 0; i < DashesCount; i++) { Double resource = vDashes.Internal_GetItem(i); channel.AppendCommandData( (byte*)&resource, sizeof(Double) ); } channel.EndCommand(); } } } DUCE.ResourceHandle DUCE.IResource.AddRefOnChannel(DUCE.Channel channel) { using (CompositionEngineLock.Acquire()) { if (_duceResource.CreateOrAddRefOnChannel(channel, System.Windows.Media.Composition.DUCE.ResourceType.TYPE_DASHSTYLE)) { AddRefOnChannelAnimations(channel); UpdateResource(channel, true /* skip "on channel" check - we already know that we're on channel */ ); } return _duceResource.GetHandle(channel); } } void DUCE.IResource.ReleaseOnChannel(DUCE.Channel channel) { using (CompositionEngineLock.Acquire()) { Debug.Assert(_duceResource.IsOnChannel(channel)); if (_duceResource.ReleaseOnChannel(channel)) { ReleaseOnChannelAnimations(channel); } } } DUCE.ResourceHandle DUCE.IResource.GetHandle(DUCE.Channel channel) { DUCE.ResourceHandle h; // Reconsider the need for this lock when removing the MultiChannelResource. using (CompositionEngineLock.Acquire()) { h = _duceResource.GetHandle(channel); } return h; } int DUCE.IResource.GetChannelCount() { // must already be in composition lock here return _duceResource.GetChannelCount(); } DUCE.Channel DUCE.IResource.GetChannel(int index) { // in a lock already return _duceResource.GetChannel(index); } #endregion Internal Methods //----------------------------------------------------- // // Internal Properties // //----------------------------------------------------- #region Internal Properties // // This property finds the correct initial size for the _effectiveValues store on the // current DependencyObject as a performance optimization // // This includes: // Dashes // internal override int EffectiveValuesInitialSize { get { return 1; } } #endregion Internal Properties //----------------------------------------------------- // // Dependency Properties // //------------------------------------------------------ #region Dependency Properties ////// The DependencyProperty for the DashStyle.Offset property. /// public static readonly DependencyProperty OffsetProperty; ////// The DependencyProperty for the DashStyle.Dashes property. /// public static readonly DependencyProperty DashesProperty; #endregion Dependency Properties //----------------------------------------------------- // // Internal Fields // //------------------------------------------------------ #region Internal Fields internal System.Windows.Media.Composition.DUCE.MultiChannelResource _duceResource = new System.Windows.Media.Composition.DUCE.MultiChannelResource(); internal const double c_Offset = 0.0; internal static DoubleCollection s_Dashes = DoubleCollection.Empty; #endregion Internal Fields #region Constructors //------------------------------------------------------ // // Constructors // //----------------------------------------------------- static DashStyle() { // We check our static default fields which are of type Freezable // to make sure that they are not mutable, otherwise we will throw // if these get touched by more than one thread in the lifetime // of your app. (Windows OS Bug #947272) // Debug.Assert(s_Dashes == null || s_Dashes.IsFrozen, "Detected context bound default value DashStyle.s_Dashes (See OS Bug #947272)."); // Initializations Type typeofThis = typeof(DashStyle); OffsetProperty = RegisterProperty("Offset", typeof(double), typeofThis, 0.0, new PropertyChangedCallback(OffsetPropertyChanged), null, /* isIndependentlyAnimated = */ true, /* coerceValueCallback */ null); DashesProperty = RegisterProperty("Dashes", typeof(DoubleCollection), typeofThis, new FreezableDefaultValueFactory(DoubleCollection.Empty), new PropertyChangedCallback(DashesPropertyChanged), null, /* isIndependentlyAnimated = */ false, /* coerceValueCallback */ null); } #endregion Constructors } } // 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
- RoleManagerModule.cs
- Help.cs
- PersonalizationAdministration.cs
- TreeNodeEventArgs.cs
- DataContext.cs
- CalculatedColumn.cs
- _NTAuthentication.cs
- PackWebRequest.cs
- BinaryCommonClasses.cs
- ValidatedControlConverter.cs
- AxisAngleRotation3D.cs
- MetadataCache.cs
- InitiatorSessionSymmetricTransportSecurityProtocol.cs
- ListViewDeleteEventArgs.cs
- ThicknessAnimationBase.cs
- BitmapEncoder.cs
- SHA512.cs
- TypeGeneratedEventArgs.cs
- CodeDefaultValueExpression.cs
- MimeWriter.cs
- ViewGenerator.cs
- EncoderBestFitFallback.cs
- QueryCursorEventArgs.cs
- Parser.cs
- VBIdentifierDesigner.xaml.cs
- DynamicQueryableWrapper.cs
- _Rfc2616CacheValidators.cs
- CreateUserErrorEventArgs.cs
- HitTestWithPointDrawingContextWalker.cs
- ModuleConfigurationInfo.cs
- MediaElementAutomationPeer.cs
- PeerNameResolver.cs
- _HTTPDateParse.cs
- Int16.cs
- HostProtectionException.cs
- MatrixAnimationUsingKeyFrames.cs
- _BaseOverlappedAsyncResult.cs
- ZoneButton.cs
- QilXmlWriter.cs
- WeakReferenceEnumerator.cs
- WebPartVerbCollection.cs
- localization.cs
- XmlArrayItemAttributes.cs
- Encoding.cs
- MemberDescriptor.cs
- SQLByte.cs
- EdmValidator.cs
- HttpCookiesSection.cs
- DataGridViewCellStyleEditor.cs
- SourceInterpreter.cs
- Facet.cs
- SimpleFieldTemplateFactory.cs
- HttpCapabilitiesEvaluator.cs
- ProcessHostServerConfig.cs
- ConfigXmlComment.cs
- EncryptedReference.cs
- DataGridViewColumn.cs
- LockCookie.cs
- OpacityConverter.cs
- ParameterCollection.cs
- WpfWebRequestHelper.cs
- SqlBulkCopyColumnMapping.cs
- MemberAssignment.cs
- TextClipboardData.cs
- InvokeMemberBinder.cs
- ScaleTransform3D.cs
- NegationPusher.cs
- ToolStripInSituService.cs
- TransformedBitmap.cs
- _HTTPDateParse.cs
- Condition.cs
- ByteAnimationBase.cs
- DoubleAnimationClockResource.cs
- SubstitutionResponseElement.cs
- _AutoWebProxyScriptEngine.cs
- ValuePatternIdentifiers.cs
- BmpBitmapDecoder.cs
- URL.cs
- Triplet.cs
- StringValidatorAttribute.cs
- SecurityIdentifierElementCollection.cs
- SHA1Managed.cs
- MenuItemCollectionEditorDialog.cs
- TypedAsyncResult.cs
- WebPartUserCapability.cs
- JsonClassDataContract.cs
- EnumBuilder.cs
- SqlErrorCollection.cs
- LogicalExpr.cs
- WizardPanelChangingEventArgs.cs
- ListViewGroupConverter.cs
- RNGCryptoServiceProvider.cs
- HitTestWithGeometryDrawingContextWalker.cs
- ExpressionBuilderCollection.cs
- MatrixAnimationBase.cs
- _ReceiveMessageOverlappedAsyncResult.cs
- TextReader.cs
- XmlSchemaExternal.cs
- CultureInfo.cs
- NotConverter.cs