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
- MetadataItemSerializer.cs
- TableLayoutCellPaintEventArgs.cs
- Serializer.cs
- Image.cs
- ReliableSession.cs
- SoapFault.cs
- OleDbErrorCollection.cs
- ConfigurationSectionGroupCollection.cs
- XmlSchemaObjectTable.cs
- HostedBindingBehavior.cs
- ParseHttpDate.cs
- XmlNodeComparer.cs
- DataGridViewCellMouseEventArgs.cs
- ProxyAttribute.cs
- NameValueFileSectionHandler.cs
- PropertyDescriptor.cs
- DataContext.cs
- WorkflowInstanceProvider.cs
- MachineKeyValidationConverter.cs
- MeasureData.cs
- HttpCapabilitiesEvaluator.cs
- StrokeCollection2.cs
- MouseActionConverter.cs
- UnsafeNativeMethods.cs
- CompositeTypefaceMetrics.cs
- CatalogPartChrome.cs
- UnmanagedMarshal.cs
- CompilerParameters.cs
- X509SecurityTokenProvider.cs
- DataServiceHost.cs
- COM2ComponentEditor.cs
- PointHitTestResult.cs
- DataGridViewElement.cs
- SingletonInstanceContextProvider.cs
- XmlAtomErrorReader.cs
- DataSourceExpression.cs
- Configuration.cs
- FilterQuery.cs
- Avt.cs
- PageParser.cs
- FileDialog_Vista_Interop.cs
- HtmlTitle.cs
- RepeaterCommandEventArgs.cs
- safelink.cs
- BindingWorker.cs
- WebBrowserBase.cs
- TextRangeEdit.cs
- WorkflowTraceTransfer.cs
- LoadRetryHandler.cs
- NetMsmqSecurityMode.cs
- WebPartZoneBase.cs
- DefaultSection.cs
- xdrvalidator.cs
- InstanceStoreQueryResult.cs
- ProxySimple.cs
- TypeElement.cs
- CollectionsUtil.cs
- BookmarkScope.cs
- TypeSemantics.cs
- TabControlAutomationPeer.cs
- CustomError.cs
- ContractCodeDomInfo.cs
- ModelPropertyCollectionImpl.cs
- WindowsTokenRoleProvider.cs
- BaseCollection.cs
- CodeEntryPointMethod.cs
- RegistrationServices.cs
- PropertyGeneratedEventArgs.cs
- ReadOnlyDataSource.cs
- Stroke.cs
- Divide.cs
- _OverlappedAsyncResult.cs
- IdentityModelStringsVersion1.cs
- LinearGradientBrush.cs
- CannotUnloadAppDomainException.cs
- BookmarkNameHelper.cs
- ReferentialConstraint.cs
- AttachedPropertyBrowsableForTypeAttribute.cs
- FlowDocumentScrollViewer.cs
- nulltextnavigator.cs
- InkCollectionBehavior.cs
- CommunicationException.cs
- FixedSOMTextRun.cs
- PipeException.cs
- WeakRefEnumerator.cs
- ConstrainedGroup.cs
- ProfileInfo.cs
- DeclarationUpdate.cs
- SlotInfo.cs
- __Filters.cs
- CodeExpressionCollection.cs
- TextHidden.cs
- InvariantComparer.cs
- SettingsPropertyNotFoundException.cs
- DoubleLinkListEnumerator.cs
- HttpCachePolicyElement.cs
- SQLConvert.cs
- Number.cs
- CacheMode.cs
- Inflater.cs