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
- PageVisual.cs
- ConfigurationSettings.cs
- IncrementalCompileAnalyzer.cs
- CRYPTPROTECT_PROMPTSTRUCT.cs
- WebPartDisplayModeEventArgs.cs
- FileSystemEventArgs.cs
- LinkArea.cs
- PrePrepareMethodAttribute.cs
- LockRenewalTask.cs
- LayoutSettings.cs
- Completion.cs
- DBPropSet.cs
- Focus.cs
- ConstraintManager.cs
- ExceptionHelpers.cs
- PassportAuthenticationModule.cs
- DataGrid.cs
- CurrentTimeZone.cs
- ListSourceHelper.cs
- AsyncOperation.cs
- XmlSchemaComplexContentExtension.cs
- XmlSchemaNotation.cs
- RuleProcessor.cs
- HttpServerVarsCollection.cs
- Misc.cs
- MulticastOption.cs
- ObjectDataSourceFilteringEventArgs.cs
- OleAutBinder.cs
- FastEncoderStatics.cs
- EDesignUtil.cs
- iisPickupDirectory.cs
- FieldDescriptor.cs
- Point3DValueSerializer.cs
- Vector3D.cs
- CharacterShapingProperties.cs
- GregorianCalendar.cs
- XmlSubtreeReader.cs
- NumericUpDown.cs
- Visitor.cs
- AliasExpr.cs
- DiscoveryMessageSequence11.cs
- LabelLiteral.cs
- WorkflowMarkupElementEventArgs.cs
- ExceptionHandlers.cs
- BamlResourceContent.cs
- BaseParser.cs
- ApplicationDirectoryMembershipCondition.cs
- ResolveNameEventArgs.cs
- UserControlCodeDomTreeGenerator.cs
- UpDownBase.cs
- DependencyPropertyKey.cs
- SafeProcessHandle.cs
- PageAsyncTaskManager.cs
- XmlException.cs
- HiddenFieldPageStatePersister.cs
- SqlPersistenceWorkflowInstanceDescription.cs
- OleDbMetaDataFactory.cs
- TimeoutStream.cs
- SmtpMail.cs
- AsyncCodeActivityContext.cs
- DataRecordObjectView.cs
- HtmlSelect.cs
- CryptoConfig.cs
- SmtpNtlmAuthenticationModule.cs
- ResolveNameEventArgs.cs
- log.cs
- PathFigure.cs
- SqlXmlStorage.cs
- AssemblyBuilder.cs
- GridViewSelectEventArgs.cs
- BuildManagerHost.cs
- ListViewInsertEventArgs.cs
- CacheEntry.cs
- httpserverutility.cs
- RijndaelCryptoServiceProvider.cs
- TokenBasedSetEnumerator.cs
- WhereQueryOperator.cs
- DbgUtil.cs
- FlowPanelDesigner.cs
- ReadWriteSpinLock.cs
- StorageModelBuildProvider.cs
- SplitterEvent.cs
- WebPartsPersonalizationAuthorization.cs
- XmlCharType.cs
- SpeechUI.cs
- MasterPage.cs
- InheritedPropertyDescriptor.cs
- SynchronizingStream.cs
- FactoryId.cs
- RequestResizeEvent.cs
- DateRangeEvent.cs
- AccessControlList.cs
- ConnectorDragDropGlyph.cs
- AnnotationService.cs
- StylusDownEventArgs.cs
- RawAppCommandInputReport.cs
- HwndProxyElementProvider.cs
- DurableEnlistmentState.cs
- ExpandCollapseProviderWrapper.cs
- ToolZoneDesigner.cs