Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / WF / Common / AuthoringOM / Serializer / StringCollectionMarkupSerializer.cs / 1305376 / StringCollectionMarkupSerializer.cs
namespace System.Workflow.ComponentModel.Serialization
{
using System;
using System.Reflection;
using System.Xml;
using System.ComponentModel;
using System.ComponentModel.Design.Serialization;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Workflow.ComponentModel.Compiler;
internal sealed class StringCollectionMarkupSerializer : WorkflowMarkupSerializer
{
protected internal override PropertyInfo[] GetProperties(WorkflowMarkupSerializationManager manager, object obj)
{
return new PropertyInfo[] { };
}
protected internal override bool CanSerializeToString(WorkflowMarkupSerializationManager serializationManager, object value)
{
if (serializationManager == null)
throw new ArgumentNullException("serializationManager");
if (value == null)
throw new ArgumentNullException("value");
return (value is ICollection);
}
protected internal override string SerializeToString(WorkflowMarkupSerializationManager serializationManager, object value)
{
if (serializationManager == null)
throw new ArgumentNullException("serializationManager");
if (value == null)
throw new ArgumentNullException("value");
return SynchronizationHandlesTypeConverter.Stringify(value as ICollection);
}
protected internal override object DeserializeFromString(WorkflowMarkupSerializationManager serializationManager, Type propertyType, string value)
{
if (serializationManager == null)
throw new ArgumentNullException("serializationManager");
if (propertyType == null)
throw new ArgumentNullException("propertyType");
if (value == null)
throw new ArgumentNullException("value");
// Work around For Bind based properties whose base type is an
// ICollection or its derivative, special case! (A synchronization
// handle cannot begin with a * because it won't be a language independent
// identifier :) )
if (IsValidCompactAttributeFormat(value))
return DeserializeFromCompactFormat(serializationManager, serializationManager.WorkflowMarkupStack[typeof(XmlReader)] as XmlReader, value);
else
return SynchronizationHandlesTypeConverter.UnStringify(value);
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.
namespace System.Workflow.ComponentModel.Serialization
{
using System;
using System.Reflection;
using System.Xml;
using System.ComponentModel;
using System.ComponentModel.Design.Serialization;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Workflow.ComponentModel.Compiler;
internal sealed class StringCollectionMarkupSerializer : WorkflowMarkupSerializer
{
protected internal override PropertyInfo[] GetProperties(WorkflowMarkupSerializationManager manager, object obj)
{
return new PropertyInfo[] { };
}
protected internal override bool CanSerializeToString(WorkflowMarkupSerializationManager serializationManager, object value)
{
if (serializationManager == null)
throw new ArgumentNullException("serializationManager");
if (value == null)
throw new ArgumentNullException("value");
return (value is ICollection);
}
protected internal override string SerializeToString(WorkflowMarkupSerializationManager serializationManager, object value)
{
if (serializationManager == null)
throw new ArgumentNullException("serializationManager");
if (value == null)
throw new ArgumentNullException("value");
return SynchronizationHandlesTypeConverter.Stringify(value as ICollection);
}
protected internal override object DeserializeFromString(WorkflowMarkupSerializationManager serializationManager, Type propertyType, string value)
{
if (serializationManager == null)
throw new ArgumentNullException("serializationManager");
if (propertyType == null)
throw new ArgumentNullException("propertyType");
if (value == null)
throw new ArgumentNullException("value");
// Work around For Bind based properties whose base type is an
// ICollection or its derivative, special case! (A synchronization
// handle cannot begin with a * because it won't be a language independent
// identifier :) )
if (IsValidCompactAttributeFormat(value))
return DeserializeFromCompactFormat(serializationManager, serializationManager.WorkflowMarkupStack[typeof(XmlReader)] as XmlReader, value);
else
return SynchronizationHandlesTypeConverter.UnStringify(value);
}
}
}
// 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
- HighlightVisual.cs
- SemanticAnalyzer.cs
- FixedPageStructure.cs
- HtmlTextArea.cs
- DataGridDesigner.cs
- MemoryFailPoint.cs
- MouseGestureConverter.cs
- FrameworkContentElement.cs
- AnonymousIdentificationModule.cs
- Automation.cs
- Int32CollectionConverter.cs
- AssemblyAttributesGoHere.cs
- PageContentAsyncResult.cs
- Brush.cs
- BinaryObjectWriter.cs
- METAHEADER.cs
- RelatedView.cs
- TrackingProfile.cs
- CellLabel.cs
- EllipseGeometry.cs
- InputDevice.cs
- SerializationInfo.cs
- FormsAuthenticationUser.cs
- Table.cs
- SystemResourceHost.cs
- ColorConvertedBitmap.cs
- TextSegment.cs
- XPathPatternParser.cs
- RegistryConfigurationProvider.cs
- GeometryGroup.cs
- Array.cs
- SequentialOutput.cs
- EntityWithChangeTrackerStrategy.cs
- ServerIdentity.cs
- CodeExpressionCollection.cs
- BitmapDownload.cs
- Pen.cs
- FileNotFoundException.cs
- TreeViewTemplateSelector.cs
- DrawToolTipEventArgs.cs
- DocumentSequence.cs
- InstancePersistenceContext.cs
- DefaultValueMapping.cs
- DbProviderFactoriesConfigurationHandler.cs
- DataGridViewIntLinkedList.cs
- Attributes.cs
- RequestCachePolicy.cs
- EventTrigger.cs
- CatalogPart.cs
- Enum.cs
- ParseChildrenAsPropertiesAttribute.cs
- DataException.cs
- PackageFilter.cs
- DataGridLinkButton.cs
- Rfc2898DeriveBytes.cs
- FormsAuthenticationConfiguration.cs
- RelationshipFixer.cs
- DesignTimeValidationFeature.cs
- CodeRemoveEventStatement.cs
- ColumnReorderedEventArgs.cs
- WaitForChangedResult.cs
- ListenerAdapter.cs
- CompoundFileStorageReference.cs
- GridViewRow.cs
- HttpWebRequest.cs
- XmlNamespaceMappingCollection.cs
- SettingsPropertyValueCollection.cs
- XmlSchemaCollection.cs
- LassoSelectionBehavior.cs
- CharEntityEncoderFallback.cs
- QuadraticBezierSegment.cs
- ProtectedConfiguration.cs
- BaseDataList.cs
- ComponentTray.cs
- cache.cs
- CommandID.cs
- XmlTypeMapping.cs
- InstanceOwner.cs
- String.cs
- ScrollViewer.cs
- UTF7Encoding.cs
- Int32CollectionConverter.cs
- _Events.cs
- FontSource.cs
- ImageMetadata.cs
- FileNotFoundException.cs
- XmlEnumAttribute.cs
- RemotingConfigParser.cs
- FrameworkContentElement.cs
- ListBoxDesigner.cs
- EntityContainerRelationshipSet.cs
- XmlSerializer.cs
- Expander.cs
- ListControlBoundActionList.cs
- XmlDataContract.cs
- WebServiceMethodData.cs
- jithelpers.cs
- AlgoModule.cs
- COMException.cs
- _NestedSingleAsyncResult.cs