Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Framework / System / Windows / Controls / Separator.cs / 1458001 / Separator.cs
//---------------------------------------------------------------------------- // // Copyright (C) Microsoft Corporation. All rights reserved. // //--------------------------------------------------------------------------- using MS.Internal.KnownBoxes; using System.Windows.Automation.Peers; namespace System.Windows.Controls { ////// Separator control is a simple Control subclass that is used in different styles /// depend on container control. Common usage is inside ListBox, ComboBox, MenuItem and ToolBar. /// [Localizability(LocalizationCategory.None, Readability = Readability.Unreadable)] // cannot be read & localized as string public class Separator : Control { static Separator() { DefaultStyleKeyProperty.OverrideMetadata(typeof(Separator), new FrameworkPropertyMetadata(typeof(Separator))); _dType = DependencyObjectType.FromSystemTypeInternal(typeof(Separator)); IsEnabledProperty.OverrideMetadata(typeof(Separator), new FrameworkPropertyMetadata(BooleanBoxes.FalseBox)); } internal static void PrepareContainer(Control container) { if (container != null) { // Disable the control and set the alignment to stretch container.IsEnabled = false; container.HorizontalContentAlignment = HorizontalAlignment.Stretch; } } ////// Creates AutomationPeer ( protected override AutomationPeer OnCreateAutomationPeer() { return new SeparatorAutomationPeer(this); } #region DTypeThemeStyleKey // Returns the DependencyObjectType for the registered ThemeStyleKey's default // value. Controls will override this method to return approriate types. internal override DependencyObjectType DTypeThemeStyleKey { get { return _dType; } } private static DependencyObjectType _dType; #endregion DTypeThemeStyleKey } } // 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. // //--------------------------------------------------------------------------- using MS.Internal.KnownBoxes; using System.Windows.Automation.Peers; namespace System.Windows.Controls { ///) /// /// Separator control is a simple Control subclass that is used in different styles /// depend on container control. Common usage is inside ListBox, ComboBox, MenuItem and ToolBar. /// [Localizability(LocalizationCategory.None, Readability = Readability.Unreadable)] // cannot be read & localized as string public class Separator : Control { static Separator() { DefaultStyleKeyProperty.OverrideMetadata(typeof(Separator), new FrameworkPropertyMetadata(typeof(Separator))); _dType = DependencyObjectType.FromSystemTypeInternal(typeof(Separator)); IsEnabledProperty.OverrideMetadata(typeof(Separator), new FrameworkPropertyMetadata(BooleanBoxes.FalseBox)); } internal static void PrepareContainer(Control container) { if (container != null) { // Disable the control and set the alignment to stretch container.IsEnabled = false; container.HorizontalContentAlignment = HorizontalAlignment.Stretch; } } ////// Creates AutomationPeer ( protected override AutomationPeer OnCreateAutomationPeer() { return new SeparatorAutomationPeer(this); } #region DTypeThemeStyleKey // Returns the DependencyObjectType for the registered ThemeStyleKey's default // value. Controls will override this method to return approriate types. internal override DependencyObjectType DTypeThemeStyleKey { get { return _dType; } } private static DependencyObjectType _dType; #endregion DTypeThemeStyleKey } } // 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
- RsaKeyIdentifierClause.cs
- ObjectListItemCollection.cs
- ScopeElementCollection.cs
- ChangeNode.cs
- CatchBlock.cs
- ListDictionaryInternal.cs
- State.cs
- WebResourceAttribute.cs
- EntityClassGenerator.cs
- XmlAnyAttributeAttribute.cs
- Image.cs
- MaterialCollection.cs
- XPathParser.cs
- TrackPoint.cs
- ProcessProtocolHandler.cs
- JsonWriter.cs
- Roles.cs
- AlignmentYValidation.cs
- ComplexTypeEmitter.cs
- HtmlAnchor.cs
- PeerReferralPolicy.cs
- AnnotationElement.cs
- Ops.cs
- RightsManagementEncryptionTransform.cs
- ScriptingScriptResourceHandlerSection.cs
- CompositeActivityTypeDescriptor.cs
- MultiSelector.cs
- Inflater.cs
- XmlBaseReader.cs
- MasterPageBuildProvider.cs
- IndexedString.cs
- ObjectStateEntryDbDataRecord.cs
- Row.cs
- ResourceContainer.cs
- DeadLetterQueue.cs
- TcpConnectionPoolSettingsElement.cs
- Pool.cs
- LabelTarget.cs
- SqlCharStream.cs
- CharAnimationBase.cs
- EdmPropertyAttribute.cs
- AnnotationAdorner.cs
- Control.cs
- XmlSchemaSimpleContentRestriction.cs
- WebPartUtil.cs
- MenuEventArgs.cs
- CompiledIdentityConstraint.cs
- Package.cs
- TransformCollection.cs
- UTF8Encoding.cs
- GroupAggregateExpr.cs
- LinearGradientBrush.cs
- Message.cs
- UnsafeNativeMethodsCLR.cs
- TextEditorCharacters.cs
- HttpModuleActionCollection.cs
- MouseDevice.cs
- DebugController.cs
- ResXResourceSet.cs
- MessageSecurityException.cs
- HtmlButton.cs
- EdmFunction.cs
- ProfileModule.cs
- ComponentCommands.cs
- SiteMapSection.cs
- Model3D.cs
- Object.cs
- XamlPoint3DCollectionSerializer.cs
- WsatConfiguration.cs
- storepermissionattribute.cs
- ChangesetResponse.cs
- DiffuseMaterial.cs
- PerformanceCountersElement.cs
- QilSortKey.cs
- MobileTemplatedControlDesigner.cs
- LocatorPartList.cs
- LinkUtilities.cs
- FontNameEditor.cs
- SafeRightsManagementEnvironmentHandle.cs
- HebrewNumber.cs
- ContentControl.cs
- ToolStripItemClickedEventArgs.cs
- UdpDuplexChannel.cs
- XmlSchemaComplexContentRestriction.cs
- WebProxyScriptElement.cs
- SqlDataRecord.cs
- VBIdentifierDesigner.xaml.cs
- DataTableNewRowEvent.cs
- SqlConnectionHelper.cs
- FixedSOMGroup.cs
- StrokeCollectionDefaultValueFactory.cs
- UInt16Converter.cs
- OdbcReferenceCollection.cs
- SecurityDescriptor.cs
- WebPartRestoreVerb.cs
- CompiledQueryCacheEntry.cs
- StringToken.cs
- HtmlImage.cs
- DataGridPageChangedEventArgs.cs
- SqlStatistics.cs