Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / 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
- VarInfo.cs
- DictionaryCustomTypeDescriptor.cs
- OleDbRowUpdatedEvent.cs
- RelationHandler.cs
- DateTimeConverter.cs
- ValidationResult.cs
- Marshal.cs
- UnsafeNativeMethods.cs
- PrintPreviewDialog.cs
- ReplyChannel.cs
- LateBoundBitmapDecoder.cs
- SchemaImporterExtension.cs
- SamlAction.cs
- QuotedStringWriteStateInfo.cs
- DataPagerCommandEventArgs.cs
- LogSwitch.cs
- CodeGenHelper.cs
- EmptyControlCollection.cs
- TextElementEnumerator.cs
- ViewCellSlot.cs
- WebPartCloseVerb.cs
- autovalidator.cs
- SystemColorTracker.cs
- ListBoxDesigner.cs
- ActionFrame.cs
- SQLSingle.cs
- EnglishPluralizationService.cs
- SeverityFilter.cs
- LayoutTable.cs
- AccessDataSource.cs
- WindowsButton.cs
- Panel.cs
- TaskHelper.cs
- Serializer.cs
- ManipulationDevice.cs
- CheckedPointers.cs
- SmiRequestExecutor.cs
- SqlUtil.cs
- DynamicExpression.cs
- InitializationEventAttribute.cs
- BaseTreeIterator.cs
- activationcontext.cs
- TextProperties.cs
- EntityDataSourceWrapper.cs
- FunctionImportElement.cs
- PathNode.cs
- SoapProtocolReflector.cs
- Boolean.cs
- ConfigurationManagerHelper.cs
- XmlName.cs
- TreeNodeStyleCollection.cs
- PolicyUtility.cs
- CachedCompositeFamily.cs
- HttpModuleAction.cs
- While.cs
- InternalTransaction.cs
- TreeNodeStyle.cs
- InputLanguageEventArgs.cs
- AuthenticationService.cs
- ObjectFactoryCodeDomTreeGenerator.cs
- SchemaType.cs
- IdentifierService.cs
- BooleanFunctions.cs
- Operator.cs
- DataStorage.cs
- GeometryHitTestResult.cs
- RandomNumberGenerator.cs
- X509SecurityTokenProvider.cs
- TokenBasedSetEnumerator.cs
- PrintDialog.cs
- xdrvalidator.cs
- CalendarItem.cs
- DependencyObjectPropertyDescriptor.cs
- StatusBarPanel.cs
- TimeSpanParse.cs
- DefaultEventAttribute.cs
- NewExpression.cs
- ComboBox.cs
- Vector3DCollection.cs
- DataSysAttribute.cs
- Geometry.cs
- TdsParser.cs
- HealthMonitoringSection.cs
- HttpResponseInternalBase.cs
- DataSourceComponent.cs
- InheritablePropertyChangeInfo.cs
- BitmapDecoder.cs
- SourceLineInfo.cs
- Compilation.cs
- DataBoundControlAdapter.cs
- BitArray.cs
- CollectionViewGroupRoot.cs
- EncoderParameters.cs
- SQLRoleProvider.cs
- ControlBindingsCollection.cs
- WaitHandleCannotBeOpenedException.cs
- PolicyException.cs
- InfoCardAsymmetricCrypto.cs
- TimeSpanOrInfiniteConverter.cs
- AvTraceFormat.cs