|
64 | 64 | <div class="container"> |
65 | 65 | <div class="col-md-3"><div class="bs-sidebar hidden-print affix well" role="complementary"> |
66 | 66 | <ul class="nav bs-sidenav"> |
| 67 | + <li class="main active"><a href="#what-is-this">What is this?</a></li> |
| 68 | + <li><a href="#install">Install</a></li> |
| 69 | + <li><a href="#create-a-command">Create a Command</a></li> |
67 | 70 | </ul> |
68 | 71 | </div></div> |
69 | 72 | <div class="col-md-9" role="main"> |
70 | 73 |
|
71 | | -</div> |
| 74 | +<h1 id="what-is-this">What is this?</h1> |
| 75 | +<p>InEngine.NET is a background commands processing server. |
| 76 | +It allows commands to be queued, scheduled, and ran directly. </p> |
| 77 | +<h2 id="install">Install</h2> |
| 78 | +<p>First, install the InEngine.Core package into your own Visual Studio project.</p> |
| 79 | +<p><strong>Package Manager</strong></p> |
| 80 | +<pre><code class="bash">Install-Package InEngine.Core |
| 81 | +</code></pre> |
| 82 | + |
| 83 | +<p><strong>Nuget CLI</strong></p> |
| 84 | +<pre><code class="bash">nuget install InEgine.Core |
| 85 | +</code></pre> |
| 86 | + |
| 87 | +<p><strong>.NET CLI</strong></p> |
| 88 | +<pre><code class="bash">dotnet add package InEngine.Core |
| 89 | +</code></pre> |
| 90 | + |
| 91 | +<p><strong>Paket CLI</strong></p> |
| 92 | +<pre><code class="bash">paket add InEngine.Core |
| 93 | +</code></pre> |
| 94 | + |
| 95 | +<p>Second, download the CLI and/or the Scheduler from a release that matches the version of the InEngine.Core package you included.</p> |
| 96 | +<p>Releases are found on GitHub: https://github.com/InEngine-NET/InEngine.NET/releases</p> |
| 97 | +<h2 id="create-a-command">Create a Command</h2> |
| 98 | +<p>Add a class that implements <strong>InEngine.Core.ICommand</strong> or extends <strong>InEngine.Core.AbstractCommand</strong>. </p> |
| 99 | +<pre><code class="c#">using InEngine.Core; |
| 100 | + |
| 101 | +namespace MyCommands |
| 102 | +{ |
| 103 | + public class MyCommand : ICommand |
| 104 | + { |
| 105 | + public CommandResult Run() |
| 106 | + { |
| 107 | + return new CommandResult(true); |
| 108 | + } |
| 109 | + } |
| 110 | +} |
| 111 | +</code></pre> |
| 112 | + |
| 113 | +<p>The <strong>AbstractCommand</strong> class adds extra functionality, like a logger, a progress bar, and the ability to schedule the command using the scheduler. |
| 114 | +Minimally, the Run method should be overridden.</p> |
| 115 | +<pre><code class="c#">using InEngine.Core; |
| 116 | + |
| 117 | +namespace MyCommands |
| 118 | +{ |
| 119 | + public class MyCommand : AbstractCommand |
| 120 | + { |
| 121 | + public override CommandResult Run() |
| 122 | + { |
| 123 | + return new CommandResult(true); |
| 124 | + } |
| 125 | + } |
| 126 | +} |
| 127 | +</code></pre></div> |
72 | 128 | </div> |
73 | 129 |
|
74 | 130 | <footer class="col-md-12"> |
@@ -108,5 +164,5 @@ <h4 class="modal-title" id="exampleModalLabel">Search</h4> |
108 | 164 |
|
109 | 165 | <!-- |
110 | 166 | MkDocs version : 0.16.3 |
111 | | -Build Date UTC : 2017-11-19 21:16:33 |
| 167 | +Build Date UTC : 2017-11-19 21:51:27 |
112 | 168 | --> |
0 commit comments