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
- __ConsoleStream.cs
- Menu.cs
- SafeRightsManagementPubHandle.cs
- EventDescriptorCollection.cs
- AbstractDataSvcMapFileLoader.cs
- ClientScriptManager.cs
- VideoDrawing.cs
- FileInfo.cs
- Int64Converter.cs
- XPathExpr.cs
- ToolStripPanelRow.cs
- DataGridViewTopRowAccessibleObject.cs
- _FixedSizeReader.cs
- RtfControls.cs
- DirtyTextRange.cs
- ConnectionManagementElementCollection.cs
- ClaimSet.cs
- LoadRetryStrategyFactory.cs
- AppDomain.cs
- SoapTypeAttribute.cs
- ExceptionUtil.cs
- ExpressionEditor.cs
- PolyLineSegmentFigureLogic.cs
- GeneralTransform2DTo3DTo2D.cs
- UserControlDesigner.cs
- DesignerActionPanel.cs
- DynamicResourceExtension.cs
- DataGridViewRowCollection.cs
- TypeBuilderInstantiation.cs
- BrushValueSerializer.cs
- CTreeGenerator.cs
- WebFaultClientMessageInspector.cs
- DataControlPagerLinkButton.cs
- hresults.cs
- AttachedPropertyDescriptor.cs
- AxHostDesigner.cs
- DomainUpDown.cs
- GuidConverter.cs
- SqlReferenceCollection.cs
- JavascriptCallbackBehaviorAttribute.cs
- DependencyObjectProvider.cs
- XmlEventCache.cs
- CodeTryCatchFinallyStatement.cs
- FastEncoderWindow.cs
- DropDownList.cs
- ArglessEventHandlerProxy.cs
- ExtendedPropertyCollection.cs
- SafeProcessHandle.cs
- ChooseAction.cs
- SecurityContextSecurityTokenResolver.cs
- DataGridViewTopLeftHeaderCell.cs
- CompiledXpathExpr.cs
- ClientEventManager.cs
- IPEndPoint.cs
- LineProperties.cs
- NamedPermissionSet.cs
- ColumnTypeConverter.cs
- FormatterConverter.cs
- Int64AnimationBase.cs
- ThemeDirectoryCompiler.cs
- ContentValidator.cs
- HMACMD5.cs
- TextRangeAdaptor.cs
- ComNativeDescriptor.cs
- XPathDocumentBuilder.cs
- SelectionRangeConverter.cs
- StringUtil.cs
- StylusPointPropertyUnit.cs
- BufferBuilder.cs
- GraphicsPath.cs
- ServiceDescriptionReflector.cs
- HierarchicalDataBoundControl.cs
- WebPartTransformerAttribute.cs
- FrameworkObject.cs
- DataListItem.cs
- IxmlLineInfo.cs
- SqlDependencyUtils.cs
- TripleDES.cs
- MsmqActivation.cs
- PageCatalogPart.cs
- SchemaDeclBase.cs
- FormViewUpdatedEventArgs.cs
- MachineKeySection.cs
- BitmapFrameDecode.cs
- TextEditorMouse.cs
- MetadataPropertyCollection.cs
- XmlQualifiedNameTest.cs
- RemoveStoryboard.cs
- HighlightComponent.cs
- DayRenderEvent.cs
- BoundField.cs
- ColorContextHelper.cs
- GroupLabel.cs
- Identity.cs
- AtlasWeb.Designer.cs
- Rights.cs
- NTAccount.cs
- ImageDrawing.cs
- HTMLTextWriter.cs
- PresentationTraceSources.cs