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
- EtwTrace.cs
- ItemCheckEvent.cs
- Pointer.cs
- CryptoApi.cs
- ChangePassword.cs
- MimeMultiPart.cs
- LinkTarget.cs
- OleDbMetaDataFactory.cs
- WebPartChrome.cs
- OciEnlistContext.cs
- PointKeyFrameCollection.cs
- xmlsaver.cs
- ImpersonateTokenRef.cs
- DependencyObjectPropertyDescriptor.cs
- WindowsMenu.cs
- PropertyStore.cs
- ComponentEvent.cs
- FontResourceCache.cs
- BooleanStorage.cs
- ScaleTransform3D.cs
- XamlSerializerUtil.cs
- ComponentSerializationService.cs
- HtmlInputRadioButton.cs
- SqlParameterizer.cs
- SafeLocalMemHandle.cs
- EventKeyword.cs
- DataGridViewEditingControlShowingEventArgs.cs
- ForeignKeyConstraint.cs
- ImageConverter.cs
- uribuilder.cs
- HttpCachePolicy.cs
- EntityCollectionChangedParams.cs
- AssemblyAssociatedContentFileAttribute.cs
- MessageQueueTransaction.cs
- KeyboardDevice.cs
- IEnumerable.cs
- BamlLocalizableResourceKey.cs
- CodeStatement.cs
- DateTimeOffsetStorage.cs
- processwaithandle.cs
- MenuScrollingVisibilityConverter.cs
- Certificate.cs
- TextEffect.cs
- SqlFileStream.cs
- Pen.cs
- WorkflowOperationContext.cs
- WebPartDescriptionCollection.cs
- FunctionImportElement.cs
- SerializationHelper.cs
- HtmlWindowCollection.cs
- CompositeFontInfo.cs
- DocumentSequenceHighlightLayer.cs
- QilReference.cs
- PointF.cs
- TraceUtility.cs
- SqlAliaser.cs
- DataBoundControl.cs
- XmlUrlResolver.cs
- ProxyWebPartManager.cs
- ContentFilePart.cs
- TypefaceMetricsCache.cs
- ListViewGroupConverter.cs
- ParseElement.cs
- XmlStreamStore.cs
- VisualStyleElement.cs
- ToolStripArrowRenderEventArgs.cs
- validation.cs
- PageOutputQuality.cs
- BitmapMetadataEnumerator.cs
- VersionValidator.cs
- InfoCardKeyedHashAlgorithm.cs
- Vector3DCollectionConverter.cs
- StatusBarItem.cs
- WebConfigurationFileMap.cs
- SizeIndependentAnimationStorage.cs
- Evaluator.cs
- FamilyCollection.cs
- XPathSelfQuery.cs
- TimeoutException.cs
- ItemMap.cs
- LongMinMaxAggregationOperator.cs
- UnauthorizedAccessException.cs
- InputScopeManager.cs
- AvTrace.cs
- WebPartsPersonalizationAuthorization.cs
- BindingObserver.cs
- TextTreeRootNode.cs
- tibetanshape.cs
- RefreshPropertiesAttribute.cs
- CommentEmitter.cs
- FontWeightConverter.cs
- CryptoKeySecurity.cs
- MetafileHeaderWmf.cs
- WrappedReader.cs
- TTSVoice.cs
- _AutoWebProxyScriptHelper.cs
- SEHException.cs
- PostBackOptions.cs
- WebControlsSection.cs
- XmlSchemaSequence.cs