# C1.WPF.Schedule.VisualInterval.ContainsTime

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_WPF_Schedule_VisualInterval_ContainsTime_" data-uid="C1.WPF.Schedule.VisualInterval.ContainsTime*">ContainsTime Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_WPF_Schedule_VisualInterval_ContainsTime_" data-uid="C1.WPF.Schedule.VisualInterval.ContainsTime*"></a>
<h4 id="C1_WPF_Schedule_VisualInterval_ContainsTime_System_DateTime_" data-uid="C1.WPF.Schedule.VisualInterval.ContainsTime(System.DateTime)">ContainsTime(DateTime)</h4>
<div class="markdown level1 summary"><p>Gets a value indicating whether the specified DateTime belongs to the
time range represented by the <a class="xref" href="C1.WPF.Schedule.VisualInterval.html">VisualInterval</a>.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public bool ContainsTime(DateTime time)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function ContainsTime(time As Date) As Boolean</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><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.datetime">DateTime</a></td>
      <td><span class="parametername">time</span></td>
      <td><p>A checked DateTime.</p>
</td>
    </tr>
  </tbody>
</table>
<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.boolean">bool</a></td>
      <td><p>This method returns true if the specified DateTime belongs
to the time range represented by the <a class="xref" href="C1.WPF.Schedule.VisualInterval.html">VisualInterval</a>;
otherwise, false.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="C1_WPF_Schedule_VisualInterval_ContainsTime_System_DateTime__remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>A DateTime is considered as belonging to a <a class="xref" href="C1.WPF.Schedule.VisualInterval.html">VisualInterval</a>
if the following condition is satisfied:</p>
<p><a class="xref" href="C1.WPF.Schedule.VisualInterval.StartTime.html#C1_WPF_Schedule_VisualInterval_StartTime">StartTime</a> &lt;= DateTime and 
DateTime &gt; <a class="xref" href="C1.WPF.Schedule.VisualInterval.EndTime.html#C1_WPF_Schedule_VisualInterval_EndTime">EndTime</a></p><p>
Note that the bottom boundary of the interval is exclusive, that is 
DateTime = <a class="xref" href="C1.WPF.Schedule.VisualInterval.EndTime.html#C1_WPF_Schedule_VisualInterval_EndTime">EndTime</a> is considered as not
belonging to the interval.
</p>
</div>
</div>
