Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / ndp / fx / src / DataEntity / System / Data / EntityModel / SchemaObjectModel / OnOperation.cs / 1 / OnOperation.cs
//---------------------------------------------------------------------- //// Copyright (c) Microsoft Corporation. All rights reserved. // // // @owner [....] // @backupOwner [....] //--------------------------------------------------------------------- using System; using System.Diagnostics; using System.Xml; using System.Data; using System.Data.Objects.DataClasses; using System.Data.Metadata.Edm; namespace System.Data.EntityModel.SchemaObjectModel { ////// Represents an OnDelete, OnCopy, OnSecure, OnLock or OnSerialize element /// internal sealed class OnOperation : SchemaElement { private Operation _Operation; private Action _Action; ////// /// /// /// public OnOperation(RelationshipEnd parentElement, Operation operation) : base(parentElement) { Operation = operation; } ////// The operation /// public Operation Operation { get { return _Operation; } private set { _Operation = value; } } ////// The action /// public Action Action { get { return _Action; } private set { _Action = value; } } protected override bool ProhibitAttribute(string namespaceUri, string localName) { if (base.ProhibitAttribute(namespaceUri, localName)) { return true; } if (namespaceUri == null && localName == XmlConstants.Name) { return false; } return false; } protected override bool HandleAttribute(XmlReader reader) { if (base.HandleAttribute(reader)) { return true; } else if (CanHandleAttribute(reader, XmlConstants.Action)) { HandleActionAttribute(reader); return true; } return false; } ////// Handle the Action attribute /// /// reader positioned at Action attribute private void HandleActionAttribute(XmlReader reader) { Debug.Assert(reader != null); RelationshipKind relationshipKind = ParentElement.ParentElement.RelationshipKind; switch ( reader.Value.Trim() ) { case "None": Action = Action.None; break; case "Cascade": Action = Action.Cascade; break; default: AddError( ErrorCode.InvalidAction, EdmSchemaErrorSeverity.Error, reader, System.Data.Entity.Strings.InvalidAction(reader.Value, ParentElement.FQName ) ); break; } } ////// the parent element. /// private new RelationshipEnd ParentElement { get { return (RelationshipEnd)base.ParentElement; } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //---------------------------------------------------------------------- //// Copyright (c) Microsoft Corporation. All rights reserved. // // // @owner [....] // @backupOwner [....] //--------------------------------------------------------------------- using System; using System.Diagnostics; using System.Xml; using System.Data; using System.Data.Objects.DataClasses; using System.Data.Metadata.Edm; namespace System.Data.EntityModel.SchemaObjectModel { ////// Represents an OnDelete, OnCopy, OnSecure, OnLock or OnSerialize element /// internal sealed class OnOperation : SchemaElement { private Operation _Operation; private Action _Action; ////// /// /// /// public OnOperation(RelationshipEnd parentElement, Operation operation) : base(parentElement) { Operation = operation; } ////// The operation /// public Operation Operation { get { return _Operation; } private set { _Operation = value; } } ////// The action /// public Action Action { get { return _Action; } private set { _Action = value; } } protected override bool ProhibitAttribute(string namespaceUri, string localName) { if (base.ProhibitAttribute(namespaceUri, localName)) { return true; } if (namespaceUri == null && localName == XmlConstants.Name) { return false; } return false; } protected override bool HandleAttribute(XmlReader reader) { if (base.HandleAttribute(reader)) { return true; } else if (CanHandleAttribute(reader, XmlConstants.Action)) { HandleActionAttribute(reader); return true; } return false; } ////// Handle the Action attribute /// /// reader positioned at Action attribute private void HandleActionAttribute(XmlReader reader) { Debug.Assert(reader != null); RelationshipKind relationshipKind = ParentElement.ParentElement.RelationshipKind; switch ( reader.Value.Trim() ) { case "None": Action = Action.None; break; case "Cascade": Action = Action.Cascade; break; default: AddError( ErrorCode.InvalidAction, EdmSchemaErrorSeverity.Error, reader, System.Data.Entity.Strings.InvalidAction(reader.Value, ParentElement.FQName ) ); break; } } ////// the parent element. /// private new RelationshipEnd ParentElement { get { return (RelationshipEnd)base.ParentElement; } } } } // 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
- MobileListItemCollection.cs
- PageParser.cs
- ControlPropertyNameConverter.cs
- FunctionImportMapping.cs
- HtmlControlAdapter.cs
- NameSpaceEvent.cs
- CharStorage.cs
- PeerNameRecordCollection.cs
- IisTraceWebEventProvider.cs
- SimpleTextLine.cs
- ColumnResult.cs
- HeaderCollection.cs
- EntityType.cs
- Cursors.cs
- FontConverter.cs
- CharUnicodeInfo.cs
- MaterialGroup.cs
- SystemIdentity.cs
- StoreAnnotationsMap.cs
- Int32KeyFrameCollection.cs
- ComEventsSink.cs
- ListCommandEventArgs.cs
- TraceProvider.cs
- CustomErrorCollection.cs
- SqlExpander.cs
- RunClient.cs
- DbConnectionPoolGroup.cs
- EntityRecordInfo.cs
- IdentifierCollection.cs
- SQLInt32Storage.cs
- EntityType.cs
- SynchronizingStream.cs
- ErrorFormatter.cs
- InteropAutomationProvider.cs
- WebBrowserBase.cs
- Visual.cs
- InputLanguageProfileNotifySink.cs
- PersonalizableAttribute.cs
- Preprocessor.cs
- PropertyStore.cs
- EmbeddedMailObject.cs
- DesignerVerbCollection.cs
- oledbconnectionstring.cs
- FloaterParagraph.cs
- SByte.cs
- DCSafeHandle.cs
- FacetValueContainer.cs
- Enlistment.cs
- ExtractCollection.cs
- DecoderReplacementFallback.cs
- JournalEntry.cs
- XmlSchemaAny.cs
- MetaForeignKeyColumn.cs
- WebResourceUtil.cs
- XMLDiffLoader.cs
- AnnotationComponentManager.cs
- FigureHelper.cs
- AccessibilityHelperForVista.cs
- HtmlInputPassword.cs
- RuleSettings.cs
- SourceLineInfo.cs
- StylusPointPropertyUnit.cs
- UriPrefixTable.cs
- ProtocolState.cs
- SchemaTableColumn.cs
- LayoutEvent.cs
- Visual3D.cs
- IPHostEntry.cs
- DispatcherObject.cs
- XPathPatternBuilder.cs
- LoginUtil.cs
- DeploymentExceptionMapper.cs
- RefExpr.cs
- PkcsUtils.cs
- DescendantOverDescendantQuery.cs
- WinFormsUtils.cs
- ContourSegment.cs
- InputChannel.cs
- ValidationRule.cs
- CapabilitiesSection.cs
- ResetableIterator.cs
- TextEditorContextMenu.cs
- SQLInt64.cs
- LowerCaseStringConverter.cs
- ListBindableAttribute.cs
- ServiceModelDictionary.cs
- PointLight.cs
- ArrangedElement.cs
- ClientConfigurationSystem.cs
- Int32Converter.cs
- GeneralTransform3DTo2D.cs
- DispatcherProcessingDisabled.cs
- XmlSignificantWhitespace.cs
- Configuration.cs
- PassportAuthenticationModule.cs
- ExtendedProtectionPolicy.cs
- UnmanagedMemoryStreamWrapper.cs
- LineBreak.cs
- ProvidePropertyAttribute.cs
- RecordBuilder.cs