Updates referencesource to .NET 4.7
[mono-project.git] / mcs / class / referencesource / System.Data.Entity / System / Data / Metadata / Edm / Documentation.cs
blobc036a9c0e7c2462330b86b80ea791bdb140e4dbd
1 //---------------------------------------------------------------------
2 // <copyright file="Documentation.cs" company="Microsoft">
3 // Copyright (c) Microsoft Corporation. All rights reserved.
4 // </copyright>
5 //
6 // @owner Microsoft
7 // @backupOwner Microsoft
8 //---------------------------------------------------------------------
10 using System;
11 using System.Collections.Generic;
12 using System.Data.Common;
13 using System.Diagnostics;
14 using System.Globalization;
15 using System.Text;
16 using System.Data.Common.Utils;
18 namespace System.Data.Metadata.Edm
20 /// <summary>
21 /// Class representing the Documentation associated with an item
22 /// </summary>
23 public sealed class Documentation: MetadataItem
25 #region Fields
26 private string _summary = "";
27 private string _longDescription = "";
28 #endregion
30 #region Constructors
31 /// <summary>
32 /// Default constructor - primarily created for supporting usage of this Documentation class by SOM.
33 /// </summary>
34 internal Documentation()
37 #endregion
39 #region Properties
41 /// <summary>
42 /// Returns the kind of the type
43 /// </summary>
44 public override BuiltInTypeKind BuiltInTypeKind { get { return BuiltInTypeKind.Documentation; } }
46 /// <summary>
47 /// Gets the Summary for this Documentation instance.
48 /// </summary>
49 ///
50 public string Summary
52 get
54 return _summary;
56 internal set
58 if (value != null)
59 _summary = value;
60 else
61 _summary = "";
65 /// <summary>
66 /// Gets the LongDescription for this Documentation instance.
67 /// </summary>
68 ///
69 public string LongDescription
71 get
73 return _longDescription;
75 internal set
77 if (value != null)
78 _longDescription = value;
79 else
80 _longDescription = "";
85 /// <summary>
86 /// This property is required to be implemented for inheriting from MetadataItem. As there can be atmost one
87 /// instance of a nested-Documentation, return the constant "Documentation" as it's identity.
88 /// </summary>
89 internal override string Identity
91 get
93 return "Documentation";
97 /// <summary>
98 /// Returns true if this Documentation instance contains only null/empty summary and longDescription
99 /// </summary>
100 ///
101 public bool IsEmpty
105 if (string.IsNullOrEmpty(_summary) && string.IsNullOrEmpty(_longDescription) )
107 return true;
110 return false;
115 #endregion
117 #region Methods
119 /// <summary>
120 /// </summary>
121 public override string ToString()
123 return _summary;
126 #endregion