Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Framework / System / Windows / TemplateContentLoader.cs / 1305600 / TemplateContentLoader.cs
using System; using System.ComponentModel; using System.Xaml; namespace System.Windows { public class TemplateContentLoader : XamlDeferringLoader { public override object Load(XamlReader xamlReader, IServiceProvider serviceProvider) { if (serviceProvider == null) { throw new ArgumentNullException("serviceProvider"); } else if (xamlReader == null) { throw new ArgumentNullException("xamlReader"); } IXamlObjectWriterFactory factory = RequireService(serviceProvider); return new TemplateContent(xamlReader, factory, serviceProvider); } private static T RequireService (IServiceProvider provider) where T : class { T result = provider.GetService(typeof(T)) as T; if (result == null) { throw new InvalidOperationException(SR.Get(SRID.DeferringLoaderNoContext,typeof(TemplateContentLoader).Name, typeof(T).Name)); } return result; } public override XamlReader Save(object value, IServiceProvider serviceProvider) { throw new NotSupportedException(SR.Get(SRID.DeferringLoaderNoSave, typeof(TemplateContentLoader).Name)); } } } // 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
- Aes.cs
- XmlDataProvider.cs
- FileNotFoundException.cs
- PageCatalogPartDesigner.cs
- XmlCustomFormatter.cs
- DataStreamFromComStream.cs
- IImplicitResourceProvider.cs
- DragDropManager.cs
- XamlFigureLengthSerializer.cs
- QuadraticBezierSegment.cs
- ApplicationProxyInternal.cs
- GlobalizationAssembly.cs
- ObjectSpanRewriter.cs
- ExpressionList.cs
- AccessDataSource.cs
- CodeSnippetExpression.cs
- RectangleConverter.cs
- ContentFilePart.cs
- DataRowChangeEvent.cs
- base64Transforms.cs
- ApplicationSettingsBase.cs
- DateTimeConverter.cs
- ActivityValidator.cs
- CompareInfo.cs
- QueryStringParameter.cs
- PrivateFontCollection.cs
- TextRunTypographyProperties.cs
- StackOverflowException.cs
- LineSegment.cs
- SoapAttributeAttribute.cs
- ConfigXmlComment.cs
- TextFormatterImp.cs
- BuildResult.cs
- PenContexts.cs
- BitConverter.cs
- DataGridViewToolTip.cs
- UIAgentRequest.cs
- MenuItem.cs
- mongolianshape.cs
- ControlAdapter.cs
- ChangeNode.cs
- WSSecureConversationDec2005.cs
- ValidationErrorCollection.cs
- PartialTrustVisibleAssembly.cs
- InfoCardRequestException.cs
- LoginName.cs
- SkipStoryboardToFill.cs
- EllipticalNodeOperations.cs
- ExpressionEditorAttribute.cs
- AddInContractAttribute.cs
- TraceProvider.cs
- WorkflowViewElement.cs
- MarshalDirectiveException.cs
- TaskFileService.cs
- ToolStripLocationCancelEventArgs.cs
- ResourcePart.cs
- DataPagerCommandEventArgs.cs
- ValidatorCompatibilityHelper.cs
- AggregationMinMaxHelpers.cs
- SpellCheck.cs
- CustomSignedXml.cs
- PlatformCulture.cs
- ScriptMethodAttribute.cs
- EditorServiceContext.cs
- Page.cs
- IconConverter.cs
- GACMembershipCondition.cs
- Calendar.cs
- Site.cs
- ExpandSegment.cs
- BinaryFormatter.cs
- SynchronizationContext.cs
- InstanceCreationEditor.cs
- _TimerThread.cs
- ConfigurationElement.cs
- CompilationRelaxations.cs
- ReferenceEqualityComparer.cs
- Win32MouseDevice.cs
- EdgeProfileValidation.cs
- IPGlobalProperties.cs
- WebPartCatalogAddVerb.cs
- DocumentScope.cs
- TypeDescriptorContext.cs
- ZoneButton.cs
- Double.cs
- PropertyChangingEventArgs.cs
- DrawingBrush.cs
- ListViewItem.cs
- DocobjHost.cs
- EventProviderWriter.cs
- QilUnary.cs
- FileIOPermission.cs
- CompositeTypefaceMetrics.cs
- _ConnectionGroup.cs
- VirtualPathUtility.cs
- ActiveDocumentEvent.cs
- SqlExpressionNullability.cs
- BindingManagerDataErrorEventArgs.cs
- EdmToObjectNamespaceMap.cs
- LocalBuilder.cs