# C1.C1Preview.Unit

## Content

<div class="doc-site-dotnet-api-container">



  <h1 id="C1_C1Preview_Unit" data-uid="C1.C1Preview.Unit" class="text-break">Unit Struct
</h1>
  <div class="markdown level0 summary"><p>A structure representing a single coordinate or dimension of an object
(e.g. <a class="xref" href="C1.C1Preview.RenderObject.X.html#C1_C1Preview_RenderObject_X">X</a> or <a class="xref" href="C1.C1Preview.RenderObject.Height.html#C1_C1Preview_RenderObject_Height">Height</a> of a <a class="xref" href="C1.C1Preview.RenderObject.html">RenderObject</a>)
in a <a class="xref" href="C1.C1Preview.C1PrintDocument.html">C1PrintDocument</a>.</p>
</div>
  <div class="markdown level0 conceptual"></div>
  <h6><strong>Namespace</strong>: <a class="xref" href="C1.C1Preview.html">C1.C1Preview</a></h6>
  <h6><strong>Assembly</strong>: C1.WPF.PrintDocument.4.6.2.dll</h6>
  <h5 id="C1_C1Preview_Unit_syntax">Syntax</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">[TypeConverter(typeof(Unit.TypeConverter))]
public struct Unit</code></pre>
  </div>
  <div class="codewrapper">
    <pre><code class="lang-vbnet hljs">&lt;TypeConverter(GetType(Unit.TypeConverter))&gt;
Public Structure Unit</code></pre>
  </div>
  <h5 id="C1_C1Preview_Unit_remarks"><strong>Remarks</strong></h5>
  <div class="markdown level0 remarks"><pre><code>&lt;p&gt;
</code></pre>
<p>The value may be &quot;auto&quot;, absolute (e.g. &quot;5mm&quot;), or an expression (e.g. &quot;prev.width + 12mm&quot;).
See <a class="xref" href="C1.C1Preview.Unit.-ctor.html#C1_C1Preview_Unit__ctor_System_String_">Unit(string)</a> for more details.</p>
<!--TBD: add more info (copy from descriptive doc?)--><!--TBD: add examples-->
</div>
  <h3 id="constructors">Constructors
</h3>
  <table class="table table-bordered table-condensed">
    <thead>
      <tr>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td id="C1_C1Preview_Unit__ctor_System_Double_C1_C1Preview_UnitTypeEnum_" data-uid="C1.C1Preview.Unit.#ctor(System.Double,C1.C1Preview.UnitTypeEnum)">
          <a class="xref" href="C1.C1Preview.Unit.-ctor.html#C1_C1Preview_Unit__ctor_System_Double_C1_C1Preview_UnitTypeEnum_">Unit(double, UnitTypeEnum)</a>
        </td>
        <td class="markdown level1 summary"><p>Initializes a new instance of the <a class="xref" href="C1.C1Preview.Unit.html">Unit</a> structure
with an absolute length value.</p>
</td>
      </tr>
      <tr>
        <td id="C1_C1Preview_Unit__ctor_System_String_" data-uid="C1.C1Preview.Unit.#ctor(System.String)">
          <a class="xref" href="C1.C1Preview.Unit.-ctor.html#C1_C1Preview_Unit__ctor_System_String_">Unit(string)</a>
        </td>
        <td class="markdown level1 summary"><p>Initializes a new instance of the <a class="xref" href="C1.C1Preview.Unit.html">Unit</a> structure
from a string. See <b>remarks</b> for details.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h3 id="properties">Properties
</h3>
  <table class="table table-bordered table-condensed">
    <thead>
      <tr>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td id="C1_C1Preview_Unit_Auto" data-uid="C1.C1Preview.Unit.Auto">
          <a class="xref" href="C1.C1Preview.Unit.Auto.html#C1_C1Preview_Unit_Auto">Auto</a>
        </td>
        <td class="markdown level1 summary"><p>Gets a <a class="xref" href="C1.C1Preview.Unit.html">Unit</a> representing an <b>&quot;auto&quot;</b> value.</p>
