public void Save(IExecutionContext context) { string transactionsPath = context.ExecutedPackage.TransactionsPath; string transactionPath = Path.Combine(transactionsPath, TransactionName + @"\"); Directory.CreateDirectory(transactionPath); string dataFilePath = Path.Combine(transactionPath, @"data.xml"); GinSerializer.Serialize(this, dataFilePath); }
public override CommandResult Do(IExecutionContext context) { object absoluteObject = context.GetResult(ObjectName); string tempPath = Path.Combine(context.TempPath, Guid.NewGuid().ToString("N") + ".dat"); if (absoluteObject is DataTable) { DataTable dataTable = (DataTable)absoluteObject; dataTable.WriteXml(tempPath); } else { GinSerializer.Serialize(absoluteObject, tempPath); } string objectStringValue = IOUtil.ReadFile(tempPath); File.Delete(tempPath); context.Log.AddLogInformation(ObjectName + "=" + objectStringValue); return(CommandResult.Next); }