public void setRecentStatus(TypeRecentStatusKnownValues new_value)
    {
        TypeRecentStatus new_full_value = new TypeRecentStatus();

        Debug.Assert(new_value != TypeRecentStatusKnownValues.RecentStatus__none);
        new_full_value.in_known_list = true;
        new_full_value.list_value    = new_value;
        setRecentStatus(new_full_value);
    }
    public string  getRecentStatusAsString()
    {
        TypeRecentStatus result = getRecentStatus();

        if (result.in_known_list)
        {
            return(stringFromRecentStatus(result.list_value));
        }
        else
        {
            return(result.string_value);
        }
    }
            protected override void handle_result(string result)
            {
                TypeRecentStatusKnownValues known     = stringToRecentStatus(result);
                TypeRecentStatus            new_value = new TypeRecentStatus();

                if (known == TypeRecentStatusKnownValues.RecentStatus__none)
                {
                    new_value.in_known_list = false;
                    new_value.string_value  = result;
                }
                else
                {
                    new_value.in_known_list = true;
                    new_value.list_value    = known;
                }
                handle_result(new_value);
            }
    public void setRecentStatus(string chars)
    {
        TypeRecentStatusKnownValues known     = stringToRecentStatus(chars);
        TypeRecentStatus            new_value = new TypeRecentStatus();

        if (known == TypeRecentStatusKnownValues.RecentStatus__none)
        {
            new_value.in_known_list = false;
            new_value.string_value  = chars;
        }
        else
        {
            new_value.in_known_list = true;
            new_value.list_value    = known;
        }
        setRecentStatus(new_value);
    }
    private void  fromJSONRecentStatus(JSONValue json_value, bool ignore_extras)
    {
        Debug.Assert(json_value != null);
        JSONStringValue json_string = json_value.string_value();

        if (json_string == null)
        {
            throw new Exception("The value for field RecentStatus of HomeAutomationMovementStatusJSON is not a string.");
        }
        TypeRecentStatus the_open_enum = new TypeRecentStatus();

        switch (json_string.getData()[0])
        {
        case 'M':
            if ((String.Compare(json_string.getData(), 1, "ovementDetected", 0, 15, false) == 0) && (json_string.getData().Length == 16))
            {
                the_open_enum.in_known_list = true;
                the_open_enum.list_value    = TypeRecentStatusKnownValues.RecentStatus_MovementDetected;
                goto open_enum_is_done;
            }
            break;

        case 'N':
            if ((String.Compare(json_string.getData(), 1, "oMovementDetected", 0, 17, false) == 0) && (json_string.getData().Length == 18))
            {
                the_open_enum.in_known_list = true;
                the_open_enum.list_value    = TypeRecentStatusKnownValues.RecentStatus_NoMovementDetected;
                goto open_enum_is_done;
            }
            break;

        default:
            break;
        }
        the_open_enum.in_known_list = false;
        the_open_enum.string_value  = json_string.getData();
        open_enum_is_done :;
        setRecentStatus(the_open_enum);
    }
 protected override void handle_result(TypeRecentStatus result)
 {
     top.value.Add(result);
 }
            protected override void handle_result(TypeRecentStatus result)
            {
//@@@        Debug.Assert(!have_value);
                have_value = true;
                value      = result;
            }
 protected abstract void handle_result(TypeRecentStatus result);
 public void setRecentStatus(TypeRecentStatus new_value)
 {
     flagHasRecentStatus = true;
     storeRecentStatus   = new_value;
 }