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
- PriorityQueue.cs
- PenThreadWorker.cs
- EntityDataSourceEntityTypeFilterConverter.cs
- invalidudtexception.cs
- Size3D.cs
- TcpDuplicateContext.cs
- HtmlGenericControl.cs
- DbConvert.cs
- SqlDataAdapter.cs
- RoutingUtilities.cs
- InfoCardSymmetricAlgorithm.cs
- MenuItemStyle.cs
- ProfileModule.cs
- Annotation.cs
- AnnotationMap.cs
- WizardPanel.cs
- OleDbFactory.cs
- DynamicQueryableWrapper.cs
- SessionStateContainer.cs
- RequiredAttributeAttribute.cs
- BitmapCacheBrush.cs
- BasePattern.cs
- LinkArea.cs
- WebCodeGenerator.cs
- Propagator.cs
- OrderedHashRepartitionEnumerator.cs
- TextEditorCharacters.cs
- RoutedEventValueSerializer.cs
- Activity.cs
- DataTableMappingCollection.cs
- CompoundFileIOPermission.cs
- XslAstAnalyzer.cs
- DesignerVerbCollection.cs
- OleDbParameterCollection.cs
- TypeConverterHelper.cs
- EntityDataReader.cs
- AutomationPropertyInfo.cs
- ImmutableObjectAttribute.cs
- SqlFacetAttribute.cs
- EntityStoreSchemaFilterEntry.cs
- FontSourceCollection.cs
- ArithmeticException.cs
- AuthenticationConfig.cs
- followingsibling.cs
- EntryPointNotFoundException.cs
- DataGridViewRowCancelEventArgs.cs
- ShaderRenderModeValidation.cs
- CodeNamespaceImportCollection.cs
- HttpPostedFile.cs
- TraceSwitch.cs
- ModelEditingScope.cs
- MimeWriter.cs
- Brush.cs
- RuntimeIdentifierPropertyAttribute.cs
- CheckBoxBaseAdapter.cs
- MetaTable.cs
- DeclarativeCatalogPart.cs
- WebBrowserNavigatedEventHandler.cs
- StringValidator.cs
- OrderedEnumerableRowCollection.cs
- WindowsScrollBarBits.cs
- UpdateRecord.cs
- linebase.cs
- AnonymousIdentificationSection.cs
- x509utils.cs
- MetadataImporter.cs
- BufferedWebEventProvider.cs
- VirtualPathUtility.cs
- WebPartEventArgs.cs
- FileCodeGroup.cs
- EnterpriseServicesHelper.cs
- CodeIdentifiers.cs
- FlowDocumentFormatter.cs
- XPathMultyIterator.cs
- PerfCounterSection.cs
- ResourceType.cs
- Guid.cs
- HtmlTableRow.cs
- Point4DValueSerializer.cs
- Misc.cs
- CompositeFontParser.cs
- MaterialGroup.cs
- ADRole.cs
- AnonymousIdentificationSection.cs
- HttpHandlerActionCollection.cs
- XmlSchemaInferenceException.cs
- ProviderBase.cs
- mediaeventshelper.cs
- SelectionProcessor.cs
- FaultContractAttribute.cs
- ParseNumbers.cs
- ApplicationSettingsBase.cs
- ListSourceHelper.cs
- ToolStripButton.cs
- ClientApiGenerator.cs
- TemplateBindingExtension.cs
- BitmapPalettes.cs
- ByteArrayHelperWithString.cs
- InstanceView.cs
- Annotation.cs