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
- HtmlTableCell.cs
- MarshalDirectiveException.cs
- DeferredSelectedIndexReference.cs
- XmlSchemaImport.cs
- SByteStorage.cs
- EventManager.cs
- CodeCommentStatementCollection.cs
- BuildProviderAppliesToAttribute.cs
- NetMsmqBindingCollectionElement.cs
- IntPtr.cs
- ProfessionalColorTable.cs
- WebUtil.cs
- RowsCopiedEventArgs.cs
- InternalEnumValidator.cs
- ItemDragEvent.cs
- PersonalizationState.cs
- HierarchicalDataSourceControl.cs
- NetStream.cs
- MustUnderstandSoapException.cs
- RangeValuePattern.cs
- HttpFileCollection.cs
- ContextStaticAttribute.cs
- PrincipalPermissionMode.cs
- DispatchWrapper.cs
- PointAnimationUsingPath.cs
- XPathExpr.cs
- PropertyStore.cs
- DateTimeConstantAttribute.cs
- MouseButton.cs
- CaseCqlBlock.cs
- ConfigXmlSignificantWhitespace.cs
- ApplicationSecurityManager.cs
- Semaphore.cs
- TypeConverterHelper.cs
- AutoGeneratedFieldProperties.cs
- XmlCharType.cs
- AutomationPatternInfo.cs
- StorageEndPropertyMapping.cs
- DataPointer.cs
- ErrorHandler.cs
- PopupRootAutomationPeer.cs
- ObjectStateFormatter.cs
- CasesDictionary.cs
- EdmItemCollection.OcAssemblyCache.cs
- MessageDirection.cs
- CrossContextChannel.cs
- BackgroundWorker.cs
- PropertyEmitter.cs
- XhtmlBasicPhoneCallAdapter.cs
- PathSegmentCollection.cs
- RTLAwareMessageBox.cs
- RemotingConfigParser.cs
- XamlRtfConverter.cs
- BinHexDecoder.cs
- DoubleKeyFrameCollection.cs
- MdImport.cs
- SectionVisual.cs
- XamlInt32CollectionSerializer.cs
- HttpApplication.cs
- NameObjectCollectionBase.cs
- DefaultTraceListener.cs
- XmlObjectSerializerContext.cs
- CommandHelpers.cs
- SkinBuilder.cs
- CommonGetThemePartSize.cs
- InvalidateEvent.cs
- Operator.cs
- SqlExpander.cs
- QueueProcessor.cs
- FormViewPageEventArgs.cs
- WebPartConnectionsConnectVerb.cs
- SystemDropShadowChrome.cs
- XLinq.cs
- TemplatePagerField.cs
- cookie.cs
- XPathDescendantIterator.cs
- PowerStatus.cs
- XamlTemplateSerializer.cs
- TextFormatterHost.cs
- QuaternionAnimationBase.cs
- OptimizerPatterns.cs
- PrintDialogException.cs
- DataObjectAttribute.cs
- PointIndependentAnimationStorage.cs
- ApplicationSettingsBase.cs
- MetaColumn.cs
- XPathConvert.cs
- Types.cs
- StorageEndPropertyMapping.cs
- Stacktrace.cs
- ZoneMembershipCondition.cs
- DesignerEditorPartChrome.cs
- ListBoxAutomationPeer.cs
- ClientConvert.cs
- OrderedDictionaryStateHelper.cs
- PngBitmapDecoder.cs
- PrintDialog.cs
- RectConverter.cs
- DesignerActionVerbList.cs
- WebRequestModulesSection.cs