Exemplo n.º 1
0
        static void Main(string[] args)
        {
            var csvSource = new SourceCSV();                                    // Create an source file of type CSV
            var document  = csvSource.ReadData();                               // Create a common document from data in CSV

            var jsonOutput = new OutputJSON(document);                          // Create an output file of type JSON

            jsonOutput.SaveDocument();                                          // Save document to Output file

            var xmlOutput = new OutputXML(document);                            // Create an output file of type XML

            xmlOutput.SaveDocument();                                           // Save document to Output file


            var xmlSource = new SourceXML();                                    // Create XML Source file

            document = xmlSource.ReadData();                                    // Deserialise XML file into Document

            var jsonSource = new SourceJSON();                                  // Create JSON Source file

            document = jsonSource.ReadData();                                   // Deserialise JSON file into Document


            Console.WriteLine(document.ToString());
            Console.WriteLine();
        }
        public TransactionControl(TransactionJSON transactionJSON)
        {
            InitializeComponent();

            Width = 700;

            txtTransactionId.Text = transactionJSON.Id;
            txtTimestamp.Text     = transactionJSON.Timestamp.ToString();
            txtType.Text          = transactionJSON.Type;
            VerticalAlignment     = VerticalAlignment.Top;
            HorizontalAlignment   = HorizontalAlignment.Center;

            if (transactionJSON.Inputs != null)
            {
                for (int index = 0; index < transactionJSON.Inputs.Count(); index++)
                {
                    InputJSON    input        = transactionJSON.Inputs[index];
                    InputControl inputControl = new InputControl(input.Address, input.Signature);
                    spInputs.Children.Add(inputControl);
                }
            }

            for (int index = 0; index < transactionJSON.Outputs.Count(); index++)
            {
                OutputJSON    output        = transactionJSON.Outputs[index];
                OutputControl outputControl = new OutputControl(output.Amount, output.Address, output.PublicKey);
                spOutputs.Children.Add(outputControl);
            }
        }