Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / wpf / src / Framework / System / Windows / Documents / BlockUIContainer.cs / 1 / 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
- RepeatButton.cs
- ProviderConnectionPoint.cs
- TypeDelegator.cs
- RoutedEventHandlerInfo.cs
- MemoryRecordBuffer.cs
- WeakReferenceList.cs
- ForEachAction.cs
- MulticastNotSupportedException.cs
- SmiEventStream.cs
- IndexingContentUnit.cs
- BooleanAnimationUsingKeyFrames.cs
- ChildDocumentBlock.cs
- SqlRewriteScalarSubqueries.cs
- TypographyProperties.cs
- RemoteWebConfigurationHostServer.cs
- TextEditorMouse.cs
- WebPartHelpVerb.cs
- EventData.cs
- Equal.cs
- LinearGradientBrush.cs
- CallbackValidatorAttribute.cs
- IChannel.cs
- MemberDescriptor.cs
- ISAPIRuntime.cs
- SystemMulticastIPAddressInformation.cs
- SHA1CryptoServiceProvider.cs
- StrokeNodeData.cs
- PeerNameRegistration.cs
- EntityDesignerDataSourceView.cs
- SoapExtension.cs
- GenerateScriptTypeAttribute.cs
- PenContexts.cs
- PreservationFileReader.cs
- BufferedOutputAsyncStream.cs
- RawStylusActions.cs
- WrappedReader.cs
- ExceptionHandler.cs
- CheckBoxDesigner.cs
- LocalizeDesigner.cs
- HtmlInputCheckBox.cs
- HostingEnvironmentSection.cs
- ArraySubsetEnumerator.cs
- ControlCodeDomSerializer.cs
- SoapIgnoreAttribute.cs
- ParameterCollection.cs
- BitmapCacheBrush.cs
- X509CertificateCollection.cs
- TypeToStringValueConverter.cs
- SimpleColumnProvider.cs
- IApplicationTrustManager.cs
- ResourceType.cs
- Html32TextWriter.cs
- HtmlInputRadioButton.cs
- Control.cs
- CommonBehaviorsSection.cs
- AsyncOperation.cs
- _BufferOffsetSize.cs
- CharConverter.cs
- DefaultParameterValueAttribute.cs
- DataSourceProvider.cs
- TextChange.cs
- FontNamesConverter.cs
- NoneExcludedImageIndexConverter.cs
- DataTableReader.cs
- SafeArrayTypeMismatchException.cs
- IdentityNotMappedException.cs
- SiteMapDataSource.cs
- MemberPath.cs
- BufferedWebEventProvider.cs
- ConsoleTraceListener.cs
- ThemeDirectoryCompiler.cs
- KeyboardNavigation.cs
- FixedSOMTableRow.cs
- IndexOutOfRangeException.cs
- EntityClassGenerator.cs
- ColorConvertedBitmap.cs
- SerializationBinder.cs
- InputLangChangeEvent.cs
- HttpValueCollection.cs
- BaseValidator.cs
- PersistenceTypeAttribute.cs
- TabItem.cs
- Variable.cs
- SerializerProvider.cs
- QuadraticBezierSegment.cs
- PtsContext.cs
- Model3D.cs
- DataTableNewRowEvent.cs
- DataGridSortCommandEventArgs.cs
- Encoder.cs
- DataControlFieldCell.cs
- TakeQueryOptionExpression.cs
- _Win32.cs
- PropertySourceInfo.cs
- ForeignKeyConstraint.cs
- OdbcException.cs
- StatusBar.cs
- Pair.cs
- ExpressionVisitor.cs
- RequestResizeEvent.cs