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
- TagNameToTypeMapper.cs
- ActiveXHelper.cs
- WindowsStatic.cs
- SoapCodeExporter.cs
- ResXResourceWriter.cs
- CustomTypeDescriptor.cs
- LinkArea.cs
- DataGridViewCellParsingEventArgs.cs
- GridViewRowEventArgs.cs
- Cursors.cs
- DBAsyncResult.cs
- TrackingCondition.cs
- ChildrenQuery.cs
- GroupAggregateExpr.cs
- BasePropertyDescriptor.cs
- WebEvents.cs
- LiteralDesigner.cs
- MetadataPropertyAttribute.cs
- CallId.cs
- ForeignKeyFactory.cs
- Monitor.cs
- _RequestCacheProtocol.cs
- RuleSetBrowserDialog.cs
- OutputCacheSection.cs
- TableLayoutPanelDesigner.cs
- ActivityExecutorDelegateInfo.cs
- DateTimeEditor.cs
- StoragePropertyMapping.cs
- ComponentEvent.cs
- Rect.cs
- OdbcConnectionHandle.cs
- SendDesigner.xaml.cs
- ModulesEntry.cs
- DebugHandleTracker.cs
- WebPartChrome.cs
- MulticastDelegate.cs
- SafeNativeHandle.cs
- formatstringdialog.cs
- SequenceDesignerAccessibleObject.cs
- AssemblyResourceLoader.cs
- Mappings.cs
- AssociationSetMetadata.cs
- FontWeights.cs
- ColumnTypeConverter.cs
- ExceptQueryOperator.cs
- DependencyPropertyDescriptor.cs
- ToolboxItem.cs
- StaticResourceExtension.cs
- DataGridTextBox.cs
- HealthMonitoringSectionHelper.cs
- Transform3DCollection.cs
- WindowsGraphics.cs
- IteratorAsyncResult.cs
- SystemColors.cs
- FaultDesigner.cs
- AnimatedTypeHelpers.cs
- PropertyManager.cs
- CodeEntryPointMethod.cs
- KeyValuePairs.cs
- AssemblyInfo.cs
- SelectionList.cs
- AlphabeticalEnumConverter.cs
- DropShadowBitmapEffect.cs
- CultureInfo.cs
- __Filters.cs
- BaseDataList.cs
- Frame.cs
- CollectionAdapters.cs
- DbTransaction.cs
- ByteAnimation.cs
- QilXmlWriter.cs
- SqlDataSourceFilteringEventArgs.cs
- HttpRuntime.cs
- SecureUICommand.cs
- DiscoveryDocumentSearchPattern.cs
- ILGen.cs
- CacheOutputQuery.cs
- SlotInfo.cs
- QueryContinueDragEvent.cs
- TextRunCacheImp.cs
- Package.cs
- SoapEnumAttribute.cs
- sortedlist.cs
- LoadWorkflowByKeyAsyncResult.cs
- UserControlCodeDomTreeGenerator.cs
- LabelLiteral.cs
- DictionaryManager.cs
- ContextMenuAutomationPeer.cs
- ProcessHostServerConfig.cs
- PlatformCulture.cs
- DataColumnPropertyDescriptor.cs
- MethodBuilder.cs
- Wow64ConfigurationLoader.cs
- StyleBamlRecordReader.cs
- Point4D.cs
- ReadOnlyDictionary.cs
- FileAuthorizationModule.cs
- LineSegment.cs
- ResourceKey.cs
- HMACSHA1.cs