Example #1
0
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Initializes the settings from a byte array or gets the settings into a byte array.
		/// </summary>
		/// ------------------------------------------------------------------------------------
		private byte[] GetParatextSettingsArray(ArrayList vernMappingList, ArrayList backMappingList,
			ArrayList notesMappingList, string vernProj, string backProj, string notesProj)
		{
			BinarySettings blob = new BinarySettings("PTProject");

			// Mapping set count (3 sets for vern, back, and notes)
			blob.AddInt(3);

			// We store the mappings in three different parts of the blob because the source P6 project
			// often determines the domain. It's possible for users to use the same markers in different
			// projects to mean different things. The domain + the marker serve as the "key".

			OutputMappings(blob, true, vernMappingList);
			OutputMappings(blob, true, backMappingList);
			OutputMappings(blob, true, notesMappingList);

			blob.AddString(vernProj);
			blob.AddString(backProj);
			blob.AddString(notesProj);

			return blob.Finalize();
		}
Example #2
0
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Return a binary blob representing "ECProject" values
		/// </summary>
		/// <returns>a byte array containing the settings</returns>
		/// ------------------------------------------------------------------------------------
		private byte[] GetEcProjectSettingsArray(ArrayList mappingList, ArrayList fileList)
		{
			BinarySettings blob = new BinarySettings("ECProject");

			// stuff at the start of the file
			blob.AddString(@"\id");
			blob.AddString(string.Empty); // data encoding
			blob.AddString(string.Empty); // marker encoding
			blob.AddString(string.Empty); // binary directory
			blob.AddString(string.Empty); // SSF file name
			blob.AddString(string.Empty); // STY file name

			// Marker mappings
			OutputMappings(blob, false, mappingList);

			// file list
			blob.AddInt(fileList.Count);
			foreach (string fileName in fileList)
			{
				blob.AddString(fileName);
				blob.AddIntShort(1);	// file encoding (dummy value)
				blob.AddIntShort(1);	// file encoding source (dummy value)
				blob.AddIntShort(100);	// percent certain
			}
			return blob.Finalize();
		}