</td>
      </tr>
      <tr>
        <td id="C1_C1Preview_Unit_BoldLineWidth" data-uid="C1.C1Preview.Unit.BoldLineWidth">
          <a class="xref" href="C1.C1Preview.Unit.BoldLineWidth.html#C1_C1Preview_Unit_BoldLineWidth">BoldLineWidth</a>
        </td>
        <td class="markdown level1 summary"><p>Gets a <a class="xref" href="C1.C1Preview.Unit.html">Unit</a> value representing the default &quot;bold&quot; line thickness (2 points wide).</p>
</td>
      </tr>
      <tr>
        <td id="C1_C1Preview_Unit_Empty" data-uid="C1.C1Preview.Unit.Empty">
          <a class="xref" href="C1.C1Preview.Unit.Empty.html#C1_C1Preview_Unit_Empty">Empty</a>
        </td>
        <td class="markdown level1 summary"><p>Gets a <a class="xref" href="C1.C1Preview.Unit.html">Unit</a> representing an emtpy (zero) value.</p>
</td>
      </tr>
      <tr>
        <td id="C1_C1Preview_Unit_IsAbs" data-uid="C1.C1Preview.Unit.IsAbs">
          <a class="xref" href="C1.C1Preview.Unit.IsAbs.html#C1_C1Preview_Unit_IsAbs">IsAbs</a>
        </td>
        <td class="markdown level1 summary"><p>Gets a value indicating whether the current unit represents an absolute value
(such as &quot;1mm&quot;, &quot;2in&quot;, &quot;3em&quot; and so on).</p>
</td>
      </tr>
      <tr>
        <td id="C1_C1Preview_Unit_IsAuto" data-uid="C1.C1Preview.Unit.IsAuto">
          <a class="xref" href="C1.C1Preview.Unit.IsAuto.html#C1_C1Preview_Unit_IsAuto">IsAuto</a>
        </td>
        <td class="markdown level1 summary"><p>Gets a value indicating whether the current unit represents an <b>&quot;auto&quot;</b> value.</p>
</td>
      </tr>
      <tr>
        <td id="C1_C1Preview_Unit_IsEmpty" data-uid="C1.C1Preview.Unit.IsEmpty">
          <a class="xref" href="C1.C1Preview.Unit.IsEmpty.html#C1_C1Preview_Unit_IsEmpty">IsEmpty</a>
        </td>
        <td class="markdown level1 summary"><p>Gets a value indicating whether the current unit represents an empty value.</p>
</td>
      </tr>
      <tr>
        <td id="C1_C1Preview_Unit_IsParent" data-uid="C1.C1Preview.Unit.IsParent">
          <a class="xref" href="C1.C1Preview.Unit.IsParent.html#C1_C1Preview_Unit_IsParent">IsParent</a>
        </td>
        <td class="markdown level1 summary"><p>Gets a value indicating whether the current unit is specified as &quot;parent&quot;.</p>
</td>
      </tr>
      <tr>
        <td id="C1_C1Preview_Unit_IsParentHeight" data-uid="C1.C1Preview.Unit.IsParentHeight">
          <a class="xref" href="C1.C1Preview.Unit.IsParentHeight.html#C1_C1Preview_Unit_IsParentHeight">IsParentHeight</a>
        </td>
        <td class="markdown level1 summary"><p>Gets a value indicating whether the current unit is specified as &quot;parent.height&quot;.</p>
</td>
      </tr>
      <tr>
        <td id="C1_C1Preview_Unit_IsParentWidth" data-uid="C1.C1Preview.Unit.IsParentWidth">
          <a class="xref" href="C1.C1Preview.Unit.IsParentWidth.html#C1_C1Preview_Unit_IsParentWidth">IsParentWidth</a>
        </td>
        <td class="markdown level1 summary"><p>Gets a value indicating whether the current unit is specified as &quot;parent.width&quot;.</p>
