Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Framework / System / Windows / Documents / BlockUIContainer.cs / 1305600 / BlockUIContainer.cs
//---------------------------------------------------------------------------- // // Copyright (C) Microsoft Corporation. All rights reserved. // // Description: BlockUIContainer - a wrapper for embedded UIElements in text // flow content block collections // //--------------------------------------------------------------------------- using System.ComponentModel; // DesignerSerializationVisibility using System.Windows.Markup; // ContentProperty namespace System.Windows.Documents { ////// BlockUIContainer - a wrapper for embedded UIElements in text /// flow content block collections /// [ContentProperty("Child")] public class BlockUIContainer : Block { //------------------------------------------------------------------- // // Constructors // //------------------------------------------------------------------- #region Constructors ////// Initializes a new instance of BlockUIContainer element. /// ////// The purpose of this element is to be a wrapper for UIElements /// when they are embedded into text flow - as items of /// BlockCollections. /// public BlockUIContainer() : base() { } ////// Initializes an BlockUIContainer specifying its child UIElement /// /// /// UIElement set as a child of this block item /// public BlockUIContainer(UIElement uiElement) : base() { if (uiElement == null) { throw new ArgumentNullException("uiElement"); } this.Child = uiElement; } #endregion Constructors //-------------------------------------------------------------------- // // Public Properties // //------------------------------------------------------------------- #region Properties ////// The content spanned by this TextElement. /// public UIElement Child { get { return this.ContentStart.GetAdjacentElement(LogicalDirection.Forward) as UIElement; } set { TextContainer textContainer = this.TextContainer; textContainer.BeginChange(); try { TextPointer contentStart = this.ContentStart; UIElement child = Child; if (child != null) { textContainer.DeleteContentInternal(contentStart, this.ContentEnd); ContainerTextElementField.ClearValue(child); } if (value != null) { ContainerTextElementField.SetValue(value, this); contentStart.InsertUIElement(value); } } finally { textContainer.EndChange(); } } } #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. // // Description: BlockUIContainer - a wrapper for embedded UIElements in text // flow content block collections // //--------------------------------------------------------------------------- using System.ComponentModel; // DesignerSerializationVisibility using System.Windows.Markup; // ContentProperty namespace System.Windows.Documents { ////// BlockUIContainer - a wrapper for embedded UIElements in text /// flow content block collections /// [ContentProperty("Child")] public class BlockUIContainer : Block { //------------------------------------------------------------------- // // Constructors // //------------------------------------------------------------------- #region Constructors ////// Initializes a new instance of BlockUIContainer element. /// ////// The purpose of this element is to be a wrapper for UIElements /// when they are embedded into text flow - as items of /// BlockCollections. /// public BlockUIContainer() : base() { } ////// Initializes an BlockUIContainer specifying its child UIElement /// /// /// UIElement set as a child of this block item /// public BlockUIContainer(UIElement uiElement) : base() { if (uiElement == null) { throw new ArgumentNullException("uiElement"); } this.Child = uiElement; } #endregion Constructors //-------------------------------------------------------------------- // // Public Properties // //------------------------------------------------------------------- #region Properties ////// The content spanned by this TextElement. /// public UIElement Child { get { return this.ContentStart.GetAdjacentElement(LogicalDirection.Forward) as UIElement; } set { TextContainer textContainer = this.TextContainer; textContainer.BeginChange(); try { TextPointer contentStart = this.ContentStart; UIElement child = Child; if (child != null) { textContainer.DeleteContentInternal(contentStart, this.ContentEnd); ContainerTextElementField.ClearValue(child); } if (value != null) { ContainerTextElementField.SetValue(value, this); contentStart.InsertUIElement(value); } } finally { textContainer.EndChange(); } } } #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
- BeginEvent.cs
- HttpCachePolicyElement.cs
- StringExpressionSet.cs
- Line.cs
- DynamicValidatorEventArgs.cs
- SqlDataSourceFilteringEventArgs.cs
- BindMarkupExtensionSerializer.cs
- DynamicField.cs
- SerialPort.cs
- LogSwitch.cs
- OdbcFactory.cs
- SchemaCollectionPreprocessor.cs
- InputLanguageSource.cs
- ComponentResourceKey.cs
- ObjectSet.cs
- XmlSchemaSubstitutionGroup.cs
- SafeEventLogWriteHandle.cs
- IDataContractSurrogate.cs
- WindowsAuthenticationEventArgs.cs
- FontDriver.cs
- UIElement3DAutomationPeer.cs
- XmlNodeWriter.cs
- DiscoveryDocumentSearchPattern.cs
- RadioButtonFlatAdapter.cs
- SafeFileMapViewHandle.cs
- PatternMatcher.cs
- TraceLevelHelper.cs
- MenuItem.cs
- CommonGetThemePartSize.cs
- NameValueConfigurationCollection.cs
- CombinedTcpChannel.cs
- InvalidDataException.cs
- mactripleDES.cs
- RegexInterpreter.cs
- StateBag.cs
- GeometryValueSerializer.cs
- MethodAccessException.cs
- SettingsPropertyCollection.cs
- DefaultPrintController.cs
- RbTree.cs
- Helpers.cs
- ChangeTracker.cs
- SqlUDTStorage.cs
- SQLBytesStorage.cs
- DateTimeFormatInfoScanner.cs
- UntypedNullExpression.cs
- RemotingServices.cs
- MappingItemCollection.cs
- CheckBoxStandardAdapter.cs
- MsmqReceiveParameters.cs
- SqlClientFactory.cs
- QilReplaceVisitor.cs
- ArgumentsParser.cs
- LayoutManager.cs
- AdjustableArrowCap.cs
- IChannel.cs
- TextEditorContextMenu.cs
- VBCodeProvider.cs
- DataGridViewComboBoxColumn.cs
- WorkflowServiceBehavior.cs
- MethodRental.cs
- GridItem.cs
- BaseInfoTable.cs
- DataSvcMapFileSerializer.cs
- Module.cs
- XmlAttributes.cs
- EntityClassGenerator.cs
- documentsequencetextpointer.cs
- UpdatePanelControlTrigger.cs
- GrammarBuilder.cs
- NameTable.cs
- PropertyInformation.cs
- VisualStyleRenderer.cs
- Odbc32.cs
- DataReaderContainer.cs
- TableDetailsRow.cs
- System.Data.OracleClient_BID.cs
- CompressStream.cs
- SoapFormatterSinks.cs
- PersonalizationStateInfo.cs
- XmlDataImplementation.cs
- MessageDecoder.cs
- EmptyArray.cs
- ComponentResourceKey.cs
- SchemaImporterExtensionElement.cs
- BoundPropertyEntry.cs
- WindowsFormsLinkLabel.cs
- NameSpaceEvent.cs
- RSAOAEPKeyExchangeFormatter.cs
- InternalRelationshipCollection.cs
- XmlAttributeHolder.cs
- Clause.cs
- ProfileModule.cs
- CleanUpVirtualizedItemEventArgs.cs
- SingleAnimationUsingKeyFrames.cs
- ResourcePart.cs
- ByteStack.cs
- cryptoapiTransform.cs
- _SslState.cs
- DefaultValidator.cs