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
- FigureParagraph.cs
- ParameterBuilder.cs
- JsonFormatWriterGenerator.cs
- OleDbConnectionFactory.cs
- StaticExtension.cs
- CLRBindingWorker.cs
- Vector3D.cs
- XsdValidatingReader.cs
- ListBoxChrome.cs
- RadioButtonRenderer.cs
- InkSerializer.cs
- RepeaterItemEventArgs.cs
- OdbcInfoMessageEvent.cs
- NullableLongSumAggregationOperator.cs
- GC.cs
- NameValueConfigurationCollection.cs
- GridViewDeletedEventArgs.cs
- GenericEnumConverter.cs
- WindowsListViewGroupHelper.cs
- WaitHandleCannotBeOpenedException.cs
- ComNativeDescriptor.cs
- JsonGlobals.cs
- SiteMapSection.cs
- BookmarkCallbackWrapper.cs
- ConstraintCollection.cs
- BitmapEffectGroup.cs
- GuidelineCollection.cs
- MethodCallExpression.cs
- StoryFragments.cs
- AuthorizationRule.cs
- cookiecontainer.cs
- BinaryMethodMessage.cs
- HttpRequestCacheValidator.cs
- PolicyStatement.cs
- Debug.cs
- XmlSchemaExporter.cs
- TextFindEngine.cs
- ScriptMethodAttribute.cs
- HostingMessageProperty.cs
- CollectionTypeElement.cs
- ResourcesChangeInfo.cs
- SQLBinary.cs
- XmlSchemaExporter.cs
- ApplyTemplatesAction.cs
- GridViewRowEventArgs.cs
- Pair.cs
- xsdvalidator.cs
- ObjectDataSourceEventArgs.cs
- CompiledQuery.cs
- BufferedWebEventProvider.cs
- SyndicationElementExtensionCollection.cs
- FontClient.cs
- COM2ExtendedUITypeEditor.cs
- WebPartEditorCancelVerb.cs
- BasicKeyConstraint.cs
- BaseParaClient.cs
- RSAOAEPKeyExchangeFormatter.cs
- DllHostedComPlusServiceHost.cs
- PathParser.cs
- ChannelSinkStacks.cs
- KerberosTokenFactoryCredential.cs
- BindingBase.cs
- FileDialog.cs
- ILGenerator.cs
- MatchingStyle.cs
- TransactionContextValidator.cs
- SiteMapPath.cs
- ExpressionCopier.cs
- WebBaseEventKeyComparer.cs
- SQLBinaryStorage.cs
- RelatedView.cs
- PlainXmlDeserializer.cs
- TableLayoutCellPaintEventArgs.cs
- ConditionCollection.cs
- EventManager.cs
- DataList.cs
- WindowsScrollBarBits.cs
- HandlerMappingMemo.cs
- TreeNodeCollection.cs
- DataSet.cs
- XNameConverter.cs
- TreeViewImageKeyConverter.cs
- ModifierKeysValueSerializer.cs
- WsdlInspector.cs
- XPathParser.cs
- ToolStripPanelRow.cs
- GlobalItem.cs
- FixedSOMSemanticBox.cs
- StructuredTypeEmitter.cs
- RequiredFieldValidator.cs
- StickyNote.cs
- PolyBezierSegmentFigureLogic.cs
- ControlParameter.cs
- HTMLTagNameToTypeMapper.cs
- DataTableNewRowEvent.cs
- CodeDelegateCreateExpression.cs
- MonthCalendarDesigner.cs
- LongValidator.cs
- ListView.cs
- HtmlLinkAdapter.cs