</td>
      </tr>
      <tr>
        <td id="C1_C1Preview_Unit_LineWidth" data-uid="C1.C1Preview.Unit.LineWidth">
          <a class="xref" href="C1.C1Preview.Unit.LineWidth.html#C1_C1Preview_Unit_LineWidth">LineWidth</a>
        </td>
        <td class="markdown level1 summary"><p>Gets a <a class="xref" href="C1.C1Preview.Unit.html">Unit</a> value representing the default line thickness (1 point wide).</p>
</td>
      </tr>
      <tr>
        <td id="C1_C1Preview_Unit_Units" data-uid="C1.C1Preview.Unit.Units">
          <a class="xref" href="C1.C1Preview.Unit.Units.html#C1_C1Preview_Unit_Units">Units</a>
        </td>
        <td class="markdown level1 summary"><p>Gets the unit of measurement of the current unit.</p>
</td>
      </tr>
      <tr>
        <td id="C1_C1Preview_Unit_Value" data-uid="C1.C1Preview.Unit.Value">
          <a class="xref" href="C1.C1Preview.Unit.Value.html#C1_C1Preview_Unit_Value">Value</a>
        </td>
        <td class="markdown level1 summary"><p>Gets the absolute value of the current unit (in <a class="xref" href="C1.C1Preview.Unit.Units.html#C1_C1Preview_Unit_Units">Units</a>).</p>
</td>
      </tr>
    </tbody>
  </table>
  <h3 id="methods">Methods
</h3>
  <table class="table table-bordered table-condensed">
    <thead>
      <tr>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td id="C1_C1Preview_Unit_ConvertUnit_C1_C1Preview_UnitTypeEnum_" data-uid="C1.C1Preview.Unit.ConvertUnit(C1.C1Preview.UnitTypeEnum)">
          <a class="xref" href="C1.C1Preview.Unit.ConvertUnit.html#C1_C1Preview_Unit_ConvertUnit_C1_C1Preview_UnitTypeEnum_">ConvertUnit(UnitTypeEnum)</a>
        </td>
        <td class="markdown level1 summary"><p>Attempts to convert the current unit value to other unit of measurement.</p>
<p>Only absolute units can be converted.
This method throws an exception if the conversion cannot be performed.</p>
</td>
      </tr>
      <tr>
        <td id="C1_C1Preview_Unit_ConvertUnit_C1_C1Preview_UnitTypeEnum_System_Single_" data-uid="C1.C1Preview.Unit.ConvertUnit(C1.C1Preview.UnitTypeEnum,System.Single)">
          <a class="xref" href="C1.C1Preview.Unit.ConvertUnit.html#C1_C1Preview_Unit_ConvertUnit_C1_C1Preview_UnitTypeEnum_System_Single_">ConvertUnit(UnitTypeEnum, float)</a>
        </td>
        <td class="markdown level1 summary"><p>Attempts to convert the current unit value to other unit of measurement.</p>
<p>Only absolute units can be converted.
This method throws an exception if the conversion cannot be performed.</p>
</td>
      </tr>
      <tr>
        <td id="C1_C1Preview_Unit_ConvertUnit_System_Single_C1_C1Preview_UnitTypeEnum_System_Single_" data-uid="C1.C1Preview.Unit.ConvertUnit(System.Single,C1.C1Preview.UnitTypeEnum,System.Single)">
          <a class="xref" href="C1.C1Preview.Unit.ConvertUnit.html#C1_C1Preview_Unit_ConvertUnit_System_Single_C1_C1Preview_UnitTypeEnum_System_Single_">ConvertUnit(float, UnitTypeEnum, float)</a>
        </td>
        <td class="markdown level1 summary"><p>Attempts to convert the current unit value to other unit of measurement.</p>
<p>Only absolute units can be converted.
This method throws an exception if the conversion cannot be performed.</p>
</td>
      </tr>
      <tr>
        <td id="C1_C1Preview_Unit_Equals_System_Object_" data-uid="C1.C1Preview.Unit.Equals(System.Object)">
          <a class="xref" href="C1.C1Preview.Unit.Equals.html#C1_C1Preview_Unit_Equals_System_Object_">Equals(object)</a>
        </td>
        <td class="markdown level1 summary"><p>Compares the current unit value with another object.</p>
