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
- FlowDocument.cs
- CodeStatement.cs
- XsltContext.cs
- X500Name.cs
- DataGridCellAutomationPeer.cs
- unitconverter.cs
- SafeNativeMethodsMilCoreApi.cs
- MouseEventArgs.cs
- PresentationTraceSources.cs
- SqlNodeAnnotations.cs
- DocumentViewer.cs
- ConstraintCollection.cs
- SrgsDocumentParser.cs
- NativeObjectSecurity.cs
- InputEventArgs.cs
- Gdiplus.cs
- UIElementIsland.cs
- FileLogRecordEnumerator.cs
- SpeakProgressEventArgs.cs
- Invariant.cs
- DynamicEntity.cs
- BitmapInitialize.cs
- TextBoxView.cs
- Brush.cs
- SiteMapNodeCollection.cs
- DictionaryGlobals.cs
- DataGridViewRowsRemovedEventArgs.cs
- RtfToXamlLexer.cs
- LongValidatorAttribute.cs
- AsnEncodedData.cs
- Int32CAMarshaler.cs
- SqlServices.cs
- ConfigurationManagerHelper.cs
- SurrogateSelector.cs
- MobileUserControl.cs
- TextChangedEventArgs.cs
- CodeMemberEvent.cs
- BaseCAMarshaler.cs
- NavigationPropertyEmitter.cs
- RoleGroupCollection.cs
- ZipIOCentralDirectoryDigitalSignature.cs
- ProfilePropertySettingsCollection.cs
- ComEventsInfo.cs
- TypeLoadException.cs
- securestring.cs
- StatusBarAutomationPeer.cs
- SQLDateTime.cs
- WindowsTab.cs
- InfocardInteractiveChannelInitializer.cs
- FirewallWrapper.cs
- MailAddress.cs
- TreeWalker.cs
- MetaModel.cs
- ChannelPool.cs
- TypeResolver.cs
- Maps.cs
- SystemDiagnosticsSection.cs
- CSharpCodeProvider.cs
- XmlSchemaFacet.cs
- JpegBitmapEncoder.cs
- XmlReflectionImporter.cs
- StyleTypedPropertyAttribute.cs
- DateTimeConverter2.cs
- ItemsControlAutomationPeer.cs
- XmlSchemaSimpleTypeList.cs
- SqlDataSourceCommandEventArgs.cs
- InvalidDocumentContentsException.cs
- ControlCachePolicy.cs
- StrongNameUtility.cs
- CodeDomLocalizationProvider.cs
- TransformConverter.cs
- SqlMultiplexer.cs
- RSAPKCS1KeyExchangeFormatter.cs
- XmlAtomicValue.cs
- lengthconverter.cs
- BitmapCache.cs
- SqlDesignerDataSourceView.cs
- ToolStripDesignerUtils.cs
- Attachment.cs
- TextCompositionEventArgs.cs
- WorkflowValidationFailedException.cs
- ProviderConnectionPointCollection.cs
- DispatcherExceptionFilterEventArgs.cs
- WebBrowser.cs
- UserNameSecurityTokenProvider.cs
- TraceProvider.cs
- MachineKeySection.cs
- DecimalStorage.cs
- XmlSchemaAnnotation.cs
- TextBreakpoint.cs
- SQLDateTimeStorage.cs
- AtlasWeb.Designer.cs
- ControlPropertyNameConverter.cs
- TextTreeInsertElementUndoUnit.cs
- RestClientProxyHandler.cs
- LocalFileSettingsProvider.cs
- GridPattern.cs
- VariantWrapper.cs
- SqlEnums.cs
- LineSegment.cs