Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / wpf / src / Framework / System / ComponentModel / DesignerProperties.cs / 1 / DesignerProperties.cs
//---------------------------------------------------------------------------- // //// Copyright (C) Microsoft Corporation. All rights reserved. // // // // Description: // Provides attached properties used to communicate with a designer. // See spec at: http://team/sites/Cider/Cross%20Team/Design%20Mode%20Property.doc // // History: // 7/07/2006: [....], Created // //--------------------------------------------------------------------------- namespace System.ComponentModel { using System; using System.Windows; using MS.Internal.KnownBoxes; ////// The DesignerProperties class provides attached properties that can be used to /// query the state of a control when it is running in a designer. Designer tools /// will set values for properties on objects that are running in the designer. /// public static class DesignerProperties { //----------------------------------------------------- // // Public Fields // //----------------------------------------------------- ////// Identifies the DesignerProperties.IsInDesignMode dependency property. /// This field is read only. /// public static readonly DependencyProperty IsInDesignModeProperty = DependencyProperty.RegisterAttached( "IsInDesignMode", typeof(bool), typeof(DesignerProperties), new FrameworkPropertyMetadata(BooleanBoxes.FalseBox, FrameworkPropertyMetadataOptions.Inherits | FrameworkPropertyMetadataOptions.OverridesInheritanceBehavior)); //------------------------------------------------------ // // Public Methods // //----------------------------------------------------- ////// Returns the attached property IsInDesignMode value for the given dependency object. /// /// This property will return true if the given element is running in the context of a /// designer. Component developers may use this property to perform different logic /// in the context of a designer than they would when running in an application. For /// example, expensive validation or connecting to an external resource like a server /// may not make sense while an application is being developed. /// /// Designers may change the value of this property to move a control from design /// mode to run mode and back. Components that make changes to their state based /// on the value of this property should override the virtual OnPropertyChanged method /// and update their state if the IsInDesignMode property value changes. /// [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public static bool GetIsInDesignMode(DependencyObject element) { if (element == null) throw new ArgumentNullException("element"); return (bool)element.GetValue(IsInDesignModeProperty); } ////// Sets the value of the IsInDesignMode attached property for the given dependency object. /// public static void SetIsInDesignMode(DependencyObject element, bool value) { if (element == null) throw new ArgumentNullException("element"); element.SetValue(IsInDesignModeProperty, value); } } } // 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. // // // // Description: // Provides attached properties used to communicate with a designer. // See spec at: http://team/sites/Cider/Cross%20Team/Design%20Mode%20Property.doc // // History: // 7/07/2006: [....], Created // //--------------------------------------------------------------------------- namespace System.ComponentModel { using System; using System.Windows; using MS.Internal.KnownBoxes; ////// The DesignerProperties class provides attached properties that can be used to /// query the state of a control when it is running in a designer. Designer tools /// will set values for properties on objects that are running in the designer. /// public static class DesignerProperties { //----------------------------------------------------- // // Public Fields // //----------------------------------------------------- ////// Identifies the DesignerProperties.IsInDesignMode dependency property. /// This field is read only. /// public static readonly DependencyProperty IsInDesignModeProperty = DependencyProperty.RegisterAttached( "IsInDesignMode", typeof(bool), typeof(DesignerProperties), new FrameworkPropertyMetadata(BooleanBoxes.FalseBox, FrameworkPropertyMetadataOptions.Inherits | FrameworkPropertyMetadataOptions.OverridesInheritanceBehavior)); //------------------------------------------------------ // // Public Methods // //----------------------------------------------------- ////// Returns the attached property IsInDesignMode value for the given dependency object. /// /// This property will return true if the given element is running in the context of a /// designer. Component developers may use this property to perform different logic /// in the context of a designer than they would when running in an application. For /// example, expensive validation or connecting to an external resource like a server /// may not make sense while an application is being developed. /// /// Designers may change the value of this property to move a control from design /// mode to run mode and back. Components that make changes to their state based /// on the value of this property should override the virtual OnPropertyChanged method /// and update their state if the IsInDesignMode property value changes. /// [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public static bool GetIsInDesignMode(DependencyObject element) { if (element == null) throw new ArgumentNullException("element"); return (bool)element.GetValue(IsInDesignModeProperty); } ////// Sets the value of the IsInDesignMode attached property for the given dependency object. /// public static void SetIsInDesignMode(DependencyObject element, bool value) { if (element == null) throw new ArgumentNullException("element"); element.SetValue(IsInDesignModeProperty, value); } } } // 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
- RestHandler.cs
- SettingsPropertyWrongTypeException.cs
- FtpCachePolicyElement.cs
- RectangleConverter.cs
- objectresult_tresulttype.cs
- VisualState.cs
- RecommendedAsConfigurableAttribute.cs
- WsatRegistrationHeader.cs
- MemoryMappedViewAccessor.cs
- WindowsEditBox.cs
- GlyphRunDrawing.cs
- DesignTimeXamlWriter.cs
- RectangleConverter.cs
- PageScaling.cs
- CompletionCallbackWrapper.cs
- Size3D.cs
- UnsafeNativeMethods.cs
- AutomationProperties.cs
- HttpCacheVary.cs
- ClassImporter.cs
- XPathSingletonIterator.cs
- DetailsViewInsertedEventArgs.cs
- RemotingException.cs
- AnnotationService.cs
- SqlCacheDependencyDatabase.cs
- UrlMappingsModule.cs
- XmlConverter.cs
- ProxyWebPart.cs
- UnsafeNativeMethods.cs
- HttpChannelHelper.cs
- MsmqChannelFactory.cs
- SystemUnicastIPAddressInformation.cs
- TransactionWaitAsyncResult.cs
- FtpWebRequest.cs
- CertificateReferenceElement.cs
- SerializationException.cs
- MachineKeySection.cs
- ListViewGroupItemCollection.cs
- OutputCacheSection.cs
- XmlSchemaExporter.cs
- SerializationHelper.cs
- InlineObject.cs
- BackgroundFormatInfo.cs
- QilTargetType.cs
- ParameterCollectionEditorForm.cs
- DocumentOrderComparer.cs
- IdentityNotMappedException.cs
- IIS7WorkerRequest.cs
- BitmapData.cs
- SiteMapDataSourceDesigner.cs
- AutomationElement.cs
- DefaultValueAttribute.cs
- PointCollection.cs
- MissingMethodException.cs
- PerformanceCounterCategory.cs
- CompModSwitches.cs
- AdPostCacheSubstitution.cs
- DescriptionAttribute.cs
- Menu.cs
- PointAnimation.cs
- DataGridClipboardHelper.cs
- CheckPair.cs
- IMembershipProvider.cs
- CollectionBuilder.cs
- DataGridClipboardCellContent.cs
- TypeLoadException.cs
- VirtualPathUtility.cs
- XmlLangPropertyAttribute.cs
- QuaternionRotation3D.cs
- IISUnsafeMethods.cs
- ProgramNode.cs
- MultiView.cs
- X509CertificateChain.cs
- DriveInfo.cs
- RouteParametersHelper.cs
- DeferredRunTextReference.cs
- wpf-etw.cs
- ByteAnimationBase.cs
- CodeSnippetStatement.cs
- Iis7Helper.cs
- HealthMonitoringSectionHelper.cs
- RotateTransform3D.cs
- SpellerInterop.cs
- TypefaceCollection.cs
- RtType.cs
- EncoderFallback.cs
- CheckBoxFlatAdapter.cs
- DataList.cs
- DefaultHttpHandler.cs
- SortQuery.cs
- SizeValueSerializer.cs
- DetectRunnableInstancesTask.cs
- StateInitializationDesigner.cs
- HttpResponseInternalWrapper.cs
- BaseParaClient.cs
- SignedPkcs7.cs
- X509WindowsSecurityToken.cs
- Effect.cs
- ListDictionary.cs
- SerialPinChanges.cs