</td>
      </tr>
      <tr>
        <td id="C1_C1Preview_Unit_FromObject_System_Object_" data-uid="C1.C1Preview.Unit.FromObject(System.Object)">
          <a class="xref" href="C1.C1Preview.Unit.FromObject.html#C1_C1Preview_Unit_FromObject_System_Object_">FromObject(object)</a>
        </td>
        <td class="markdown level1 summary"><p>Attempts to convert an object to a unit value.
This method throws an exception if the conversion cannot be performed.</p>
</td>
      </tr>
      <tr>
        <td id="C1_C1Preview_Unit_GetHashCode" data-uid="C1.C1Preview.Unit.GetHashCode">
          <a class="xref" href="C1.C1Preview.Unit.GetHashCode.html#C1_C1Preview_Unit_GetHashCode">GetHashCode()</a>
        </td>
        <td class="markdown level1 summary"><p>Gets the hash code for the current unit value.</p>
</td>
      </tr>
      <tr>
        <td id="C1_C1Preview_Unit_ToString" data-uid="C1.C1Preview.Unit.ToString">
          <a class="xref" href="C1.C1Preview.Unit.ToString.html#C1_C1Preview_Unit_ToString">ToString()</a>
        </td>
        <td class="markdown level1 summary"><p>Returns a string that represents the current object.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h3 id="operators">Operators
</h3>
  <table class="table table-bordered table-condensed">
    <thead>
      <tr>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td id="C1_C1Preview_Unit_op_Addition_C1_C1Preview_Unit_C1_C1Preview_Unit_" data-uid="C1.C1Preview.Unit.op_Addition(C1.C1Preview.Unit,C1.C1Preview.Unit)">
          <a class="xref" href="C1.C1Preview.Unit.op_Addition.html#C1_C1Preview_Unit_op_Addition_C1_C1Preview_Unit_C1_C1Preview_Unit_">operator +(Unit, Unit)</a>
        </td>
        <td class="markdown level1 summary"><p>Addition of two unit values.</p>
</td>
      </tr>
      <tr>
        <td id="C1_C1Preview_Unit_op_Equality_C1_C1Preview_Unit_C1_C1Preview_Unit_" data-uid="C1.C1Preview.Unit.op_Equality(C1.C1Preview.Unit,C1.C1Preview.Unit)">
          <a class="xref" href="C1.C1Preview.Unit.op_Equality.html#C1_C1Preview_Unit_op_Equality_C1_C1Preview_Unit_C1_C1Preview_Unit_">operator ==(Unit, Unit)</a>
        </td>
        <td class="markdown level1 summary"><p>Tests whether the two unit values are equal.</p>
</td>
      </tr>
      <tr>
        <td id="C1_C1Preview_Unit_op_Implicit_C1_C1Preview_Unit__System_Double" data-uid="C1.C1Preview.Unit.op_Implicit(C1.C1Preview.Unit)~System.Double">
          <a class="xref" href="C1.C1Preview.Unit.op_Implicit.html#C1_C1Preview_Unit_op_Implicit_C1_C1Preview_Unit__System_Double">implicit operator double(Unit)</a>
        </td>
        <td class="markdown level1 summary"><p>Returns the absolute value of a <a class="xref" href="C1.C1Preview.Unit.html">Unit</a> expressed in <a class="xref" href="C1.C1Preview.UnitTypeEnum.html#C1_C1Preview_UnitTypeEnum_Default">Default</a> units.</p>
<p>Throws exception if the operation cannot be performed.</p>
</td>
      </tr>
      <tr>
        <td id="C1_C1Preview_Unit_op_Implicit_C1_C1Preview_Unit__System_String" data-uid="C1.C1Preview.Unit.op_Implicit(C1.C1Preview.Unit)~System.String">
          <a class="xref" href="C1.C1Preview.Unit.op_Implicit.html#C1_C1Preview_Unit_op_Implicit_C1_C1Preview_Unit__System_String">implicit operator string(Unit)</a>
        </td>
        <td class="markdown level1 summary"><p>Converts a unit value to a string.</p>
