Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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);
        }