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
- SuspendDesigner.cs
- CounterCreationData.cs
- WindowsListViewSubItem.cs
- AppSettingsExpressionBuilder.cs
- HierarchicalDataBoundControl.cs
- RequestCacheValidator.cs
- DiagnosticsConfiguration.cs
- XmlMemberMapping.cs
- Activation.cs
- ClassImporter.cs
- FlowLayoutPanel.cs
- StatusBarPanelClickEvent.cs
- XmlSerializationGeneratedCode.cs
- TabControlCancelEvent.cs
- UnmanagedMemoryStreamWrapper.cs
- Utils.cs
- SBCSCodePageEncoding.cs
- EntityCommandExecutionException.cs
- PriorityBinding.cs
- DataGridViewButtonCell.cs
- UIAgentInitializationException.cs
- DifferencingCollection.cs
- PersianCalendar.cs
- DataKey.cs
- QilCloneVisitor.cs
- EpmSourceTree.cs
- DataViewManager.cs
- NullableLongSumAggregationOperator.cs
- ResourceCodeDomSerializer.cs
- ToolStripButton.cs
- XmlSchemaAnnotation.cs
- DrawingImage.cs
- CodeTypeParameter.cs
- MediaSystem.cs
- MetabaseServerConfig.cs
- RowUpdatedEventArgs.cs
- CodeTypeDelegate.cs
- XmlCDATASection.cs
- ResourceDescriptionAttribute.cs
- WSHttpBindingBaseElement.cs
- OleDbErrorCollection.cs
- EditBehavior.cs
- HtmlFormWrapper.cs
- ItemCheckedEvent.cs
- UnauthorizedAccessException.cs
- CustomAttributeFormatException.cs
- documentsequencetextview.cs
- ConnectionManagementElementCollection.cs
- _CookieModule.cs
- VectorValueSerializer.cs
- MenuBindingsEditor.cs
- COAUTHINFO.cs
- DeferredReference.cs
- RegisteredScript.cs
- RawMouseInputReport.cs
- SafeSecurityHandles.cs
- EventLogger.cs
- TextDecorations.cs
- CollectionChangedEventManager.cs
- DispatcherOperation.cs
- IdentityHolder.cs
- CommandField.cs
- BitmapPalette.cs
- FontDialog.cs
- CursorEditor.cs
- RegexTree.cs
- HttpInputStream.cs
- SQLBytes.cs
- HttpHandlerAction.cs
- CopyNodeSetAction.cs
- StylusSystemGestureEventArgs.cs
- ReadWriteObjectLock.cs
- StringDictionary.cs
- AnimationClock.cs
- BaseDataList.cs
- ContractMapping.cs
- ZoneButton.cs
- ObjectDataSourceSelectingEventArgs.cs
- OneWayElement.cs
- FileRecordSequenceHelper.cs
- SubstitutionList.cs
- SpotLight.cs
- HttpFormatExtensions.cs
- ToolStripDropDownMenu.cs
- sitestring.cs
- TrackingStringDictionary.cs
- ChangesetResponse.cs
- ScriptingAuthenticationServiceSection.cs
- XmlSchemaParticle.cs
- HttpListenerRequest.cs
- HiddenFieldPageStatePersister.cs
- Keywords.cs
- DataGridAddNewRow.cs
- XmlAttributeAttribute.cs
- OrderPreservingSpoolingTask.cs
- TemplateEditingFrame.cs
- TagPrefixCollection.cs
- CompareValidator.cs
- EncryptedType.cs
- DynamicRendererThreadManager.cs