</td>
      </tr>
      <tr>
        <td id="C1_C1Preview_Unit_op_Implicit_System_Double__C1_C1Preview_Unit" data-uid="C1.C1Preview.Unit.op_Implicit(System.Double)~C1.C1Preview.Unit">
          <a class="xref" href="C1.C1Preview.Unit.op_Implicit.html#C1_C1Preview_Unit_op_Implicit_System_Double__C1_C1Preview_Unit">implicit operator Unit(double)</a>
        </td>
        <td class="markdown level1 summary"><p>Converts a <b>double</b> value to a <a class="xref" href="C1.C1Preview.Unit.html">Unit</a> using <a class="xref" href="C1.C1Preview.UnitTypeEnum.html#C1_C1Preview_UnitTypeEnum_Default">Default</a> units.</p>
</td>
      </tr>
      <tr>
        <td id="C1_C1Preview_Unit_op_Implicit_System_Int32__C1_C1Preview_Unit" data-uid="C1.C1Preview.Unit.op_Implicit(System.Int32)~C1.C1Preview.Unit">
          <a class="xref" href="C1.C1Preview.Unit.op_Implicit.html#C1_C1Preview_Unit_op_Implicit_System_Int32__C1_C1Preview_Unit">implicit operator Unit(int)</a>
        </td>
        <td class="markdown level1 summary"><p>Converts an integer value to a <a class="xref" href="C1.C1Preview.Unit.html">Unit</a> using <a class="xref" href="C1.C1Preview.UnitTypeEnum.html#C1_C1Preview_UnitTypeEnum_Default">Default</a> units.</p>
</td>
      </tr>
      <tr>
        <td id="C1_C1Preview_Unit_op_Implicit_System_String__C1_C1Preview_Unit" data-uid="C1.C1Preview.Unit.op_Implicit(System.String)~C1.C1Preview.Unit">
          <a class="xref" href="C1.C1Preview.Unit.op_Implicit.html#C1_C1Preview_Unit_op_Implicit_System_String__C1_C1Preview_Unit">implicit operator Unit(string)</a>
        </td>
        <td class="markdown level1 summary"><p>Converts a string to a <a class="xref" href="C1.C1Preview.Unit.html">Unit</a> value (see <a class="xref" href="C1.C1Preview.Unit.-ctor.html#C1_C1Preview_Unit__ctor_System_String_">Unit(string)</a>.</p>
</td>
      </tr>
      <tr>
        <td id="C1_C1Preview_Unit_op_Inequality_C1_C1Preview_Unit_C1_C1Preview_Unit_" data-uid="C1.C1Preview.Unit.op_Inequality(C1.C1Preview.Unit,C1.C1Preview.Unit)">
          <a class="xref" href="C1.C1Preview.Unit.op_Inequality.html#C1_C1Preview_Unit_op_Inequality_C1_C1Preview_Unit_C1_C1Preview_Unit_">operator !=(Unit, Unit)</a>
        </td>
        <td class="markdown level1 summary"><p>Tests whether the two unit values are not equal.</p>
</td>
      </tr>
      <tr>
        <td id="C1_C1Preview_Unit_op_Subtraction_C1_C1Preview_Unit_C1_C1Preview_Unit_" data-uid="C1.C1Preview.Unit.op_Subtraction(C1.C1Preview.Unit,C1.C1Preview.Unit)">
          <a class="xref" href="C1.C1Preview.Unit.op_Subtraction.html#C1_C1Preview_Unit_op_Subtraction_C1_C1Preview_Unit_C1_C1Preview_Unit_">operator -(Unit, Unit)</a>
        </td>
        <td class="markdown level1 summary"><p>Subtraction of two unit values.</p>
</td>
      </tr>
    </tbody>
  </table>

</div>
