Example #1
0
 internal SectorMetadata(Sector sector, WorldCollection worlds, string milieu)
 {
     this.sector = sector;
     this.worlds = worlds;
     dataFile    = new DataFileMetadata(sector, milieu);
 }
 internal SectorMetadata(Sector sector, WorldCollection worlds)
 {
     this.sector = sector;
     this.worlds = worlds;
     dataFile    = new DataFileMetadata(sector);
 }
 internal SectorMetadata(Sector sector, WorldCollection worlds)
 {
     this.sector = sector;
     this.worlds = worlds;
     dataFile = new DataFileMetadata(sector);
 }
 public SectorMetadata(Sector sector, WorldCollection worlds)
 {
     this.m_sector = sector;
     this.m_worlds = worlds;
     this.m_dataFile = new DataFileMetadata(sector);
 }
Example #5
0
        /// <summary>
        /// Creates a file with metadata about the data file we are packaging.
        /// </summary>
        /// <param name="dataFileName">The data file we are packaging, where most of the metadata will come from.</param>
        /// <param name="packagingFolder">The folder where we will create the metadata file.</param>
        /// \author  Sebastian Echeverria
        /// \date    10/24/2012
        private static void CreateMetadataFile(string dataFileName, string packagingFolder)
        {
            // Get the UID of the device and the current timestamp as we'll need them as metadata.
            string uid = ConfigurationSettings.GetStringSetting(ConfigurationIdentifier.UniqueIdentifier);
            long timestamp = GetCurrentUnixTimestamp();

            // Put together all the metadata we need.
            DataFileMetadata metadata = new DataFileMetadata();
            metadata.FileName = dataFileName;
            metadata.CreationTimestamp = timestamp;
            metadata.OriginUID = uid;

            // The actual metadata file will have the same name as the data file, but with a JSON extension.
            string metadataFileName = Path.Combine(packagingFolder, dataFileName + ".json");

            // Create the metadata file by serializing through Json the metadata information.
            using (StreamWriter filestream = File.CreateText(metadataFileName))
            {
                JsonSerializerSettings settings = new JsonSerializerSettings();
                JsonSerializer serializer = JsonSerializer.Create(settings);
                serializer.Serialize(filestream, metadata);
            }
        }