Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / wpf / src / Core / CSharp / System / Windows / Media / Generated / GuidelineSet.cs / 1 / GuidelineSet.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 GuidelineSet : Animatable, DUCE.IResource { //----------------------------------------------------- // // Public Methods // //----------------------------------------------------- #region Public Methods ////// Shadows inherited Clone() with a strongly typed /// version for convenience. /// public new GuidelineSet Clone() { return (GuidelineSet)base.Clone(); } ////// Shadows inherited CloneCurrentValue() with a strongly typed /// version for convenience. /// public new GuidelineSet CloneCurrentValue() { return (GuidelineSet)base.CloneCurrentValue(); } #endregion Public Methods //------------------------------------------------------ // // Public Properties // //----------------------------------------------------- private static void GuidelinesXPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { GuidelineSet target = ((GuidelineSet) d); target.PropertyChanged(GuidelinesXProperty); } private static void GuidelinesYPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { GuidelineSet target = ((GuidelineSet) d); target.PropertyChanged(GuidelinesYProperty); } private static void IsDynamicPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { GuidelineSet target = ((GuidelineSet) d); target.PropertyChanged(IsDynamicProperty); } #region Public Properties ////// GuidelinesX - DoubleCollection. Default value is new FreezableDefaultValueFactory(DoubleCollection.Empty). /// public DoubleCollection GuidelinesX { get { return (DoubleCollection) GetValue(GuidelinesXProperty); } set { SetValueInternal(GuidelinesXProperty, value); } } ////// GuidelinesY - DoubleCollection. Default value is new FreezableDefaultValueFactory(DoubleCollection.Empty). /// public DoubleCollection GuidelinesY { get { return (DoubleCollection) GetValue(GuidelinesYProperty); } set { SetValueInternal(GuidelinesYProperty, value); } } ////// IsDynamic - bool. Default value is false. /// internal bool IsDynamic { get { return (bool) GetValue(IsDynamicProperty); } set { SetValueInternal(IsDynamicProperty, BooleanBoxes.Box(value)); } } #endregion Public Properties //------------------------------------------------------ // // Protected Methods // //------------------------------------------------------ #region Protected Methods ////// Implementation of ///Freezable.CreateInstanceCore . ///The new Freezable. protected override Freezable CreateInstanceCore() { return new GuidelineSet(); } #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 vGuidelinesX = GuidelinesX; DoubleCollection vGuidelinesY = GuidelinesY; // Store the count of this resource's contained collections in local variables. int GuidelinesXCount = (vGuidelinesX == null) ? 0 : vGuidelinesX.Count; int GuidelinesYCount = (vGuidelinesY == null) ? 0 : vGuidelinesY.Count; // Pack & send command packet DUCE.MILCMD_GUIDELINESET data; unsafe { data.Type = MILCMD.MilCmdGuidelineSet; data.Handle = _duceResource.GetHandle(channel); data.GuidelinesXSize = (uint)(sizeof(Double) * GuidelinesXCount); data.GuidelinesYSize = (uint)(sizeof(Double) * GuidelinesYCount); data.IsDynamic = CompositionResourceManager.BooleanToUInt32(IsDynamic); channel.BeginCommand( (byte*)&data, sizeof(DUCE.MILCMD_GUIDELINESET), (int)(data.GuidelinesXSize + data.GuidelinesYSize) ); // Copy this collection's elements (or their handles) to reserved data for(int i = 0; i < GuidelinesXCount; i++) { Double resource = vGuidelinesX.Internal_GetItem(i); channel.AppendCommandData( (byte*)&resource, sizeof(Double) ); } // Copy this collection's elements (or their handles) to reserved data for(int i = 0; i < GuidelinesYCount; i++) { Double resource = vGuidelinesY.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_GUIDELINESET)) { 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 #endregion Internal Properties //----------------------------------------------------- // // Dependency Properties // //------------------------------------------------------ #region Dependency Properties ////// The DependencyProperty for the GuidelineSet.GuidelinesX property. /// public static readonly DependencyProperty GuidelinesXProperty; ////// The DependencyProperty for the GuidelineSet.GuidelinesY property. /// public static readonly DependencyProperty GuidelinesYProperty; ////// The DependencyProperty for the GuidelineSet.IsDynamic property. /// internal static readonly DependencyProperty IsDynamicProperty; #endregion Dependency Properties //----------------------------------------------------- // // Internal Fields // //------------------------------------------------------ #region Internal Fields internal System.Windows.Media.Composition.DUCE.MultiChannelResource _duceResource = new System.Windows.Media.Composition.DUCE.MultiChannelResource(); internal static DoubleCollection s_GuidelinesX = DoubleCollection.Empty; internal static DoubleCollection s_GuidelinesY = DoubleCollection.Empty; internal const bool c_IsDynamic = false; #endregion Internal Fields #region Constructors //------------------------------------------------------ // // Constructors // //----------------------------------------------------- static GuidelineSet() { // 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_GuidelinesX == null || s_GuidelinesX.IsFrozen, "Detected context bound default value GuidelineSet.s_GuidelinesX (See OS Bug #947272)."); Debug.Assert(s_GuidelinesY == null || s_GuidelinesY.IsFrozen, "Detected context bound default value GuidelineSet.s_GuidelinesY (See OS Bug #947272)."); // Initializations Type typeofThis = typeof(GuidelineSet); GuidelinesXProperty = RegisterProperty("GuidelinesX", typeof(DoubleCollection), typeofThis, new FreezableDefaultValueFactory(DoubleCollection.Empty), new PropertyChangedCallback(GuidelinesXPropertyChanged), null, /* isIndependentlyAnimated = */ false, /* coerceValueCallback */ null); GuidelinesYProperty = RegisterProperty("GuidelinesY", typeof(DoubleCollection), typeofThis, new FreezableDefaultValueFactory(DoubleCollection.Empty), new PropertyChangedCallback(GuidelinesYPropertyChanged), null, /* isIndependentlyAnimated = */ false, /* coerceValueCallback */ null); IsDynamicProperty = RegisterProperty("IsDynamic", typeof(bool), typeofThis, false, new PropertyChangedCallback(IsDynamicPropertyChanged), 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 GuidelineSet : Animatable, DUCE.IResource { //----------------------------------------------------- // // Public Methods // //----------------------------------------------------- #region Public Methods ////// Shadows inherited Clone() with a strongly typed /// version for convenience. /// public new GuidelineSet Clone() { return (GuidelineSet)base.Clone(); } ////// Shadows inherited CloneCurrentValue() with a strongly typed /// version for convenience. /// public new GuidelineSet CloneCurrentValue() { return (GuidelineSet)base.CloneCurrentValue(); } #endregion Public Methods //------------------------------------------------------ // // Public Properties // //----------------------------------------------------- private static void GuidelinesXPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { GuidelineSet target = ((GuidelineSet) d); target.PropertyChanged(GuidelinesXProperty); } private static void GuidelinesYPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { GuidelineSet target = ((GuidelineSet) d); target.PropertyChanged(GuidelinesYProperty); } private static void IsDynamicPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { GuidelineSet target = ((GuidelineSet) d); target.PropertyChanged(IsDynamicProperty); } #region Public Properties ////// GuidelinesX - DoubleCollection. Default value is new FreezableDefaultValueFactory(DoubleCollection.Empty). /// public DoubleCollection GuidelinesX { get { return (DoubleCollection) GetValue(GuidelinesXProperty); } set { SetValueInternal(GuidelinesXProperty, value); } } ////// GuidelinesY - DoubleCollection. Default value is new FreezableDefaultValueFactory(DoubleCollection.Empty). /// public DoubleCollection GuidelinesY { get { return (DoubleCollection) GetValue(GuidelinesYProperty); } set { SetValueInternal(GuidelinesYProperty, value); } } ////// IsDynamic - bool. Default value is false. /// internal bool IsDynamic { get { return (bool) GetValue(IsDynamicProperty); } set { SetValueInternal(IsDynamicProperty, BooleanBoxes.Box(value)); } } #endregion Public Properties //------------------------------------------------------ // // Protected Methods // //------------------------------------------------------ #region Protected Methods ////// Implementation of ///Freezable.CreateInstanceCore . ///The new Freezable. protected override Freezable CreateInstanceCore() { return new GuidelineSet(); } #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 vGuidelinesX = GuidelinesX; DoubleCollection vGuidelinesY = GuidelinesY; // Store the count of this resource's contained collections in local variables. int GuidelinesXCount = (vGuidelinesX == null) ? 0 : vGuidelinesX.Count; int GuidelinesYCount = (vGuidelinesY == null) ? 0 : vGuidelinesY.Count; // Pack & send command packet DUCE.MILCMD_GUIDELINESET data; unsafe { data.Type = MILCMD.MilCmdGuidelineSet; data.Handle = _duceResource.GetHandle(channel); data.GuidelinesXSize = (uint)(sizeof(Double) * GuidelinesXCount); data.GuidelinesYSize = (uint)(sizeof(Double) * GuidelinesYCount); data.IsDynamic = CompositionResourceManager.BooleanToUInt32(IsDynamic); channel.BeginCommand( (byte*)&data, sizeof(DUCE.MILCMD_GUIDELINESET), (int)(data.GuidelinesXSize + data.GuidelinesYSize) ); // Copy this collection's elements (or their handles) to reserved data for(int i = 0; i < GuidelinesXCount; i++) { Double resource = vGuidelinesX.Internal_GetItem(i); channel.AppendCommandData( (byte*)&resource, sizeof(Double) ); } // Copy this collection's elements (or their handles) to reserved data for(int i = 0; i < GuidelinesYCount; i++) { Double resource = vGuidelinesY.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_GUIDELINESET)) { 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 #endregion Internal Properties //----------------------------------------------------- // // Dependency Properties // //------------------------------------------------------ #region Dependency Properties ////// The DependencyProperty for the GuidelineSet.GuidelinesX property. /// public static readonly DependencyProperty GuidelinesXProperty; ////// The DependencyProperty for the GuidelineSet.GuidelinesY property. /// public static readonly DependencyProperty GuidelinesYProperty; ////// The DependencyProperty for the GuidelineSet.IsDynamic property. /// internal static readonly DependencyProperty IsDynamicProperty; #endregion Dependency Properties //----------------------------------------------------- // // Internal Fields // //------------------------------------------------------ #region Internal Fields internal System.Windows.Media.Composition.DUCE.MultiChannelResource _duceResource = new System.Windows.Media.Composition.DUCE.MultiChannelResource(); internal static DoubleCollection s_GuidelinesX = DoubleCollection.Empty; internal static DoubleCollection s_GuidelinesY = DoubleCollection.Empty; internal const bool c_IsDynamic = false; #endregion Internal Fields #region Constructors //------------------------------------------------------ // // Constructors // //----------------------------------------------------- static GuidelineSet() { // 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_GuidelinesX == null || s_GuidelinesX.IsFrozen, "Detected context bound default value GuidelineSet.s_GuidelinesX (See OS Bug #947272)."); Debug.Assert(s_GuidelinesY == null || s_GuidelinesY.IsFrozen, "Detected context bound default value GuidelineSet.s_GuidelinesY (See OS Bug #947272)."); // Initializations Type typeofThis = typeof(GuidelineSet); GuidelinesXProperty = RegisterProperty("GuidelinesX", typeof(DoubleCollection), typeofThis, new FreezableDefaultValueFactory(DoubleCollection.Empty), new PropertyChangedCallback(GuidelinesXPropertyChanged), null, /* isIndependentlyAnimated = */ false, /* coerceValueCallback */ null); GuidelinesYProperty = RegisterProperty("GuidelinesY", typeof(DoubleCollection), typeofThis, new FreezableDefaultValueFactory(DoubleCollection.Empty), new PropertyChangedCallback(GuidelinesYPropertyChanged), null, /* isIndependentlyAnimated = */ false, /* coerceValueCallback */ null); IsDynamicProperty = RegisterProperty("IsDynamic", typeof(bool), typeofThis, false, new PropertyChangedCallback(IsDynamicPropertyChanged), 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
- AnnotationResourceChangedEventArgs.cs
- EncryptedReference.cs
- SimpleLine.cs
- Style.cs
- DataSourceCacheDurationConverter.cs
- MaskedTextBoxTextEditorDropDown.cs
- ManipulationBoundaryFeedbackEventArgs.cs
- ApplicationFileCodeDomTreeGenerator.cs
- RemotingSurrogateSelector.cs
- XmlLanguageConverter.cs
- SimpleHandlerBuildProvider.cs
- SqlBulkCopyColumnMapping.cs
- DataTablePropertyDescriptor.cs
- LineBreakRecord.cs
- PerformanceCounterManager.cs
- ImageMap.cs
- XmlSchemaComplexContentExtension.cs
- AsyncWaitHandle.cs
- FamilyTypefaceCollection.cs
- ToolstripProfessionalRenderer.cs
- HtmlLink.cs
- RequiredArgumentAttribute.cs
- XmlIncludeAttribute.cs
- ProtocolViolationException.cs
- IdentityNotMappedException.cs
- WebPartConnectionsDisconnectVerb.cs
- XhtmlBasicTextViewAdapter.cs
- Crypto.cs
- PageRanges.cs
- SharedPersonalizationStateInfo.cs
- ThreadExceptionDialog.cs
- SqlDataSourceCache.cs
- Calendar.cs
- querybuilder.cs
- StyleModeStack.cs
- TreeNodeBindingDepthConverter.cs
- EditBehavior.cs
- TimeEnumHelper.cs
- CreateUserWizard.cs
- InputMethodStateTypeInfo.cs
- SynchronizedPool.cs
- IdSpace.cs
- MachineSettingsSection.cs
- EntityKeyElement.cs
- LineServicesCallbacks.cs
- SystemDropShadowChrome.cs
- WebEvents.cs
- CleanUpVirtualizedItemEventArgs.cs
- ByteStreamBufferedMessageData.cs
- Parser.cs
- AddInAttribute.cs
- SchemaContext.cs
- DataTable.cs
- ForwardPositionQuery.cs
- arc.cs
- XmlSchemaAttribute.cs
- CodeIdentifiers.cs
- RangeValuePattern.cs
- Int32CollectionConverter.cs
- AttachedPropertyMethodSelector.cs
- dtdvalidator.cs
- DataPointer.cs
- WebPartsSection.cs
- XmlDesignerDataSourceView.cs
- GeometryCombineModeValidation.cs
- ListChangedEventArgs.cs
- EmptyEnumerable.cs
- RegexParser.cs
- BaseTemplateParser.cs
- ContextStaticAttribute.cs
- RuleProcessor.cs
- PathFigureCollectionConverter.cs
- RoleService.cs
- EntityDataSourceMemberPath.cs
- __Error.cs
- PolyQuadraticBezierSegment.cs
- IconBitmapDecoder.cs
- UnknownBitmapEncoder.cs
- WindowsTab.cs
- ReliableOutputConnection.cs
- DoubleLinkListEnumerator.cs
- DataServiceRequestException.cs
- TreeViewImageIndexConverter.cs
- SqlCaseSimplifier.cs
- IdSpace.cs
- DataObjectEventArgs.cs
- SetterBaseCollection.cs
- EntityAdapter.cs
- ToolStripItemClickedEventArgs.cs
- CodeTypeParameter.cs
- SourceFileInfo.cs
- ObjectFactoryCodeDomTreeGenerator.cs
- ContainerControl.cs
- DocumentSequenceHighlightLayer.cs
- PagedDataSource.cs
- TTSEngineTypes.cs
- LocalFileSettingsProvider.cs
- Hex.cs
- DataSourceProvider.cs
- QualificationDataItem.cs