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
- QueryCoreOp.cs
- SqlMethodAttribute.cs
- odbcmetadatafactory.cs
- AtomServiceDocumentSerializer.cs
- GridViewDeleteEventArgs.cs
- DataGridColumnCollection.cs
- ResourceExpressionBuilder.cs
- IteratorDescriptor.cs
- KeyGesture.cs
- C14NUtil.cs
- HttpListenerElement.cs
- OutputCacheSettingsSection.cs
- PointHitTestParameters.cs
- PackageDigitalSignatureManager.cs
- FrameworkContentElement.cs
- PartDesigner.cs
- EmptyTextWriter.cs
- ChunkedMemoryStream.cs
- BitmapFrameDecode.cs
- EventMappingSettingsCollection.cs
- XmlSchemaSimpleTypeRestriction.cs
- ParallelActivityDesigner.cs
- AdCreatedEventArgs.cs
- _UriTypeConverter.cs
- XmlElement.cs
- Roles.cs
- ExpressionBuilderCollection.cs
- HttpNamespaceReservationInstallComponent.cs
- ManagedFilter.cs
- SqlServer2KCompatibilityAnnotation.cs
- FindCriteria11.cs
- TextBoxAutoCompleteSourceConverter.cs
- SQLGuidStorage.cs
- OleStrCAMarshaler.cs
- HttpBrowserCapabilitiesWrapper.cs
- PEFileReader.cs
- MetadataArtifactLoaderComposite.cs
- DocumentViewerBaseAutomationPeer.cs
- GridViewRowCollection.cs
- WebBrowserSiteBase.cs
- XmlCountingReader.cs
- LayoutUtils.cs
- PersonalizationStateQuery.cs
- TrustLevel.cs
- ConstantSlot.cs
- SafeFileMappingHandle.cs
- FramingFormat.cs
- StructuredTypeEmitter.cs
- TextPointerBase.cs
- ErasingStroke.cs
- GridViewEditEventArgs.cs
- BaseCAMarshaler.cs
- SchemaElementLookUpTable.cs
- RawStylusSystemGestureInputReport.cs
- TraceSection.cs
- NetworkCredential.cs
- DataGridViewAutoSizeModeEventArgs.cs
- FileAuthorizationModule.cs
- HGlobalSafeHandle.cs
- AppliesToBehaviorDecisionTable.cs
- TextViewElement.cs
- X500Name.cs
- WindowsAuthenticationModule.cs
- EncoderBestFitFallback.cs
- UIElementIsland.cs
- UnsafeNativeMethods.cs
- AdornerDecorator.cs
- NodeInfo.cs
- Automation.cs
- TextOutput.cs
- WizardForm.cs
- ConstructorNeedsTagAttribute.cs
- SapiRecognizer.cs
- SafeRegistryHandle.cs
- DataSetFieldSchema.cs
- AdornerHitTestResult.cs
- SuppressMergeCheckAttribute.cs
- MetadataPropertyAttribute.cs
- ConfigPathUtility.cs
- ScopedKnownTypes.cs
- autovalidator.cs
- TableDetailsRow.cs
- GenericUI.cs
- ClassHandlersStore.cs
- DataBinder.cs
- LoginDesigner.cs
- EncryptedKeyIdentifierClause.cs
- Empty.cs
- ContentPathSegment.cs
- StylusEventArgs.cs
- ColorMap.cs
- ParseChildrenAsPropertiesAttribute.cs
- Animatable.cs
- WindowsAuthenticationEventArgs.cs
- HtmlTableRowCollection.cs
- MissingManifestResourceException.cs
- RuntimeEnvironment.cs
- ConstNode.cs
- ConfigurationSectionGroup.cs
- NullableBoolConverter.cs