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
- DefaultProxySection.cs
- MatrixAnimationBase.cs
- PointLightBase.cs
- ResourcePermissionBase.cs
- BufferedOutputStream.cs
- SqlInternalConnectionTds.cs
- EnumerationRangeValidationUtil.cs
- XmlNodeComparer.cs
- AutomationPropertyInfo.cs
- CacheEntry.cs
- DesignTimeParseData.cs
- ValidationPropertyAttribute.cs
- FixedDocument.cs
- ReflectPropertyDescriptor.cs
- HttpCookiesSection.cs
- SrgsDocument.cs
- XpsPackagingException.cs
- StylusButtonCollection.cs
- UpdateManifestForBrowserApplication.cs
- FileEnumerator.cs
- Calendar.cs
- EventWaitHandle.cs
- RenamedEventArgs.cs
- MessagePropertyDescription.cs
- OracleException.cs
- OneToOneMappingSerializer.cs
- ApplicationSecurityInfo.cs
- HttpAsyncResult.cs
- DataStreams.cs
- SymLanguageType.cs
- Calendar.cs
- NumericExpr.cs
- ServiceDescription.cs
- PrintDialog.cs
- Collection.cs
- InstanceHandleReference.cs
- IProvider.cs
- ILGenerator.cs
- SoapFault.cs
- BaseParagraph.cs
- SamlAdvice.cs
- PriorityItem.cs
- AttributeCollection.cs
- validation.cs
- NativeMethods.cs
- DataGridBoolColumn.cs
- DefaultValidator.cs
- IncrementalHitTester.cs
- ImageInfo.cs
- TagPrefixAttribute.cs
- _AutoWebProxyScriptEngine.cs
- UiaCoreTypesApi.cs
- GenericEnumerator.cs
- TypeLibConverter.cs
- KnownTypesProvider.cs
- MeshGeometry3D.cs
- Bind.cs
- ClientProxyGenerator.cs
- ItemsChangedEventArgs.cs
- TextEditorContextMenu.cs
- CreateWorkflowOwnerCommand.cs
- TabControlCancelEvent.cs
- PathFigure.cs
- FileCodeGroup.cs
- WebServiceHandler.cs
- RadioButtonRenderer.cs
- FlowLayoutSettings.cs
- ScriptReferenceEventArgs.cs
- StrokeCollection2.cs
- ConfigurationSettings.cs
- Pair.cs
- ValidationEventArgs.cs
- PhysicalAddress.cs
- NamespaceQuery.cs
- NullableConverter.cs
- PackagePartCollection.cs
- BindingCollection.cs
- MemberPathMap.cs
- DateTime.cs
- HtmlInputPassword.cs
- WindowsListViewItemStartMenu.cs
- SqlCachedBuffer.cs
- CellParaClient.cs
- WorkflowServiceInstance.cs
- SafeRightsManagementHandle.cs
- ApplicationProxyInternal.cs
- activationcontext.cs
- SqlWebEventProvider.cs
- OleDbReferenceCollection.cs
- DuplicateWaitObjectException.cs
- ProcessModelInfo.cs
- CatalogPartCollection.cs
- MSAAWinEventWrap.cs
- DateTimeConstantAttribute.cs
- ZipPackagePart.cs
- ResourceKey.cs
- ExtendedPropertyCollection.cs
- DbDataSourceEnumerator.cs
- CryptographicAttribute.cs
- HostingEnvironmentSection.cs