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
- XmlCharType.cs
- CodeDOMUtility.cs
- DSASignatureDeformatter.cs
- UpdateException.cs
- WinEventQueueItem.cs
- Fx.cs
- DynamicDocumentPaginator.cs
- Icon.cs
- DataListItemEventArgs.cs
- Model3DGroup.cs
- OdbcConnectionFactory.cs
- DataListItemEventArgs.cs
- DeviceContext2.cs
- SuppressMessageAttribute.cs
- PageParser.cs
- WebPartEditorApplyVerb.cs
- UnsafeNativeMethodsTablet.cs
- validationstate.cs
- LineServices.cs
- SpecularMaterial.cs
- LinkedList.cs
- XmlFormatWriterGenerator.cs
- PublishLicense.cs
- ThreadStartException.cs
- bindurihelper.cs
- StagingAreaInputItem.cs
- SimpleFileLog.cs
- InfoCardSymmetricAlgorithm.cs
- GenericUI.cs
- Trace.cs
- ObjectToken.cs
- Fault.cs
- PersonalizationProvider.cs
- Animatable.cs
- X509CertificateChain.cs
- QueryCursorEventArgs.cs
- CheckBoxBaseAdapter.cs
- Html32TextWriter.cs
- DataBinding.cs
- Font.cs
- PointAnimationUsingPath.cs
- VirtualPathUtility.cs
- PublisherIdentityPermission.cs
- SizeAnimationBase.cs
- UpdatePanelControlTrigger.cs
- ZoomPercentageConverter.cs
- RootBrowserWindowAutomationPeer.cs
- AssociationSetEnd.cs
- CustomErrorsSection.cs
- EdgeProfileValidation.cs
- Profiler.cs
- SaveFileDialog.cs
- DataSourceProvider.cs
- DbBuffer.cs
- shaperfactoryquerycacheentry.cs
- DataGridViewRow.cs
- ValueExpressions.cs
- SrgsGrammarCompiler.cs
- CharEntityEncoderFallback.cs
- DesignerTextBoxAdapter.cs
- SiteMapDataSourceView.cs
- DecoderExceptionFallback.cs
- BitmapEffectGroup.cs
- XmlParserContext.cs
- ConfigXmlCDataSection.cs
- RectangleGeometry.cs
- TrustDriver.cs
- DocumentsTrace.cs
- XamlInt32CollectionSerializer.cs
- InternalBase.cs
- ExpressionBuilder.cs
- X509Certificate.cs
- ResizeBehavior.cs
- EntityStoreSchemaGenerator.cs
- SetUserPreferenceRequest.cs
- EncodingInfo.cs
- Group.cs
- PolyLineSegmentFigureLogic.cs
- TabOrder.cs
- ProcessModelSection.cs
- InProcStateClientManager.cs
- ImageCodecInfoPrivate.cs
- SQLMoney.cs
- TextFormatterContext.cs
- ZipPackagePart.cs
- BoolExpr.cs
- MetafileHeaderWmf.cs
- CfgSemanticTag.cs
- MouseGestureValueSerializer.cs
- BrowserDefinition.cs
- Compiler.cs
- ListControl.cs
- StandardToolWindows.cs
- OleDbConnectionFactory.cs
- BitVector32.cs
- CompModHelpers.cs
- AutomationProperties.cs
- FilterElement.cs
- StateItem.cs
- CanExecuteRoutedEventArgs.cs