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
- Helper.cs
- IdentifierCreationService.cs
- UInt64.cs
- NativeMethods.cs
- TcpProcessProtocolHandler.cs
- SafeEventLogWriteHandle.cs
- InplaceBitmapMetadataWriter.cs
- TextTreeDeleteContentUndoUnit.cs
- GridProviderWrapper.cs
- OrderedEnumerableRowCollection.cs
- NavigationExpr.cs
- ViewStateModeByIdAttribute.cs
- DatatypeImplementation.cs
- TypeUtils.cs
- Misc.cs
- BinaryParser.cs
- ContextBase.cs
- UnsupportedPolicyOptionsException.cs
- MenuItemStyleCollection.cs
- AggregatePushdown.cs
- SchemaImporter.cs
- MetadataUtil.cs
- CommandHelpers.cs
- ActivityInstanceReference.cs
- XmlSerializerVersionAttribute.cs
- SineEase.cs
- SelectionUIHandler.cs
- PerformanceCounters.cs
- XsltInput.cs
- Ray3DHitTestResult.cs
- WebPartDesigner.cs
- ItemsChangedEventArgs.cs
- FileDialog_Vista_Interop.cs
- IntersectQueryOperator.cs
- DataGridViewRowPostPaintEventArgs.cs
- OverflowException.cs
- ExtenderControl.cs
- elementinformation.cs
- Message.cs
- _RequestLifetimeSetter.cs
- AppDomainProtocolHandler.cs
- BamlCollectionHolder.cs
- PartialList.cs
- COM2IProvidePropertyBuilderHandler.cs
- DrawingBrush.cs
- ArrayEditor.cs
- UIElement3DAutomationPeer.cs
- SerializationStore.cs
- CodeConstructor.cs
- IdentityModelDictionary.cs
- SQLBinary.cs
- MetadataHelper.cs
- FlowDocumentFormatter.cs
- JoinCqlBlock.cs
- ResourceIDHelper.cs
- XmlNodeList.cs
- Column.cs
- TabItem.cs
- FontNameEditor.cs
- PropertyPath.cs
- HtmlUtf8RawTextWriter.cs
- EditCommandColumn.cs
- ColorMatrix.cs
- SchemaInfo.cs
- safesecurityhelperavalon.cs
- RegexEditorDialog.cs
- InkCanvasInnerCanvas.cs
- TrackingStringDictionary.cs
- TakeQueryOptionExpression.cs
- ImageMap.cs
- XmlMapping.cs
- PieceDirectory.cs
- RequiredFieldValidator.cs
- FullTextState.cs
- ResolveNameEventArgs.cs
- ManagementEventArgs.cs
- SplitContainer.cs
- CriticalFinalizerObject.cs
- ThreadAbortException.cs
- TimeSpanHelper.cs
- AssemblyInfo.cs
- RegexCompilationInfo.cs
- CallbackValidator.cs
- EncoderNLS.cs
- SectionUpdates.cs
- ValueTable.cs
- RichTextBox.cs
- EncryptedData.cs
- SectionInput.cs
- SkinBuilder.cs
- StringExpressionSet.cs
- MarkupCompilePass2.cs
- dataobject.cs
- UIElement3D.cs
- CompositionAdorner.cs
- CompilationSection.cs
- TheQuery.cs
- Soap.cs
- XmlSerializerVersionAttribute.cs
- Configuration.cs