// <summary> // Validates the types and sets the readOnly property to true. Once the type is set to readOnly, // it can never be changed. // </summary> internal virtual void SetReadOnly() { if (!IsReadOnly) { if (null != _itemAttributes) { _itemAttributes.SetReadOnly(); } SetFlag(MetadataFlags.Readonly, true); } }
internal MetadataPropertyCollection GetMetadataProperties() { if (this._itemAttributes == null) { MetadataPropertyCollection propertyCollection = new MetadataPropertyCollection(this); if (this.IsReadOnly) { propertyCollection.SetReadOnly(); } Interlocked.CompareExchange <MetadataPropertyCollection>(ref this._itemAttributes, propertyCollection, (MetadataPropertyCollection)null); } return(this._itemAttributes); }
internal MetadataPropertyCollection GetMetadataProperties() { if (null == _itemAttributes) { var itemAttributes = new MetadataPropertyCollection(this); if (IsReadOnly) { itemAttributes.SetReadOnly(); } Interlocked.CompareExchange( ref _itemAttributes, itemAttributes, null); } return(_itemAttributes); }