alef 0.110.4

Opinionated polyglot binding generator for Rust libraries
Documentation
// This file is auto-generated by alef. DO NOT EDIT.
#nullable enable

using System;

namespace {{ namespace }};

{% if doc %}
/// <summary>
{% for line in doc_lines %}
/// {{ line }}
{% endfor %}
/// </summary>
{% endif %}
public class {{ base_name }} : {{ base_parent }}
{
{% if has_methods %}
{% for m in methods %}
{% if m.doc %}    /// <summary>{{ m.doc }}</summary>
{% endif %}
    public {{ m.cs_type }} {{ m.prop_name }} { get;{% if m.wired %} private set;{% endif %} }
{% endfor %}

    public {{ base_name }}(string message) : base(message)
    {
{% for m in methods %}
        {{ m.prop_name }} = {{ m.default_value }};
{% endfor %}
    }

    public {{ base_name }}(string message, Exception innerException) : base(message, innerException)
    {
{% for m in methods %}
        {{ m.prop_name }} = {{ m.default_value }};
{% endfor %}
    }

{% if legacy_ctor_methods %}
    public {{ base_name }}(string message{% for m in legacy_ctor_methods %}, {{ m.cs_type }} {{ m.param_name }}{% endfor %}) : base(message)
    {
{% for m in methods %}
{% if m.is_duration %}
        {{ m.prop_name }} = {{ m.default_value }};
{% else %}
        {{ m.prop_name }} = {{ m.param_name }};
{% endif %}
{% endfor %}
    }

    public {{ base_name }}(string message, Exception innerException{% for m in legacy_ctor_methods %}, {{ m.cs_type }} {{ m.param_name }}{% endfor %}) : base(message, innerException)
    {
{% for m in methods %}
{% if m.is_duration %}
        {{ m.prop_name }} = {{ m.default_value }};
{% else %}
        {{ m.prop_name }} = {{ m.param_name }};
{% endif %}
{% endfor %}
    }
{% endif %}
{% if has_duration_methods %}

    public {{ base_name }}(string message{% for m in methods %}, {{ m.cs_type }} {{ m.param_name }}{% endfor %}) : base(message)
    {
{% for m in methods %}
        {{ m.prop_name }} = {{ m.param_name }};
{% endfor %}
    }

    public {{ base_name }}(string message, Exception innerException{% for m in methods %}, {{ m.cs_type }} {{ m.param_name }}{% endfor %}) : base(message, innerException)
    {
{% for m in methods %}
        {{ m.prop_name }} = {{ m.param_name }};
{% endfor %}
    }
{% endif %}
{% if has_last_error_fields %}

    /// <summary>Fills the introspection properties from the native layer's last-error getters; call before any other native call.</summary>
    internal void ApplyLastError()
    {
{% for m in methods %}
{% for line in m.apply_lines %}
        {{ line }}
{% endfor %}
{% endfor %}
    }
{% endif %}
{% else %}
    public {{ base_name }}(string message) : base(message) { }

    public {{ base_name }}(string message, Exception innerException) : base(message, innerException) { }
{% endif %}
}