Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / DataEntity / System / Data / EntityModel / SchemaObjectModel / OnOperation.cs / 1305376 / 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
- TextRunCache.cs
- LookupTables.cs
- ComplexPropertyEntry.cs
- RecipientIdentity.cs
- RemotingAttributes.cs
- Itemizer.cs
- ImageInfo.cs
- FactoryGenerator.cs
- TCPClient.cs
- ObjectAnimationUsingKeyFrames.cs
- CodeArrayCreateExpression.cs
- XmlReflectionMember.cs
- ProfessionalColorTable.cs
- TreeViewHitTestInfo.cs
- WhitespaceRuleLookup.cs
- SqlHelper.cs
- ApplicationBuildProvider.cs
- EventLevel.cs
- EventManager.cs
- CompositeControl.cs
- InstanceData.cs
- RuleInfoComparer.cs
- ResourceDictionary.cs
- SHA256.cs
- HtmlInputPassword.cs
- ViewStateException.cs
- EntityDataSourceState.cs
- CodePrimitiveExpression.cs
- DbProviderSpecificTypePropertyAttribute.cs
- GeneralTransform3DTo2DTo3D.cs
- RegionData.cs
- XmlMemberMapping.cs
- AnnotationResourceChangedEventArgs.cs
- UnsafePeerToPeerMethods.cs
- DbTypeMap.cs
- CounterCreationData.cs
- XmlnsDictionary.cs
- Int32RectValueSerializer.cs
- FontStyle.cs
- ButtonRenderer.cs
- ObjectSet.cs
- DateTimeUtil.cs
- ListControlConvertEventArgs.cs
- TreeSet.cs
- UITypeEditors.cs
- ValueExpressions.cs
- PeerContact.cs
- ScrollPattern.cs
- CodeStatement.cs
- ContourSegment.cs
- DbTypeMap.cs
- StickyNoteHelper.cs
- PaginationProgressEventArgs.cs
- TextDecoration.cs
- _LoggingObject.cs
- DocumentViewerHelper.cs
- RotateTransform3D.cs
- BindingCollection.cs
- InkCanvas.cs
- TablePatternIdentifiers.cs
- BinaryMessageEncodingBindingElement.cs
- ButtonStandardAdapter.cs
- ReadOnlyNameValueCollection.cs
- OracleMonthSpan.cs
- SqlTriggerContext.cs
- ParallelQuery.cs
- BackgroundWorker.cs
- Point3DCollectionValueSerializer.cs
- SmtpSpecifiedPickupDirectoryElement.cs
- AnimationLayer.cs
- ObjectDataSourceMethodEventArgs.cs
- ViewLoader.cs
- QueryRewriter.cs
- ListView.cs
- CodeGenerator.cs
- AncillaryOps.cs
- CommentAction.cs
- _ScatterGatherBuffers.cs
- ComponentEditorForm.cs
- DocumentViewerBase.cs
- XsltFunctions.cs
- OleDbPermission.cs
- BlockCollection.cs
- ObjectHelper.cs
- ResolveNameEventArgs.cs
- BookmarkUndoUnit.cs
- WindowsContainer.cs
- FileChangeNotifier.cs
- Parser.cs
- PathFigure.cs
- InstanceDataCollectionCollection.cs
- ResourcesChangeInfo.cs
- CqlGenerator.cs
- RecordBuilder.cs
- ConnectionsZoneAutoFormat.cs
- RectConverter.cs
- BinaryMethodMessage.cs
- Geometry3D.cs
- TreeWalkHelper.cs
- SelectionUIService.cs