Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / DataEntity / System / Data / Map / Update / Internal / ExtractedStateEntry.cs / 1305376 / ExtractedStateEntry.cs
//---------------------------------------------------------------------- //// Copyright (c) Microsoft Corporation. All rights reserved. // // // @owner [....] //--------------------------------------------------------------------- using System.Collections.Generic; using System.Data.Common.CommandTrees; using System.Data.Metadata.Edm; using System.Diagnostics; using System.Linq; namespace System.Data.Mapping.Update.Internal { ////// Represents the data contained in a StateEntry using internal data structures /// of the UpdatePipeline. /// internal struct ExtractedStateEntry { internal readonly EntityState State; internal readonly PropagatorResult Original; internal readonly PropagatorResult Current; internal readonly IEntityStateEntry Source; internal ExtractedStateEntry(UpdateTranslator translator, IEntityStateEntry stateEntry) { Debug.Assert(null != stateEntry, "stateEntry must not be null"); this.State = stateEntry.State; this.Source = stateEntry; switch (stateEntry.State) { case EntityState.Deleted: this.Original = translator.RecordConverter.ConvertOriginalValuesToPropagatorResult( stateEntry, ModifiedPropertiesBehavior.AllModified); this.Current = null; break; case EntityState.Unchanged: this.Original = translator.RecordConverter.ConvertOriginalValuesToPropagatorResult( stateEntry, ModifiedPropertiesBehavior.NoneModified); this.Current = translator.RecordConverter.ConvertCurrentValuesToPropagatorResult( stateEntry, ModifiedPropertiesBehavior.NoneModified); break; case EntityState.Modified: this.Original = translator.RecordConverter.ConvertOriginalValuesToPropagatorResult( stateEntry, ModifiedPropertiesBehavior.SomeModified); this.Current = translator.RecordConverter.ConvertCurrentValuesToPropagatorResult( stateEntry, ModifiedPropertiesBehavior.SomeModified); break; case EntityState.Added: this.Original = null; this.Current = translator.RecordConverter.ConvertCurrentValuesToPropagatorResult( stateEntry, ModifiedPropertiesBehavior.AllModified); break; default: Debug.Fail("unexpected IEntityStateEntry.State for entity " + stateEntry.State); this.Original = null; this.Current = null; break; } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //---------------------------------------------------------------------- //// Copyright (c) Microsoft Corporation. All rights reserved. // // // @owner [....] //--------------------------------------------------------------------- using System.Collections.Generic; using System.Data.Common.CommandTrees; using System.Data.Metadata.Edm; using System.Diagnostics; using System.Linq; namespace System.Data.Mapping.Update.Internal { ////// Represents the data contained in a StateEntry using internal data structures /// of the UpdatePipeline. /// internal struct ExtractedStateEntry { internal readonly EntityState State; internal readonly PropagatorResult Original; internal readonly PropagatorResult Current; internal readonly IEntityStateEntry Source; internal ExtractedStateEntry(UpdateTranslator translator, IEntityStateEntry stateEntry) { Debug.Assert(null != stateEntry, "stateEntry must not be null"); this.State = stateEntry.State; this.Source = stateEntry; switch (stateEntry.State) { case EntityState.Deleted: this.Original = translator.RecordConverter.ConvertOriginalValuesToPropagatorResult( stateEntry, ModifiedPropertiesBehavior.AllModified); this.Current = null; break; case EntityState.Unchanged: this.Original = translator.RecordConverter.ConvertOriginalValuesToPropagatorResult( stateEntry, ModifiedPropertiesBehavior.NoneModified); this.Current = translator.RecordConverter.ConvertCurrentValuesToPropagatorResult( stateEntry, ModifiedPropertiesBehavior.NoneModified); break; case EntityState.Modified: this.Original = translator.RecordConverter.ConvertOriginalValuesToPropagatorResult( stateEntry, ModifiedPropertiesBehavior.SomeModified); this.Current = translator.RecordConverter.ConvertCurrentValuesToPropagatorResult( stateEntry, ModifiedPropertiesBehavior.SomeModified); break; case EntityState.Added: this.Original = null; this.Current = translator.RecordConverter.ConvertCurrentValuesToPropagatorResult( stateEntry, ModifiedPropertiesBehavior.AllModified); break; default: Debug.Fail("unexpected IEntityStateEntry.State for entity " + stateEntry.State); this.Original = null; this.Current = null; break; } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- BinaryObjectReader.cs
- QueryPageSettingsEventArgs.cs
- TypeHelpers.cs
- ColorAnimationUsingKeyFrames.cs
- HTMLTextWriter.cs
- _NestedMultipleAsyncResult.cs
- HTMLTextWriter.cs
- ConditionalWeakTable.cs
- SqlProfileProvider.cs
- TypeToArgumentTypeConverter.cs
- SettingsPropertyIsReadOnlyException.cs
- AmbientProperties.cs
- HtmlDocument.cs
- ObjectViewListener.cs
- LinqDataSourceDisposeEventArgs.cs
- MethodBuilder.cs
- RoleBoolean.cs
- Deserializer.cs
- ListViewEditEventArgs.cs
- RegularExpressionValidator.cs
- SQLSingle.cs
- RoutedUICommand.cs
- PhysicalOps.cs
- OciLobLocator.cs
- NullableBoolConverter.cs
- SqlConnectionStringBuilder.cs
- FrameworkRichTextComposition.cs
- X509ChainPolicy.cs
- Literal.cs
- ShapingEngine.cs
- TypeDescriptionProviderAttribute.cs
- DotNetATv1WindowsLogEntrySerializer.cs
- TabControlCancelEvent.cs
- SecurityKeyEntropyMode.cs
- OuterGlowBitmapEffect.cs
- SystemWebExtensionsSectionGroup.cs
- TypedDatasetGenerator.cs
- SafeRightsManagementSessionHandle.cs
- HtmlShimManager.cs
- SetterBase.cs
- MimeObjectFactory.cs
- TextBoxBase.cs
- RelatedView.cs
- Table.cs
- PngBitmapDecoder.cs
- PocoPropertyAccessorStrategy.cs
- _DisconnectOverlappedAsyncResult.cs
- SoapObjectWriter.cs
- ReadOnlyActivityGlyph.cs
- ObjectDataSourceEventArgs.cs
- PrintDocument.cs
- VariableAction.cs
- CalendarDataBindingHandler.cs
- EncodingInfo.cs
- WindowsListViewGroupHelper.cs
- Rotation3D.cs
- IdleTimeoutMonitor.cs
- ApplicationGesture.cs
- UriExt.cs
- XmlSchemaChoice.cs
- PaintValueEventArgs.cs
- SqlHelper.cs
- BindingsCollection.cs
- ProcessProtocolHandler.cs
- OleDbConnectionPoolGroupProviderInfo.cs
- OdbcDataReader.cs
- BuilderElements.cs
- ThreadStaticAttribute.cs
- XmlSchemaAnyAttribute.cs
- TextSyndicationContent.cs
- HitTestResult.cs
- Blend.cs
- QueryTask.cs
- SafeSecurityHandles.cs
- ReferencedType.cs
- Debug.cs
- LinqDataSourceUpdateEventArgs.cs
- EncoderBestFitFallback.cs
- CroppedBitmap.cs
- MarkupProperty.cs
- DataGridRowsPresenter.cs
- Pkcs7Signer.cs
- future.cs
- PhysicalAddress.cs
- StreamInfo.cs
- WebZone.cs
- PaintValueEventArgs.cs
- SqlWorkflowPersistenceService.cs
- CommandDevice.cs
- DataGridLinkButton.cs
- TimeBoundedCache.cs
- TagPrefixCollection.cs
- ImmutableAssemblyCacheEntry.cs
- DataObjectFieldAttribute.cs
- XmlSerializerAssemblyAttribute.cs
- ResourcePool.cs
- StringComparer.cs
- InvalidDataException.cs
- SiteMapDesignerDataSourceView.cs
- SimpleWebHandlerParser.cs