Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / ndp / fx / src / DataEntity / System / Data / EntityModel / SchemaObjectModel / OnOperation.cs / 1 / 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
- HttpValueCollection.cs
- wpf-etw.cs
- UserControl.cs
- Avt.cs
- ReferencedAssembly.cs
- Shape.cs
- Opcode.cs
- DeploymentExceptionMapper.cs
- EmbeddedMailObjectsCollection.cs
- SecurityPolicySection.cs
- EditBehavior.cs
- FontUnit.cs
- XhtmlMobileTextWriter.cs
- RoutingService.cs
- FormViewRow.cs
- GeometryModel3D.cs
- JournalEntryStack.cs
- ExpressionCopier.cs
- MemberJoinTreeNode.cs
- TransformGroup.cs
- SendAgentStatusRequest.cs
- ExpressionVisitor.cs
- BitmapFrame.cs
- SafeEventHandle.cs
- OracleDataAdapter.cs
- DeviceContexts.cs
- EntityDataSourceWrapper.cs
- Point3DCollection.cs
- MemoryMappedView.cs
- RtfControlWordInfo.cs
- DesignerTextWriter.cs
- Inflater.cs
- Internal.cs
- ServiceManager.cs
- FileUtil.cs
- IndividualDeviceConfig.cs
- BinaryFormatter.cs
- EventEntry.cs
- QilGeneratorEnv.cs
- SafeIUnknown.cs
- RuleSettings.cs
- translator.cs
- DebugView.cs
- BindingExpression.cs
- OutputCacheModule.cs
- Track.cs
- CorrelationManager.cs
- DynamicDocumentPaginator.cs
- GatewayDefinition.cs
- HtmlInputCheckBox.cs
- ScriptHandlerFactory.cs
- LineInfo.cs
- WebPartVerbsEventArgs.cs
- TableLayoutPanelCellPosition.cs
- ISAPIApplicationHost.cs
- SupportsEventValidationAttribute.cs
- OperationPickerDialog.cs
- PenCursorManager.cs
- WebExceptionStatus.cs
- UIElement.cs
- ChtmlFormAdapter.cs
- Rotation3D.cs
- SubqueryTrackingVisitor.cs
- MultiDataTrigger.cs
- UserNameSecurityTokenAuthenticator.cs
- Predicate.cs
- SecureUICommand.cs
- BindingList.cs
- FixedSchema.cs
- BaseParser.cs
- DataSourceConverter.cs
- FunctionNode.cs
- AttachInfo.cs
- FileSystemInfo.cs
- UrlRoutingModule.cs
- ConstructorExpr.cs
- LoginView.cs
- CalendarTable.cs
- SignatureHelper.cs
- AuthenticationException.cs
- FieldAccessException.cs
- Point3DIndependentAnimationStorage.cs
- EntityCodeGenerator.cs
- PermissionToken.cs
- XmlAnyAttributeAttribute.cs
- ManagementEventWatcher.cs
- RubberbandSelector.cs
- ViewBase.cs
- _SslState.cs
- TableLayoutStyleCollection.cs
- OdbcException.cs
- RuntimeEnvironment.cs
- HitTestWithPointDrawingContextWalker.cs
- SmiEventSink.cs
- NonVisualControlAttribute.cs
- DocumentViewerHelper.cs
- XmlObjectSerializerReadContextComplexJson.cs
- Size.cs
- DbParameterCollectionHelper.cs
- BindingList.cs