Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / ndp / fx / src / DataEntity / System / Data / EntityModel / SchemaObjectModel / OnOperation.cs / 2 / 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
- ListViewItemEventArgs.cs
- BaseProcessor.cs
- BookmarkEventArgs.cs
- DataObjectCopyingEventArgs.cs
- RegexFCD.cs
- ArglessEventHandlerProxy.cs
- DbReferenceCollection.cs
- CreateUserWizardStep.cs
- DragDrop.cs
- FixedDocument.cs
- ProfileBuildProvider.cs
- TrustExchangeException.cs
- DependsOnAttribute.cs
- Comparer.cs
- FontCacheUtil.cs
- SqlDataSourceQuery.cs
- AmbientProperties.cs
- fixedPageContentExtractor.cs
- ThaiBuddhistCalendar.cs
- PresentationTraceSources.cs
- XmlSchemaAttributeGroup.cs
- WebPartConnectionsConfigureVerb.cs
- TreeNodeStyleCollection.cs
- ExtensionSimplifierMarkupObject.cs
- StylusPointProperties.cs
- PageStatePersister.cs
- RelativeSource.cs
- HttpDebugHandler.cs
- UnsafeNativeMethods.cs
- GregorianCalendar.cs
- SecurityCriticalDataForSet.cs
- NumberFormatter.cs
- ControlAdapter.cs
- StoreItemCollection.Loader.cs
- SerializationFieldInfo.cs
- UnsafeNativeMethods.cs
- SHA384Managed.cs
- SoapHttpTransportImporter.cs
- CryptoConfig.cs
- TemplateContent.cs
- ScrollPattern.cs
- DataObject.cs
- ByteAnimationUsingKeyFrames.cs
- LongTypeConverter.cs
- MethodRental.cs
- HebrewNumber.cs
- SQLChars.cs
- XmlTextReaderImplHelpers.cs
- WebPartTransformerCollection.cs
- OdbcCommandBuilder.cs
- DragDrop.cs
- XhtmlBasicImageAdapter.cs
- Operand.cs
- XmlSchemaSet.cs
- COM2ColorConverter.cs
- DaylightTime.cs
- Directory.cs
- CollectionChangeEventArgs.cs
- DataGridViewCellEventArgs.cs
- HexParser.cs
- BulletChrome.cs
- Double.cs
- EncoderParameter.cs
- x509store.cs
- _BufferOffsetSize.cs
- DesignerToolStripControlHost.cs
- XmlAnyElementAttribute.cs
- ListBoxItemWrapperAutomationPeer.cs
- DataControlPagerLinkButton.cs
- PermissionToken.cs
- PeerNodeTraceRecord.cs
- X509WindowsSecurityToken.cs
- WindowsPen.cs
- TextEditorTables.cs
- HandlerBase.cs
- XmlCharCheckingReader.cs
- PointAnimation.cs
- SqlRowUpdatingEvent.cs
- HttpPostedFile.cs
- WCFModelStrings.Designer.cs
- XmlSchemaExporter.cs
- CurrentChangingEventManager.cs
- PerformanceCounterCategory.cs
- BinHexEncoder.cs
- Brush.cs
- updatecommandorderer.cs
- FilteredReadOnlyMetadataCollection.cs
- _PooledStream.cs
- RichTextBoxConstants.cs
- SecureStringHasher.cs
- DateTime.cs
- DefaultHttpHandler.cs
- DataKeyCollection.cs
- PageSettings.cs
- Pkcs9Attribute.cs
- RotateTransform3D.cs
- DriveInfo.cs
- RelationshipType.cs
- DataSourceCache.cs
- DataSetMappper.cs