1

Closed

VERouteOptions.RouteMode is not supported

description

VERouteOptions.RouteMode is not supported and there is no VERouteMode enumeration;
Closed Aug 18, 2008 at 7:58 AM by IanBlackburn

comments

IanBlackburn wrote Jul 24, 2008 at 3:26 PM

The following changes need to be made:

In ScriptEnumConverter.cs add:

region VERouteMode

    /// <summary>
    /// Converts a <see cref="VERouteMode"/> to it's script string value.
    /// </summary>
    /// <param name="value">
    /// The value to convert.
    /// </param>
    /// <returns>
    /// The converted value as a string.
    /// </returns>
    static public string ToString(VERouteMode value)
    {
        switch (value)
        {
            case VERouteMode.Driving:
                return "Driving";
            case VERouteMode.Walking:
                return "Walking";
            default:
                throw new InvalidOperationException();
        }
    }

    /// <summary>
    /// Converts a string to a <see cref="VERouteMode"/> value.
    /// </summary>
    /// <param name="value">
    /// The string to convert.
    /// </param>
    /// <returns>
    /// The converted value.
    /// </returns>
    static public VERouteMode ToRouteMode(string value)
    {
        if (value == "Driving")
        {
            return VERouteMode.Driving;
        }
        if (value == "Walking")
        {
            return VERouteMode.Walking;
        }
        else
        {
            throw new InvalidOperationException();
        }
    }
    #endregion VERouteMode


IN VERouteOptions.cs add:

/// <summary name="VERouteMode">A VERouteMode Enumeration value specifying the mode of route to return</summary>
public VERouteMode RouteMode
{
    get { return ScriptEnumConverter.ToRouteMode(GetProperty<string>("RouteMode")); }
    set { SetProperty("RouteMode", ScriptEnumConverter.ToString(value)); }
}

wrote Aug 18, 2008 at 7:58 AM

Resolved with changeset 15143.

wrote Feb 12, 2013 at 7:16 PM

wrote May 14, 2013 at 10:33 PM