# C1.Util.DX.DXUtil.Pin

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_Util_DX_DXUtil_Pin_" data-uid="C1.Util.DX.DXUtil.Pin*">Pin Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_Util_DX_DXUtil_Pin_" data-uid="C1.Util.DX.DXUtil.Pin*"></a>
<h4 id="C1_Util_DX_DXUtil_Pin__1___0__System_Action_System_IntPtr__" data-uid="C1.Util.DX.DXUtil.Pin``1(``0@,System.Action{System.IntPtr})">Pin&lt;T&gt;(ref T, Action&lt;IntPtr&gt;)</h4>
<div class="markdown level1 summary"><p>Pins the specified source and call an action with the pinned pointer.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public static void Pin&lt;T&gt;(ref T source, Action&lt;IntPtr&gt; pinAction) where T : struct</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Sub Pin(Of T As Structure)(ByRef source As T, pinAction As Action(Of IntPtr))</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><span class="xref">T</span></td>
      <td><span class="parametername">source</span></td>
      <td><p>The source.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.action-1">Action</a>&lt;<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.intptr">IntPtr</a>&gt;</td>
      <td><span class="parametername">pinAction</span></td>
      <td><p>The pin action to perform on the pinned pointer.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="typeParameters">Type Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><span class="parametername">T</span></td>
      <td><p>The type of the structure to pin.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="C1_Util_DX_DXUtil_Pin_" data-uid="C1.Util.DX.DXUtil.Pin*"></a>
<h4 id="C1_Util_DX_DXUtil_Pin__1___0___System_Action_System_IntPtr__" data-uid="C1.Util.DX.DXUtil.Pin``1(``0[],System.Action{System.IntPtr})">Pin&lt;T&gt;(T[], Action&lt;IntPtr&gt;)</h4>
<div class="markdown level1 summary"><p>Pins the specified source and call an action with the pinned pointer.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public static void Pin&lt;T&gt;(T[] source, Action&lt;IntPtr&gt; pinAction) where T : struct</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Sub Pin(Of T As Structure)(source As T(), pinAction As Action(Of IntPtr))</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>T[]</td>
      <td><span class="parametername">source</span></td>
      <td><p>The source array.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.action-1">Action</a>&lt;<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.intptr">IntPtr</a>&gt;</td>
      <td><span class="parametername">pinAction</span></td>
      <td><p>The pin action to perform on the pinned pointer.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="typeParameters">Type Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><span class="parametername">T</span></td>
      <td><p>The type of the structure to pin.</p>
</td>
    </tr>
  </tbody>
</table>
</div>
