Exemplo n.º 1
0
        public override string GenerateClass()
        {
            var functionABI = Model.FunctionABI;
            var header      = "";

            if (_functionABIModel.IsMultipleOutput())
            {
                header = $@"{SpaceUtils.OneTab}[Function(""{functionABI.Name}"", typeof({_functionOutputDTOModel.GetTypeName()}))]";
            }

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

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

            return($@"{GetPartialMainClass()}

{header}
{SpaceUtils.OneTab}public class {Model.GetTypeName()}Base : FunctionMessage
{SpaceUtils.OneTab}{{
{_parameterAbiFunctionDtocSharpTemplate.GenerateAllProperties(functionABI.InputParameters)}
{SpaceUtils.OneTab}}}");
        }
        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
";
        }
Exemplo n.º 3
0
        public override string GenerateClass()
        {
            var functionABI = Model.FunctionABI;
            var header      = "";

            if (_functionABIModel.IsMultipleOutput())
            {
                header = $@"{SpaceUtils.OneTab}[<Function(""{functionABI.Name}"", typeof<{_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}type {Model.GetTypeName()}() = 
{SpaceUtils.TwoTabs}inherit FunctionMessage()
{SpaceUtils.OneTab}
{_parameterAbiFunctionDtoFSharpTemplate.GenerateAllProperties(functionABI.InputParameters)}
{SpaceUtils.OneTab}");
        }
        public string GenerateClass(FunctionABI functionABI)
        {
            var header = "";

            if (_functionABIModel.IsMultipleOutput(functionABI))
            {
                header = $@"{SpaceUtils.OneTab}[Function(""{functionABI.Name}"", typeof({_functionOutputDTOModel.GetFunctionOutputTypeName(functionABI)}))]";
            }

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

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

            return($@"{header}
{SpaceUtils.OneTab}public class {_functionCQSMessageModel.GetFunctionMessageTypeName(functionABI)}:ContractMessage
{SpaceUtils.OneTab}{{
{_parameterABIFunctionDTOTemplate.GenerateAllProperties(functionABI.InputParameters)}
{SpaceUtils.OneTab}}}");
        }