コード例 #1
0
        public override string GenerateClass()
        {
            var functionABI = Model.FunctionABI;
            var header = "";
            if (_functionABIModel.IsMultipleOutput())
            {
                header = $@"{SpaceUtils.OneTab}<[Function](""{functionABI.Name}"", GetType({_functionOutputDTOModel.GetTypeName()}))>";
            }

            if (_functionABIModel.IsSingleOutput())
            {
                header = $@"{SpaceUtils.OneTab}<[Function](""{functionABI.Name}"", ""{_functionABIModel.GetSingleAbiReturnType()}"")>";
            }

            if (_functionABIModel.HasNoReturn())
            {
                header = $@"{SpaceUtils.OneTab}<[Function](""{functionABI.Name}"">";
            }

            return $@"{header}
{SpaceUtils.OneTab}Public Class {Model.GetTypeName()}
{SpaceUtils.TwoTabs}Inherits ContractMessage
{SpaceUtils.OneTab}
{_parameterAbiFunctionDtovbTemplate.GenerateAllProperties(functionABI.InputParameters)}
{SpaceUtils.OneTab}
{SpaceUtils.OneTab}End Class
";
        }
コード例 #2
0
        public override string GenerateClass()
        {
            var typeName = Model.GetTypeName();

            return
                ($@"{SpaceUtils.OneTab}Public Class {typeName} 
{SpaceUtils.ThreeTabs}Inherits ContractDeploymentMessage
{SpaceUtils.TwoTabs}
{SpaceUtils.TwoTabs}Public Shared BYTECODE As String = ""{Model.ByteCode}""
{SpaceUtils.TwoTabs}
{SpaceUtils.TwoTabs}Public Sub New()
{SpaceUtils.ThreeTabs}MyBase.New(BYTECODE)
{SpaceUtils.TwoTabs}End Sub
{SpaceUtils.TwoTabs}
{SpaceUtils.TwoTabs}Public Sub New(ByVal byteCode As String)
{SpaceUtils.ThreeTabs}MyBase.New(byteCode)
{SpaceUtils.TwoTabs}End Sub
{SpaceUtils.TwoTabs}
{_parameterAbiFunctionDtovbTemplate.GenerateAllProperties(Model.ConstructorABI.InputParameters)}
{SpaceUtils.OneTab}
{SpaceUtils.OneTab}End Class");
        }