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
- BitmapData.cs
- SettingsSavedEventArgs.cs
- ErrorTableItemStyle.cs
- DataSourceView.cs
- SimpleMailWebEventProvider.cs
- Label.cs
- AuthenticationSection.cs
- BindingMemberInfo.cs
- DataGridViewCellErrorTextNeededEventArgs.cs
- WebPartUserCapability.cs
- FunctionDetailsReader.cs
- PartManifestEntry.cs
- DataGridViewUtilities.cs
- Debug.cs
- path.cs
- ListControlDesigner.cs
- RegistryKey.cs
- ViewgenContext.cs
- CompiledQuery.cs
- GetCertificateRequest.cs
- Rect3D.cs
- MouseEvent.cs
- HandleRef.cs
- StreamGeometryContext.cs
- QEncodedStream.cs
- WindowsScroll.cs
- MenuItemStyle.cs
- CodeVariableReferenceExpression.cs
- PermissionToken.cs
- WizardPanel.cs
- StateElementCollection.cs
- TextOptionsInternal.cs
- PenContext.cs
- ASCIIEncoding.cs
- AdornerLayer.cs
- AnimationStorage.cs
- UniqueEventHelper.cs
- ReadOnlyObservableCollection.cs
- MaskPropertyEditor.cs
- SqlBulkCopyColumnMapping.cs
- CategoryGridEntry.cs
- InternalRelationshipCollection.cs
- SessionPageStatePersister.cs
- DesignTimeSiteMapProvider.cs
- MaskDescriptor.cs
- WindowsImpersonationContext.cs
- ToolBarButton.cs
- BindingMemberInfo.cs
- FixedBufferAttribute.cs
- XmlSchemaAttributeGroupRef.cs
- EntityDataSourceUtil.cs
- RegisteredExpandoAttribute.cs
- CharEntityEncoderFallback.cs
- MetadataPropertyCollection.cs
- ProtocolsSection.cs
- StrongNameKeyPair.cs
- CultureInfoConverter.cs
- RangeExpression.cs
- ObjectDataSourceMethodEventArgs.cs
- XMLUtil.cs
- ReadContentAsBinaryHelper.cs
- HttpListenerException.cs
- UIElement.cs
- ProfileService.cs
- ToolStripPanelRow.cs
- MarkupProperty.cs
- WinEventTracker.cs
- SecurityNegotiationException.cs
- ConstraintEnumerator.cs
- SBCSCodePageEncoding.cs
- Int32.cs
- SpeakProgressEventArgs.cs
- NameTable.cs
- XmlSerializationWriter.cs
- SQLCharsStorage.cs
- DurableInstanceProvider.cs
- BasicCellRelation.cs
- WebPartManager.cs
- GenericTypeParameterBuilder.cs
- PreProcessInputEventArgs.cs
- DecimalAnimation.cs
- EdgeProfileValidation.cs
- TableLayoutPanel.cs
- ValidatedControlConverter.cs
- XPathNode.cs
- RC2.cs
- ModelService.cs
- RelatedCurrencyManager.cs
- AnnotationStore.cs
- DesignerSerializerAttribute.cs
- RelationshipEnd.cs
- TreeViewTemplateSelector.cs
- ObjectStateEntryDbDataRecord.cs
- DrawingImage.cs
- WebPartTransformerAttribute.cs
- TickBar.cs
- DllNotFoundException.cs
- Pkcs7Signer.cs
- StylusPoint.cs
- AssemblyCollection.cs