CRhinoCommand::result CCommandSampleDrawBitmap::RunCommand( const CRhinoCommandContext& context )
{
  CRhinoCommandOptionValue enable_opts[] = { RHCMDOPTVALUE(L"Yes"), RHCMDOPTVALUE(L"No"), RHCMDOPTVALUE(L"Toggle") };
  for(;;)
  {
    bool bEnable = m_conduit.IsEnabled();
	  int current_index = bEnable ? 0 : 1;

    CRhinoGetOption go;
    go.SetCommandPrompt( L"Choose command option" );
    go.AddCommandOptionList( RHCMDOPTNAME(L"Enable"), 3, enable_opts, current_index );
    go.AcceptNothing();

    CRhinoGet::result res = go.GetOption();
    if( res == CRhinoGet::option )
    {
      const CRhinoCommandOption* option = go.Option();
      if( 0 == option )
        return CRhinoCommand::failure;

      current_index = option->m_list_option_current;
      if( 0 == current_index )
      {
        if( !bEnable )
        {
          m_conduit.Enable();
          context.m_doc.Regen();
        }
      }
      else if( 1 == current_index )
      {
        if( bEnable )
        {
          m_conduit.Disable();
          context.m_doc.Regen();
        }
      }
      else // if( 2 == current_index )
      {
        if( bEnable )
          m_conduit.Disable();
        else
          m_conduit.Enable();
        context.m_doc.Regen();
      }

      continue;
    }

    break;
  }

  return CRhinoCommand::success;
}