Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Framework / System / Windows / Markup / TemplateComponentConnector.cs / 1305600 / TemplateComponentConnector.cs
/****************************************************************************\ * * File: OptimizedTemplateComponentConnector.cs * * Purpose: Provides an IComponentConnector which is used in instantiation * of optimized template content. * * Copyright (C) 2005 by Microsoft Corporation. All rights reserved. * \***************************************************************************/ using System; using System.Xml; using System.IO; using System.Windows; using System.Windows.Media; using System.Windows.Navigation; using System.Text; using System.Collections; using System.Collections.Generic; using System.ComponentModel; using System.Windows.Controls; using System.Windows.Documents; using System.Windows.Media.Animation; using System.Diagnostics; using System.Reflection; using System.Windows.Threading; using System.Windows.Data; using System.Globalization; using MS.Utility; namespace System.Windows.Markup { // This class provides an IComponentConnector implementation for use during instantiation // of optimized template content. It is given an IComponentConnector, and most calls are // just forwarded to it. But it is also given an IStyleConnector, and calls to Connect // are sent there instead. internal class TemplateComponentConnector : IComponentConnector { internal TemplateComponentConnector( IComponentConnector componentConnector, IStyleConnector styleConnector ) { _styleConnector = styleConnector; _componentConnector = componentConnector; } public void InitializeComponent() { _componentConnector.InitializeComponent(); } public void Connect(int connectionId, object target) { // Calls to IComponentConnector.Connect from template content get forwarded // to the outer style connector (when we have one). if (_styleConnector != null) { _styleConnector.Connect(connectionId, target); } else { _componentConnector.Connect(connectionId, target); } } private IStyleConnector _styleConnector; private IComponentConnector _componentConnector; } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. /****************************************************************************\ * * File: OptimizedTemplateComponentConnector.cs * * Purpose: Provides an IComponentConnector which is used in instantiation * of optimized template content. * * Copyright (C) 2005 by Microsoft Corporation. All rights reserved. * \***************************************************************************/ using System; using System.Xml; using System.IO; using System.Windows; using System.Windows.Media; using System.Windows.Navigation; using System.Text; using System.Collections; using System.Collections.Generic; using System.ComponentModel; using System.Windows.Controls; using System.Windows.Documents; using System.Windows.Media.Animation; using System.Diagnostics; using System.Reflection; using System.Windows.Threading; using System.Windows.Data; using System.Globalization; using MS.Utility; namespace System.Windows.Markup { // This class provides an IComponentConnector implementation for use during instantiation // of optimized template content. It is given an IComponentConnector, and most calls are // just forwarded to it. But it is also given an IStyleConnector, and calls to Connect // are sent there instead. internal class TemplateComponentConnector : IComponentConnector { internal TemplateComponentConnector( IComponentConnector componentConnector, IStyleConnector styleConnector ) { _styleConnector = styleConnector; _componentConnector = componentConnector; } public void InitializeComponent() { _componentConnector.InitializeComponent(); } public void Connect(int connectionId, object target) { // Calls to IComponentConnector.Connect from template content get forwarded // to the outer style connector (when we have one). if (_styleConnector != null) { _styleConnector.Connect(connectionId, target); } else { _componentConnector.Connect(connectionId, target); } } private IStyleConnector _styleConnector; private IComponentConnector _componentConnector; } } // 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
- SubclassTypeValidator.cs
- MsmqInputChannelListenerBase.cs
- objectresult_tresulttype.cs
- indexingfiltermarshaler.cs
- LineServices.cs
- TimelineGroup.cs
- LockRenewalTask.cs
- QualificationDataAttribute.cs
- MouseOverProperty.cs
- HelpKeywordAttribute.cs
- SqlConnectionManager.cs
- XamlPointCollectionSerializer.cs
- LabelAutomationPeer.cs
- ActivationArguments.cs
- DataDocumentXPathNavigator.cs
- CapabilitiesSection.cs
- NTAccount.cs
- SoapExtension.cs
- Attributes.cs
- MethodExpr.cs
- ReversePositionQuery.cs
- SiteMapHierarchicalDataSourceView.cs
- EventWaitHandle.cs
- PointAnimationUsingPath.cs
- SqlGatherProducedAliases.cs
- UserControl.cs
- XmlSequenceWriter.cs
- InternalResources.cs
- XmlWellformedWriter.cs
- BinaryExpression.cs
- DrawingState.cs
- ListView.cs
- SQLDoubleStorage.cs
- HiddenField.cs
- PrinterUnitConvert.cs
- Brush.cs
- WindowsScrollBar.cs
- AuthenticationManager.cs
- ScaleTransform3D.cs
- TreeViewHitTestInfo.cs
- ShutDownListener.cs
- HashRepartitionEnumerator.cs
- BindingValueChangedEventArgs.cs
- ColumnResizeAdorner.cs
- FixedSOMTableCell.cs
- Point3DCollectionConverter.cs
- CornerRadius.cs
- TextRange.cs
- TextWriter.cs
- ReferencedCollectionType.cs
- IOThreadScheduler.cs
- FixedBufferAttribute.cs
- SafeCryptHandles.cs
- SmtpException.cs
- SqlConnectionManager.cs
- CreateUserWizardStep.cs
- BatchParser.cs
- AtomContentProperty.cs
- StagingAreaInputItem.cs
- messageonlyhwndwrapper.cs
- XmlDocument.cs
- DataBindingValueUIHandler.cs
- InvalidFilterCriteriaException.cs
- AdornerLayer.cs
- BindingCollection.cs
- SqlIdentifier.cs
- NetWebProxyFinder.cs
- PageTheme.cs
- _ListenerRequestStream.cs
- ISFClipboardData.cs
- Utils.cs
- FreezableDefaultValueFactory.cs
- SerialPinChanges.cs
- MailWriter.cs
- ClientBuildManager.cs
- Substitution.cs
- TextTreeRootTextBlock.cs
- VisualBasicValue.cs
- UserInitiatedRoutedEventPermissionAttribute.cs
- DbConnectionPoolCounters.cs
- AlternateView.cs
- MetadataPropertyAttribute.cs
- HttpConfigurationSystem.cs
- Int64KeyFrameCollection.cs
- LockCookie.cs
- TabletDeviceInfo.cs
- XmlAttributes.cs
- MDIWindowDialog.cs
- SpellerHighlightLayer.cs
- WindowsAltTab.cs
- ClientTargetCollection.cs
- FontDifferentiator.cs
- PropertyValueUIItem.cs
- TemplateNameScope.cs
- Visual.cs
- ProgramNode.cs
- HttpContextWrapper.cs
- PartialCachingAttribute.cs
- OdbcRowUpdatingEvent.cs
- TextEffectResolver.cs