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
- ServicePoint.cs
- FamilyMap.cs
- SortDescription.cs
- DataDocumentXPathNavigator.cs
- WebBrowserEvent.cs
- VoiceInfo.cs
- PropertyValueChangedEvent.cs
- WhitespaceRule.cs
- KerberosRequestorSecurityToken.cs
- ClaimComparer.cs
- UIAgentAsyncEndRequest.cs
- DelegatedStream.cs
- Underline.cs
- NoPersistScope.cs
- DragEvent.cs
- FastEncoderStatics.cs
- DnsCache.cs
- WmiInstallComponent.cs
- HwndMouseInputProvider.cs
- ExceptionUtil.cs
- HostedImpersonationContext.cs
- ProfileEventArgs.cs
- FastPropertyAccessor.cs
- XmlWriter.cs
- CfgSemanticTag.cs
- DBCSCodePageEncoding.cs
- PeerResolverSettings.cs
- IdleTimeoutMonitor.cs
- PartitionedStreamMerger.cs
- SqlGenerator.cs
- BulletedListEventArgs.cs
- ContextMenuStrip.cs
- SqlBulkCopyColumnMapping.cs
- AttributeInfo.cs
- SrgsRule.cs
- MessageHeader.cs
- XPathNodeIterator.cs
- PathGradientBrush.cs
- ListViewTableRow.cs
- EditorZone.cs
- _SpnDictionary.cs
- Soap12FormatExtensions.cs
- BitVector32.cs
- DataGridItemCollection.cs
- dbdatarecord.cs
- ResourceIDHelper.cs
- EntityDataSourceStatementEditorForm.cs
- TreeNodeCollection.cs
- ILGen.cs
- RedistVersionInfo.cs
- UserControlCodeDomTreeGenerator.cs
- FieldDescriptor.cs
- SimpleBitVector32.cs
- AudioFileOut.cs
- mansign.cs
- ToolStripArrowRenderEventArgs.cs
- RequestChannel.cs
- SQLDateTimeStorage.cs
- NonVisualControlAttribute.cs
- DeflateStream.cs
- XmlRawWriter.cs
- HashMembershipCondition.cs
- CompareInfo.cs
- GenericIdentity.cs
- TraceSection.cs
- ValidationSettings.cs
- SiteMapDataSourceView.cs
- CapabilitiesRule.cs
- DBBindings.cs
- GrabHandleGlyph.cs
- ListViewDeletedEventArgs.cs
- ISCIIEncoding.cs
- PropertyEmitter.cs
- DataServiceRequestException.cs
- SafeNativeMethods.cs
- CustomValidator.cs
- StringOutput.cs
- GetCryptoTransformRequest.cs
- MsdtcClusterUtils.cs
- CodeMethodReturnStatement.cs
- QuotedStringFormatReader.cs
- RangeValueProviderWrapper.cs
- CodeBinaryOperatorExpression.cs
- XmlObjectSerializerWriteContext.cs
- DocumentViewerHelper.cs
- LoginCancelEventArgs.cs
- MouseCaptureWithinProperty.cs
- AuthStoreRoleProvider.cs
- SafeLibraryHandle.cs
- DefaultTextStore.cs
- WebPartConnectionsConfigureVerb.cs
- UncommonField.cs
- HttpApplication.cs
- BamlVersionHeader.cs
- connectionpool.cs
- Matrix.cs
- Rfc2898DeriveBytes.cs
- ManagementException.cs
- KeyManager.cs
- RoutedEventConverter.cs