Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / ndp / fx / src / DataEntity / System / Data / EntityModel / SchemaObjectModel / OnOperation.cs / 3 / 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
- AssemblyCache.cs
- FamilyMap.cs
- XmlEntityReference.cs
- LayoutManager.cs
- ProtocolElement.cs
- TextBreakpoint.cs
- ResourceDictionary.cs
- BufferedStream2.cs
- MdImport.cs
- ModelVisual3D.cs
- ConfigXmlText.cs
- LineInfo.cs
- SafeSecurityHandles.cs
- LeftCellWrapper.cs
- XComponentModel.cs
- StreamGeometry.cs
- ProxyHwnd.cs
- ExitEventArgs.cs
- StreamResourceInfo.cs
- RuleElement.cs
- ReferencedType.cs
- ExecutedRoutedEventArgs.cs
- VScrollBar.cs
- odbcmetadatacolumnnames.cs
- DispatcherObject.cs
- ImageIndexConverter.cs
- MethodRental.cs
- CodeMemberField.cs
- ColumnReorderedEventArgs.cs
- PipelineDeploymentState.cs
- Membership.cs
- PageVisual.cs
- WebControlAdapter.cs
- DbDataSourceEnumerator.cs
- OdbcHandle.cs
- DeviceContexts.cs
- OdbcDataAdapter.cs
- ScriptReference.cs
- Html32TextWriter.cs
- OpenFileDialog.cs
- OracleDataAdapter.cs
- RotateTransform3D.cs
- RenamedEventArgs.cs
- Environment.cs
- DataGridViewColumnEventArgs.cs
- DateTimeFormat.cs
- QueryStoreStatusRequest.cs
- FindCompletedEventArgs.cs
- FloaterBaseParagraph.cs
- TransformValueSerializer.cs
- SourceFilter.cs
- SerializableAttribute.cs
- _emptywebproxy.cs
- AttributeData.cs
- ThreadStartException.cs
- InkPresenter.cs
- ObjectCacheSettings.cs
- SvcMapFile.cs
- SafeProcessHandle.cs
- FilterableAttribute.cs
- CommittableTransaction.cs
- ErrorEventArgs.cs
- RelationshipConverter.cs
- XmlArrayItemAttribute.cs
- XmlProcessingInstruction.cs
- PreservationFileWriter.cs
- ContextConfiguration.cs
- ThemeInfoAttribute.cs
- initElementDictionary.cs
- SqlDataSourceConfigureFilterForm.cs
- SAPICategories.cs
- KerberosSecurityTokenAuthenticator.cs
- ReadOnlyCollectionBase.cs
- SingleAnimation.cs
- Rights.cs
- EntityDataSourceEntityTypeFilterItem.cs
- ViewBase.cs
- Unit.cs
- XappLauncher.cs
- oledbconnectionstring.cs
- UrlParameterReader.cs
- OperationFormatUse.cs
- ContextItemManager.cs
- WebBrowser.cs
- ComboBoxAutomationPeer.cs
- CompositeScriptReference.cs
- HuffmanTree.cs
- Control.cs
- DesignerView.cs
- BindToObject.cs
- FixedTextView.cs
- WCFServiceClientProxyGenerator.cs
- connectionpool.cs
- DataContractJsonSerializer.cs
- MenuItemAutomationPeer.cs
- NetworkCredential.cs
- DbDataSourceEnumerator.cs
- Light.cs
- TypeInfo.cs
- DotAtomReader.cs