public byte[] GetData() { byte[] returned; using (MemoryStream MS = new MemoryStream()) { BinaryWriter writer = new BinaryWriter(MS); Header.FileSize = 1 + Header.HeaderSize + Palette.Size + Reserved.Size + Compressed.Size(); Header.Get(writer); Palette.Get(writer); WidthTable.Get(writer); Unknown.Get(writer); Reserved.Get(writer); Compressed.Get(writer); if (Last != null) { Header.LastPosition = Last.Get(writer); writer.BaseStream.Position = 0; Header.Get(writer); } returned = MS.ToArray(); } return(returned); }
protected override void Execute(CodeActivityContext context) { // Open the config file Configuration config = ConfigurationManager .OpenExeConfiguration(ConfigurationUserLevel.None); AppSettingsSection app = (AppSettingsSection)config.GetSection("appSettings"); // Create the ReservationResponse class and populate it ReservationResponse r = new ReservationResponse ( Request.Get(context), Reserved.Get(context), new Branch { BranchName = app.Settings["Branch Name"].Value, BranchID = new Guid(app.Settings["ID"].Value), Address = app.Settings["Address"].Value } ); // Store the Response in the OutArgument Response.Set(context, r); }