Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / DataEntity / System / Data / EntityModel / SchemaObjectModel / Documentation.cs / 1305376 / Documentation.cs
//---------------------------------------------------------------------- //// Copyright (c) Microsoft Corporation. All rights reserved. // // // @owner [....] // @backupOwner [....] //--------------------------------------------------------------------- using System; using System.Collections; using System.Collections.Generic; using System.Collections.Specialized; using System.Text; using System.Xml; using System.Data; using System.Data.Common.Utils; using System.Data.Metadata.Edm; namespace System.Data.EntityModel.SchemaObjectModel { ////// Summary description for Documentation. /// internal sealed class DocumentationElement: SchemaElement { #region Instance Fields Documentation _metdataDocumentation = new Documentation(); #endregion #region Public Methods ////// /// /// public DocumentationElement(SchemaElement parentElement) : base(parentElement) { } #endregion #region Public Properties ////// Returns the wrapped metaDocumentation instance /// public Documentation MetadataDocumentation { get { _metdataDocumentation.SetReadOnly(); return _metdataDocumentation; } } #endregion #region Protected Properties protected override bool HandleElement(XmlReader reader) { if (base.HandleElement(reader)) { return true; } else if (CanHandleElement(reader, XmlConstants.Summary)) { HandleSummaryElement(reader); return true; } else if (CanHandleElement(reader, XmlConstants.LongDescription)) { HandleLongDescriptionElement(reader); return true; } return false; } #endregion #region Private Methods protected override bool HandleText(XmlReader reader) { string text = reader.Value; if (!StringUtil.IsNullOrEmptyOrWhiteSpace(text)) { AddError(ErrorCode.UnexpectedXmlElement, EdmSchemaErrorSeverity.Error, System.Data.Entity.Strings.InvalidDocumentationBothTextAndStructure); } return true; } ////// /// /// private void HandleSummaryElement(XmlReader reader) { TextElement text = new TextElement(this); text.Parse(reader); _metdataDocumentation.Summary = text.Value; } ////// /// /// private void HandleLongDescriptionElement(XmlReader reader) { TextElement text = new TextElement(this); text.Parse(reader); _metdataDocumentation.LongDescription = text.Value; } #endregion } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //---------------------------------------------------------------------- //// Copyright (c) Microsoft Corporation. All rights reserved. // // // @owner [....] // @backupOwner [....] //--------------------------------------------------------------------- using System; using System.Collections; using System.Collections.Generic; using System.Collections.Specialized; using System.Text; using System.Xml; using System.Data; using System.Data.Common.Utils; using System.Data.Metadata.Edm; namespace System.Data.EntityModel.SchemaObjectModel { ////// Summary description for Documentation. /// internal sealed class DocumentationElement: SchemaElement { #region Instance Fields Documentation _metdataDocumentation = new Documentation(); #endregion #region Public Methods ////// /// /// public DocumentationElement(SchemaElement parentElement) : base(parentElement) { } #endregion #region Public Properties ////// Returns the wrapped metaDocumentation instance /// public Documentation MetadataDocumentation { get { _metdataDocumentation.SetReadOnly(); return _metdataDocumentation; } } #endregion #region Protected Properties protected override bool HandleElement(XmlReader reader) { if (base.HandleElement(reader)) { return true; } else if (CanHandleElement(reader, XmlConstants.Summary)) { HandleSummaryElement(reader); return true; } else if (CanHandleElement(reader, XmlConstants.LongDescription)) { HandleLongDescriptionElement(reader); return true; } return false; } #endregion #region Private Methods protected override bool HandleText(XmlReader reader) { string text = reader.Value; if (!StringUtil.IsNullOrEmptyOrWhiteSpace(text)) { AddError(ErrorCode.UnexpectedXmlElement, EdmSchemaErrorSeverity.Error, System.Data.Entity.Strings.InvalidDocumentationBothTextAndStructure); } return true; } ////// /// /// private void HandleSummaryElement(XmlReader reader) { TextElement text = new TextElement(this); text.Parse(reader); _metdataDocumentation.Summary = text.Value; } ////// /// /// private void HandleLongDescriptionElement(XmlReader reader) { TextElement text = new TextElement(this); text.Parse(reader); _metdataDocumentation.LongDescription = text.Value; } #endregion } } // 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
- StringBuilder.cs
- ScrollPatternIdentifiers.cs
- CookieParameter.cs
- XPathAncestorIterator.cs
- HitTestWithPointDrawingContextWalker.cs
- XmlExceptionHelper.cs
- __TransparentProxy.cs
- TimeSpanConverter.cs
- SelectionRange.cs
- WeakReference.cs
- XMLUtil.cs
- NavigationEventArgs.cs
- IxmlLineInfo.cs
- SetIterators.cs
- VirtualDirectoryMappingCollection.cs
- ToolBarButtonClickEvent.cs
- ServiceCredentialsElement.cs
- FileDataSourceCache.cs
- TextHintingModeValidation.cs
- DataGridColumnStyleMappingNameEditor.cs
- ImageListDesigner.cs
- CommandLineParser.cs
- WebPartPersonalization.cs
- DirectoryObjectSecurity.cs
- ReadingWritingEntityEventArgs.cs
- Point3DKeyFrameCollection.cs
- WpfSharedXamlSchemaContext.cs
- Point3DCollection.cs
- TypeUtils.cs
- Helper.cs
- SlotInfo.cs
- Int32KeyFrameCollection.cs
- Enum.cs
- DragCompletedEventArgs.cs
- FormClosedEvent.cs
- DataKey.cs
- SessionStateSection.cs
- PointLightBase.cs
- TableLayoutStyle.cs
- SubMenuStyleCollection.cs
- SerializationStore.cs
- CreateSequence.cs
- _TransmitFileOverlappedAsyncResult.cs
- SqlCrossApplyToCrossJoin.cs
- NumericUpDown.cs
- SmtpLoginAuthenticationModule.cs
- SqlClientWrapperSmiStreamChars.cs
- SimplePropertyEntry.cs
- WindowsListViewItem.cs
- SynchronousChannelMergeEnumerator.cs
- WmlControlAdapter.cs
- ProgressChangedEventArgs.cs
- MailSettingsSection.cs
- AffineTransform3D.cs
- OLEDB_Enum.cs
- SecureUICommand.cs
- TagPrefixAttribute.cs
- ListViewItem.cs
- Trace.cs
- CellNormalizer.cs
- SerializationInfoEnumerator.cs
- CodeMemberEvent.cs
- XmlLinkedNode.cs
- LambdaCompiler.Address.cs
- DatagridviewDisplayedBandsData.cs
- QuotedStringWriteStateInfo.cs
- SchemaImporterExtensionsSection.cs
- Math.cs
- GridViewRow.cs
- RegexCompilationInfo.cs
- LinkButton.cs
- PersonalizationProviderCollection.cs
- TypedServiceChannelBuilder.cs
- EventMappingSettings.cs
- LocalizationParserHooks.cs
- OdbcDataReader.cs
- _FtpControlStream.cs
- InternalConfigHost.cs
- HandleCollector.cs
- ITextView.cs
- XamlReader.cs
- BeginStoryboard.cs
- ConstantCheck.cs
- TextEditorContextMenu.cs
- DataGridViewLayoutData.cs
- IsolatedStorage.cs
- MetadataItemCollectionFactory.cs
- SecurityContext.cs
- BaseCollection.cs
- RouteData.cs
- RepeaterCommandEventArgs.cs
- InfoCardRSAOAEPKeyExchangeFormatter.cs
- PreviewPageInfo.cs
- TrackingMemoryStreamFactory.cs
- ListCollectionView.cs
- XmlValidatingReader.cs
- CodeNamespaceImportCollection.cs
- AttributeCallbackBuilder.cs
- DataViewManager.cs
- HScrollProperties.cs