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
- WsdlBuildProvider.cs
- WorkflowMessageEventHandler.cs
- ListItemCollection.cs
- RIPEMD160Managed.cs
- CodeParameterDeclarationExpression.cs
- TemplateBuilder.cs
- ColumnMapTranslator.cs
- TimeSpanConverter.cs
- XmlAttributeCollection.cs
- EntityDataSourceColumn.cs
- SecurityTokenResolver.cs
- ObjectFactoryCodeDomTreeGenerator.cs
- ListParagraph.cs
- ListViewGroupConverter.cs
- FileSystemEnumerable.cs
- SqlExpander.cs
- PKCS1MaskGenerationMethod.cs
- CodeTryCatchFinallyStatement.cs
- WaitForChangedResult.cs
- datacache.cs
- SpoolingTaskBase.cs
- PeerUnsafeNativeCryptMethods.cs
- HttpServerProtocol.cs
- WebServiceHost.cs
- DropShadowBitmapEffect.cs
- StylusTip.cs
- MobileListItemCollection.cs
- HebrewCalendar.cs
- PolicyLevel.cs
- CapabilitiesPattern.cs
- EncodingTable.cs
- PropertyDescriptorComparer.cs
- securitycriticaldata.cs
- BindingOperations.cs
- PersonalizationAdministration.cs
- UserControlDesigner.cs
- MultidimensionalArrayItemReference.cs
- SQLString.cs
- TextAdaptor.cs
- PropertyManager.cs
- DocumentViewerHelper.cs
- ToolStripSystemRenderer.cs
- InputMethod.cs
- XmlSchemaComplexContentRestriction.cs
- AspNetSynchronizationContext.cs
- ResourceAttributes.cs
- RoutedPropertyChangedEventArgs.cs
- ViewCellRelation.cs
- BitmapEffectInputData.cs
- PrintingPermissionAttribute.cs
- CollectionViewGroupRoot.cs
- FileInfo.cs
- ThreadLocal.cs
- DateTimeUtil.cs
- ToolBarButton.cs
- HtmlEncodedRawTextWriter.cs
- ItemMap.cs
- NotificationContext.cs
- EncryptedReference.cs
- AnimationTimeline.cs
- DesignerAttribute.cs
- ObjectNavigationPropertyMapping.cs
- RootBrowserWindowProxy.cs
- WebPartMovingEventArgs.cs
- VisualStyleTypesAndProperties.cs
- AvTraceFormat.cs
- PrintDialog.cs
- DiagnosticTrace.cs
- ViewGenResults.cs
- TableRowCollection.cs
- StrokeDescriptor.cs
- CursorInteropHelper.cs
- InputLanguageManager.cs
- login.cs
- NetworkInformationException.cs
- XmlMapping.cs
- DocumentAutomationPeer.cs
- XamlSerializerUtil.cs
- ActionItem.cs
- OutputCacheProviderCollection.cs
- ObjectTag.cs
- WizardForm.cs
- EpmCustomContentWriterNodeData.cs
- _LocalDataStoreMgr.cs
- Win32MouseDevice.cs
- DocumentViewerAutomationPeer.cs
- TemplateColumn.cs
- BuildProvider.cs
- MaskDescriptors.cs
- SecurityHeader.cs
- GridViewCellAutomationPeer.cs
- ToolboxItemImageConverter.cs
- StrokeFIndices.cs
- NotifyParentPropertyAttribute.cs
- EncodingInfo.cs
- TextSpanModifier.cs
- CodeConstructor.cs
- DataGridHyperlinkColumn.cs
- ToolBar.cs
- GetWinFXPath.cs