# GrapeCity.ActiveReports.Viewer.Win.Viewer.GetShortcutCommands

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="GrapeCity_ActiveReports_Viewer_Win_Viewer_GetShortcutCommands_" data-uid="GrapeCity.ActiveReports.Viewer.Win.Viewer.GetShortcutCommands*">GetShortcutCommands Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="GrapeCity_ActiveReports_Viewer_Win_Viewer_GetShortcutCommands_" data-uid="GrapeCity.ActiveReports.Viewer.Win.Viewer.GetShortcutCommands*"></a>
<h4 id="GrapeCity_ActiveReports_Viewer_Win_Viewer_GetShortcutCommands" data-uid="GrapeCity.ActiveReports.Viewer.Win.Viewer.GetShortcutCommands">GetShortcutCommands()</h4>
<div class="markdown level1 summary"><p>Retrieves a collection of keyboard shortcuts configured for the viewer.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public IEnumerable&lt;ViewerShortcut&gt; GetShortcutCommands()</code></pre>
</div>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1">IEnumerable</a>&lt;<a class="xref" href="GrapeCity.ActiveReports.Viewer.Win.ViewerShortcut.html">ViewerShortcut</a>&gt;</td>
      <td><p>A collection of <a class="xref" href="GrapeCity.ActiveReports.Viewer.Win.ViewerShortcut.html">ViewerShortcut</a> objects, each representing
a keyboard shortcut configured for various viewer actions.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="GrapeCity_ActiveReports_Viewer_Win_Viewer_GetShortcutCommands_remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>This method provides access to the viewer's keyboard shortcuts, allowing external components or applications to display,
customize, or respond to these shortcuts. It is essential for enhancing user accessibility and efficiency when interacting with the viewer.</p>
</div>
<h5 id="GrapeCity_ActiveReports_Viewer_Win_Viewer_GetShortcutCommands_examples">Examples</h5>
<pre><code class="lang-csharp">// Assuming 'viewer' is an instance of Viewer.
// Retrieving the list of shortcut commands available in the viewer.
var shortcutCommands = viewer.GetShortcutCommands();
foreach (var command in shortcutCommands)
{
    Console.WriteLine($"Command: {command.Command}, Enabled: {command.Enabled}");
}</code></pre>

<h5 class="exceptions">Exceptions</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Condition</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.argumentnullexception">ArgumentNullException</a></td>
      <td><p>Thrown if the internal storage for toolbar shortcuts is not initialized,
indicating a configuration or initialization error within the viewer.</p>
</td>
    </tr>
  </tbody>
</table>
</div>
