Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / WF / Common / AuthoringOM / Serializer / XmlDocumentSurrogate.cs / 1305376 / XmlDocumentSurrogate.cs
namespace System.Workflow.ComponentModel.Serialization { using System; using System.Xml; using System.Runtime.Serialization; using System.Reflection; using System.IO; using System.Runtime.Serialization.Formatters.Binary; #region XmlDocumentSurrogate internal sealed class XmlDocumentSurrogate : ISerializationSurrogate { internal XmlDocumentSurrogate() {} void ISerializationSurrogate.GetObjectData(object obj, SerializationInfo info, StreamingContext context) { XmlDocument doc = obj as XmlDocument; if (doc == null) throw new ArgumentException(SR.GetString(SR.Error_InvalidArgumentValue), "obj"); info.AddValue("innerXml", doc.InnerXml); info.SetType(typeof(XmlDocumentReference)); } object ISerializationSurrogate.SetObjectData(object obj, SerializationInfo info, StreamingContext context, ISurrogateSelector selector) { return null; } #region XmlDocumentReference [Serializable] private sealed class XmlDocumentReference : IObjectReference { private string innerXml = string.Empty; Object IObjectReference.GetRealObject(StreamingContext context) { XmlDocument doc = new XmlDocument(); if (!string.IsNullOrEmpty(this.innerXml)) doc.InnerXml = this.innerXml; return doc; } } #endregion } #endregion } // 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
- RichTextBoxConstants.cs
- RuntimeWrappedException.cs
- StringExpressionSet.cs
- objectresult_tresulttype.cs
- MetadataItemCollectionFactory.cs
- Stream.cs
- httpstaticobjectscollection.cs
- VariableQuery.cs
- UpdateExpressionVisitor.cs
- AppDomain.cs
- StatusBarDrawItemEvent.cs
- CodeMemberEvent.cs
- GraphicsPath.cs
- LinearGradientBrush.cs
- DataSourceXmlSubItemAttribute.cs
- RepeatBehavior.cs
- SqlDataReaderSmi.cs
- DataViewSetting.cs
- SrgsGrammar.cs
- CustomBindingElement.cs
- DataObjectSettingDataEventArgs.cs
- HttpApplicationFactory.cs
- ClientConvert.cs
- thaishape.cs
- XmlSecureResolver.cs
- ManifestResourceInfo.cs
- AutomationPeer.cs
- SoapProtocolReflector.cs
- DoubleIndependentAnimationStorage.cs
- AnnotationComponentManager.cs
- MouseActionValueSerializer.cs
- WorkerRequest.cs
- PropertyEmitterBase.cs
- SubMenuStyleCollectionEditor.cs
- TimeSpanFormat.cs
- SqlCacheDependencyDatabaseCollection.cs
- log.cs
- PerfCounters.cs
- JoinQueryOperator.cs
- StyleTypedPropertyAttribute.cs
- SmiTypedGetterSetter.cs
- SlipBehavior.cs
- PerformanceCountersElement.cs
- ListenerElementsCollection.cs
- SoapTypeAttribute.cs
- InternalsVisibleToAttribute.cs
- AuthenticatedStream.cs
- BrowsableAttribute.cs
- XmlSignificantWhitespace.cs
- _IPv4Address.cs
- DllNotFoundException.cs
- Panel.cs
- UrlPropertyAttribute.cs
- TextWriter.cs
- ToolStripDesignerAvailabilityAttribute.cs
- ListViewHitTestInfo.cs
- Geometry.cs
- CounterCreationDataCollection.cs
- DesignConnectionCollection.cs
- RowUpdatingEventArgs.cs
- XPathDescendantIterator.cs
- ScopelessEnumAttribute.cs
- ExceptQueryOperator.cs
- QilFactory.cs
- TcpWorkerProcess.cs
- IdentityNotMappedException.cs
- RuntimeConfig.cs
- XPathChildIterator.cs
- TypeInitializationException.cs
- _emptywebproxy.cs
- TraceHandlerErrorFormatter.cs
- DbgCompiler.cs
- EventlogProvider.cs
- SafeNativeMethods.cs
- NullRuntimeConfig.cs
- IndependentlyAnimatedPropertyMetadata.cs
- ErrorTableItemStyle.cs
- NetNamedPipeBinding.cs
- UIElementParagraph.cs
- PageFunction.cs
- Adorner.cs
- CompoundFileDeflateTransform.cs
- SqlHelper.cs
- TextTreeTextBlock.cs
- IndexedGlyphRun.cs
- GeometryValueSerializer.cs
- StructuredTypeEmitter.cs
- SQLDecimalStorage.cs
- HttpApplication.cs
- DBDataPermissionAttribute.cs
- IgnoreDeviceFilterElementCollection.cs
- DrawItemEvent.cs
- MarkedHighlightComponent.cs
- NavigationProgressEventArgs.cs
- SynchronizationLockException.cs
- WebPartDisplayMode.cs
- CqlBlock.cs
- StringAnimationBase.cs
- KnownTypeDataContractResolver.cs
- EndGetFileNameFromUserRequest.cs