#region Copyright (c) Microsoft Corporation /// /// Copyright (c) Microsoft Corporation. All Rights Reserved. /// Information Contained Herein is Proprietary and Confidential. /// #endregion using System; using XmlSerialization = System.Xml.Serialization; #if WEB_EXTENSIONS_CODE namespace System.Web.Compilation.WCFModel #else namespace Microsoft.VSDesigner.WCFModel #endif { /// /// This class presents a single file referenced by a svcmap file /// /// #if WEB_EXTENSIONS_CODE internal class ExtensionFile : ExternalFile #else [CLSCompliant(true)] public class ExtensionFile : ExternalFile #endif { // Extension Item Name private string m_Name; // content buffer private byte[] m_ContentBuffer; /// /// Constructor /// /// Must support a default construct for XmlSerializer public ExtensionFile() { m_Name = string.Empty; } /// /// Constructor /// /// name of extension item /// Suggested File Name public ExtensionFile(string name, string fileName, byte[] content) : base(fileName) { this.Name = name; m_ContentBuffer = content; IsExistingFile = false; } /// /// Content of the extension file /// /// /// [XmlSerialization.XmlIgnore()] public byte[] ContentBuffer { get { return m_ContentBuffer; } set { m_ContentBuffer = value; ErrorInLoading = null; } } /// /// whether the content is buffered /// /// /// internal bool IsBufferValid { get { return (m_ContentBuffer != null); } } /// /// Name in the storage /// /// /// [XmlSerialization.XmlAttribute()] public string Name { get { return m_Name; } set { if (value == null) { throw new ArgumentNullException("value"); } m_Name = value; } } /// /// the function is called when the metadata is removed, and we need clean up the content /// /// internal void CleanUpContent() { ErrorInLoading = null; m_ContentBuffer = null; } } }