Exemplo n.º 1
0
        public static ContractInterface Unserialize(BinaryReader reader)
        {
            var len     = reader.ReadByte();
            var methods = new ContractMethod[len];

            for (int i = 0; i < len; i++)
            {
                methods[i] = ContractMethod.Unserialize(reader);
            }

            return(new ContractInterface(methods));
        }
Exemplo n.º 2
0
        public void UnserializeData(BinaryReader reader)
        {
            var len = reader.ReadByte();

            _methods.Clear();
            for (int i = 0; i < len; i++)
            {
                var method = ContractMethod.Unserialize(reader);
                _methods[method.name] = method;
            }

            len          = reader.ReadByte();
            this._events = new ContractEvent[len];
            for (int i = 0; i < len; i++)
            {
                _events[i] = ContractEvent.Unserialize(reader);
            }
        }