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
- formatter.cs
- SafeTimerHandle.cs
- XmlSchemaAny.cs
- Pen.cs
- CmsUtils.cs
- MexTcpBindingElement.cs
- ListItemCollection.cs
- BaseCollection.cs
- XmlSchemaObjectTable.cs
- DoubleSumAggregationOperator.cs
- HtmlImage.cs
- InstanceData.cs
- ExternalCalls.cs
- TdsParserStateObject.cs
- TimeSpanMinutesOrInfiniteConverter.cs
- MasterPageBuildProvider.cs
- TextModifierScope.cs
- IfJoinedCondition.cs
- SimpleFileLog.cs
- DbParameterCollection.cs
- StorageEntitySetMapping.cs
- TextBounds.cs
- Logging.cs
- TypeConverterHelper.cs
- ParserStreamGeometryContext.cs
- CorrelationManager.cs
- StateMachine.cs
- XmlTextEncoder.cs
- Button.cs
- SoapTypeAttribute.cs
- DetailsViewAutoFormat.cs
- TextSegment.cs
- HotSpot.cs
- WebServiceClientProxyGenerator.cs
- TemplateInstanceAttribute.cs
- SpeechEvent.cs
- BuildProvidersCompiler.cs
- GeneratedCodeAttribute.cs
- ExpressionConverter.cs
- ParameterCollection.cs
- SearchForVirtualItemEventArgs.cs
- RelationshipType.cs
- PropertySourceInfo.cs
- DurableInstancingOptions.cs
- ExpressionVisitor.cs
- ErrorTableItemStyle.cs
- CharacterMetricsDictionary.cs
- DPTypeDescriptorContext.cs
- ReadOnlyDataSource.cs
- Utils.cs
- DataFormats.cs
- Int64Animation.cs
- CommandBinding.cs
- IisNotInstalledException.cs
- TransformDescriptor.cs
- ReadOnlyNameValueCollection.cs
- TreePrinter.cs
- FloatSumAggregationOperator.cs
- WebPartZoneBaseDesigner.cs
- CodeExpressionStatement.cs
- XmlUtil.cs
- CodeDefaultValueExpression.cs
- DesignSurfaceEvent.cs
- PageHandlerFactory.cs
- TextBounds.cs
- PolygonHotSpot.cs
- List.cs
- ConcurrentQueue.cs
- TypeGeneratedEventArgs.cs
- ObjectDataSourceFilteringEventArgs.cs
- ElapsedEventArgs.cs
- SubMenuStyle.cs
- DataBindingCollectionEditor.cs
- Transactions.cs
- XsltArgumentList.cs
- SqlColumnizer.cs
- InputQueue.cs
- compensatingcollection.cs
- X509PeerCertificateAuthenticationElement.cs
- Registry.cs
- PrintPreviewControl.cs
- CodeAccessPermission.cs
- XhtmlMobileTextWriter.cs
- _SpnDictionary.cs
- XmlSchemaAppInfo.cs
- HandlerFactoryCache.cs
- HttpServerVarsCollection.cs
- Logging.cs
- MediaPlayerState.cs
- ADMembershipProvider.cs
- StateDesigner.CommentLayoutGlyph.cs
- GenericPrincipal.cs
- CommandBindingCollection.cs
- OperationFormatUse.cs
- InputBinding.cs
- DesignerDataColumn.cs
- XmlTextWriter.cs
- ping.cs
- XPathArrayIterator.cs
- VirtualizedItemProviderWrapper.cs