Skip to content

Instantly share code, notes, and snippets.

@Criteo-dotnet-blog
Last active June 28, 2017 09:49
Show Gist options
  • Select an option

  • Save Criteo-dotnet-blog/d593e6ca45acb4caec820a76959204b2 to your computer and use it in GitHub Desktop.

Select an option

Save Criteo-dotnet-blog/d593e6ca45acb4caec820a76959204b2 to your computer and use it in GitHub Desktop.
public partial class DebuggerExtensions
{
    [DllExport("Help")]
    public static void Help(IntPtr client, [MarshalAs(UnmanagedType.LPStr)] string args)
    {
        OnHelp(client, args);
    }
   [DllExport("help")]
   public static void help(IntPtr client, [MarshalAs(UnmanagedType.LPStr)] string args)
   {
        OnHelp(client, args);
   }
 
    const string _help = "...";
    const string _tksHelp = "...";
    private static void OnHelp(IntPtr client, string args)
    {
        // Must be the first thing in our extension.
        if (!InitApi(client))
            return;
        string command = args;
        if (args != null)
            command = args.ToLower();
        switch (command)
        {
            case "tks":
            case "tkstate":
                Console.WriteLine(_tksHelp);
            break;
            default:
                Console.WriteLine(_help);
            break;
        }
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment