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
- Model3D.cs
- StandardCommands.cs
- DataGridTextColumn.cs
- XmlUrlEditor.cs
- OdbcConnectionFactory.cs
- EventData.cs
- AppLevelCompilationSectionCache.cs
- ConfigXmlWhitespace.cs
- LinearKeyFrames.cs
- XsltSettings.cs
- AssociatedControlConverter.cs
- TypeSystem.cs
- XsltLibrary.cs
- XmlHierarchicalDataSourceView.cs
- ColumnHeader.cs
- StronglyTypedResourceBuilder.cs
- SQLStringStorage.cs
- BrowserTree.cs
- SessionStateItemCollection.cs
- AutomationElementIdentifiers.cs
- MetadataArtifactLoaderCompositeResource.cs
- DetailsViewRowCollection.cs
- DynamicRenderer.cs
- ReferencedCollectionType.cs
- AddInIpcChannel.cs
- PeerUnsafeNativeCryptMethods.cs
- ProfileEventArgs.cs
- DiscreteKeyFrames.cs
- DeviceContext.cs
- SubMenuStyleCollection.cs
- PropertiesTab.cs
- Comparer.cs
- ArraySubsetEnumerator.cs
- HMACMD5.cs
- QilName.cs
- TableRowsCollectionEditor.cs
- PerformanceCounterLib.cs
- FormViewCommandEventArgs.cs
- SchemaImporterExtensionElementCollection.cs
- BezierSegment.cs
- TreeNodeStyleCollection.cs
- WindowsFormsHelpers.cs
- WindowsTitleBar.cs
- HandlerFactoryWrapper.cs
- MatrixIndependentAnimationStorage.cs
- configsystem.cs
- EndOfStreamException.cs
- PermissionToken.cs
- WebPageTraceListener.cs
- MasterPage.cs
- FixedSOMLineCollection.cs
- IOException.cs
- Reference.cs
- ObservableCollection.cs
- LineSegment.cs
- ElementHost.cs
- RichTextBoxDesigner.cs
- ToolBarButton.cs
- TransformGroup.cs
- CodeRegionDirective.cs
- DataGridRelationshipRow.cs
- ComplexLine.cs
- BamlTreeNode.cs
- DataSourceSelectArguments.cs
- URIFormatException.cs
- DispatchChannelSink.cs
- UrlMappingsSection.cs
- NavigationProgressEventArgs.cs
- XmlTextAttribute.cs
- TextReader.cs
- HandlerFactoryWrapper.cs
- AutomationPatternInfo.cs
- EntityObject.cs
- ExtractedStateEntry.cs
- DetailsViewDeletedEventArgs.cs
- RegexMatchCollection.cs
- FileSystemInfo.cs
- CompilerResults.cs
- ClockGroup.cs
- NativeMethods.cs
- DetailsViewInsertEventArgs.cs
- MiniModule.cs
- SimpleWorkerRequest.cs
- ComboBox.cs
- TimelineClockCollection.cs
- PointLightBase.cs
- HtmlTextArea.cs
- IList.cs
- DependencyProperty.cs
- SmtpSpecifiedPickupDirectoryElement.cs
- EraserBehavior.cs
- CodePropertyReferenceExpression.cs
- DataGridViewCellEventArgs.cs
- TableLayoutPanelCellPosition.cs
- DATA_BLOB.cs
- SizeAnimationClockResource.cs
- TextElementEditingBehaviorAttribute.cs
- TextDocumentView.cs
- UriSectionData.cs
- UnsafeNativeMethods.cs