DataFile

Metropolis SDK ›› Classes ››
Parent Previous Next

namespace Dysr.Metropolis.SDK

{

   /// <summary>

   /// A DataFile is a representation of a file and it's optional folder structure.

   /// </summary>

   [DataContract]

   public class DataFile

   {

       /// <summary>

       /// The FileInfo of a particular file. This may not necessarily exist on the filesystem.

       /// When determining to use either the file on disk or the ByteData, Metropolis checks to see

       /// if there is any byte data before using the file defined in FileInfo.

       /// </summary>

       [DataMember]

       public FileInfo FileInfo { get; set; }

       /// <summary>

       /// The relative version of the file. For exmaple, a file located at C:\Files\SomeFile.txt

       /// could have a relative path of \Files\SomeFile.txt. This is used

       /// to preserve the subforder structure, which is an option for users.

       /// </summary>

       public string FileInfoRelative { get; set; }

       /// <summary>

       /// A byte representation of FileInfo. This may not necessariily exist.

       /// When determining to use either the file on disk or the ByteData, Metropolis checks to

       /// see if there is any byte data before using the file defined in FileInfo.

       /// </summary>

       [DataMember]

       public byte[] ByteData { get; set; }

       /// <summary>

       /// Load file contents into memory using a byte array.

       /// </summary>

       /// <returns>true if successful.</returns>

       public bool LoadIntoMemory()

       /// <summary>

       /// Save the in memory bytes of a file to disk located at FileInfo.FullName.

       /// </summary>

       public void SaveToDisk()

       /// <summary>

       /// Copy one Stream to another using an 8k buffer.

       /// </summary>

       /// <param name="input">Source stream</param>

       /// <param name="output">Destination stream</param>

       public static void CopyStream(Stream input, Stream output)

   }

}

Created with the Personal Edition of HelpNDoc: Free help authoring environment