Home
Options

Get current setting for "Maximum rows to display" from inside query?

I have an extension method that I would like to change behavior based on if a result set exceeds the current "Maximum rows to display" setting in Preferences|Results. Does the query have access to the current status of this setting?

What I'm trying to achieve is a variation of ToHtmlString that performs "paging" or takes other action to get around the above setting limit. I tried using CreateXhtmlWriter directly, but it always adheres to the Maximum rows to display limit.

Comments

  • Options
    The following will query the setting:
    
    int? GetMaxQueryRows()
    {
       string userOptionsPath = Path.Combine (
             Environment.GetFolderPath (Environment.SpecialFolder.ApplicationData),
             "LINQPad",
             "RoamingUserOptions.xml");	
             
       if (!File.Exists (userOptionsPath)) return null;
       
       var root = XDocument.Load (userOptionsPath).Root;
       
       return (int?) root.Element (root.Name.Namespace + "MaxQueryRows");
    }
Sign In or Register to comment.