Bandwidth.Standard/Voice/Models/DisconnectCauseEnum.cs
/// <summary>
/// Converts a DisconnectCauseEnum value to a corresponding string value
/// </summary>
/// <param name="enumValue">The DisconnectCauseEnum value to convert</param>
/// <returns>The representative string value</returns>
Converts a DisconnectCauseEnum value to a corresponding string value
Converts a DisconnectCauseEnum value to a corresponding string value
public static string ToValue(DisconnectCauseEnum enumValue)
        {
            switch(enumValue)
            {
                case DisconnectCauseEnum.Busy:
                case DisconnectCauseEnum.Callbackerror:
                case DisconnectCauseEnum.Cancel:
                case DisconnectCauseEnum.Error:
                case DisconnectCauseEnum.Hangup:
                case DisconnectCauseEnum.Invalidbxml:
                case DisconnectCauseEnum.Rejected:
                case DisconnectCauseEnum.Timeout:
                case DisconnectCauseEnum.Accountlimit:
                case DisconnectCauseEnum.Nodecapacityexceeded:
                case DisconnectCauseEnum.Unknown:
                case DisconnectCauseEnum.Applicationerror:
                    return stringValues[(int)enumValue];
                default:
                    return null;
            }
        }
public static string ToValue ( DisconnectCauseEnum enumValue ) { switch ( enumValue ) { case DisconnectCauseEnum . Busy : case DisconnectCauseEnum . Callbackerror : case DisconnectCauseEnum . Cancel : case DisconnectCauseEnum . Error : case DisconnectCauseEnum . Hangup : case DisconnectCauseEnum . Invalidbxml : case DisconnectCauseEnum . Rejected : case DisconnectCauseEnum . Timeout : case DisconnectCauseEnum . Accountlimit : case DisconnectCauseEnum . Nodecapacityexceeded : case DisconnectCauseEnum . Unknown : case DisconnectCauseEnum . Applicationerror : return stringValues [ ( int ) enumValue ] ; default : return null ; } }
Converts a DisconnectCauseEnum value to a corresponding string value
Converts a DisconnectCauseEnum value to a corresponding string value
//only valid enum elements can be used //this is necessary to avoid errors //an invalid enum value was requested
The representative string value
The representative string value
enumValue
DisconnectCauseEnum
The DisconnectCauseEnum value to convert
The DisconnectCauseEnum value to convert