Skip to content

Commit

Permalink
Deploying to gh-pages from @ c77be4c 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
kMutagene committed Jan 27, 2025
1 parent 19eb870 commit f42440e
Show file tree
Hide file tree
Showing 23 changed files with 1,109 additions and 294 deletions.
4 changes: 2 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,8 @@ <h2><a name="Serialization" class="anchor" href="#Serialization">Serialization</
<div class="fsdocs-tip" id="fs1">Multiple items<br />namespace DynamicObj<br /><br />--------------------<br />type DynamicObj =
inherit DynamicObject
new: unit -&gt; DynamicObj
member DeepCopyProperties: unit -&gt; obj
member DeepCopyPropertiesTo: target: #DynamicObj * ?overWrite: bool -&gt; unit
member DeepCopyProperties: ?includeInstanceProperties: bool -&gt; obj
member DeepCopyPropertiesTo: target: #DynamicObj * ?overWrite: bool * ?includeInstanceProperties: bool -&gt; unit
override Equals: o: obj -&gt; bool
override GetDynamicMemberNames: unit -&gt; IEnumerable&lt;string&gt;
override GetHashCode: unit -&gt; int
Expand Down
2 changes: 1 addition & 1 deletion index.json

Large diffs are not rendered by default.

65 changes: 58 additions & 7 deletions reference/dynamicobj-copyutils.html
Original file line number Diff line number Diff line change
Expand Up @@ -143,19 +143,19 @@ <h3>
<tr>
<td class="fsdocs-member-usage">
<div>
<code onmouseout="hideTip(event, '102', 102)" onmouseover="showTip(event, '102', 102)">
<code onmouseout="hideTip(event, '106', 106)" onmouseover="showTip(event, '106', 106)">
<p>
<a id="tryDeepCopyObj">
<a href="#tryDeepCopyObj">
<code><span>CopyUtils.tryDeepCopyObj&#32;<span>o</span></span></code>
<code><span>CopyUtils.tryDeepCopyObj&#32;<span><span>(<span>o,&#32;?includeInstanceProperties</span>)</span></span></span></code>
</a>
</a>
</p>
</code>
<div class="fsdocs-tip" id="102">
<div class="fsdocs-tip" id="106">
<div class="member-tooltip">
Full Usage:
<code><span>CopyUtils.tryDeepCopyObj&#32;<span>o</span></span></code>
<code><span>CopyUtils.tryDeepCopyObj&#32;<span><span>(<span>o,&#32;?includeInstanceProperties</span>)</span></span></span></code>
<br/>
<br/>
Parameters:
Expand All @@ -166,6 +166,18 @@ <h3>
</b>
:
<code>obj</code>
-
The object that should be deep copied
</span>
<br/>
<span>
<b>
?includeInstanceProperties
</b>
:
<code>bool</code>
-
Whether to include instance properties (= 'static' properties on the class) as dynamic properties on the new instance for matched DynamicObj. Default is true
</span>
<br/>
</ul>
Expand All @@ -189,11 +201,34 @@ <h3>
<div class="fsdocs-source-link" title="Copy signature (XML)" onclick="Clipboard_CopyTo('<see cref=\'M:DynamicObj.CopyUtils.tryDeepCopyObj\'/>')">
<iconify-icon icon="bi:filetype-xml" height="24" width="24"></iconify-icon>
</div>
<a href="https://github.com/CSBiology/DynamicObj/tree/master/src/DynamicObj/DynamicObj.fs#L392-392" class="fsdocs-source-link" title="Source on GitHub">
<a href="https://github.com/CSBiology/DynamicObj/tree/master/src/DynamicObj/DynamicObj.fs#L432-432" class="fsdocs-source-link" title="Source on GitHub">
<iconify-icon icon="ri:github-fill" height="24" width="24"></iconify-icon>
</a>
<p class="fsdocs-summary">
internal helper function to deep copy a boxed object (if possible)

function to deep copy a boxed object (if possible)
The following cases are handled (in this precedence):

- Basic F# types (bool, byte, sbyte, int16, uint16, int, uint, int64, uint64, nativeint, unativeint, float, float32, char, string, unit, decimal)

- ResizeArrays and Dictionaries containing any combination of basic F# types

- Dictionaries containing DynamicObj as keys or values in any combination with DynamicObj or basic F# types as keys or values

- array<DynamicObj>, list<DynamicObj>, ResizeArray<DynamicObj>: These collections of DynamicObj are copied as a new collection with recursively deep copied elements.

- System.ICloneable: If the property implements ICloneable, the Clone() method is called on the property.

- DynamicObj (and derived classes): properties that are themselves DynamicObj instances are deep copied recursively.
if a derived class has static properties (e.g. instance properties), these will be copied as dynamic properties on the new instance.

Note on Classes that inherit from DynamicObj:

Classes that inherit from DynamicObj will match the `DynamicObj` typecheck if they do not implement ICloneable.
The deep copied instances will be cast to DynamicObj with static/instance properties AND dynamic properties all set as dynamic properties.
It should be possible to 'recover' the original type by checking if the needed properties exist as dynamic properties,
and then passing them to the class constructor if needed.

</p>
</div>
</summary>
Expand All @@ -205,7 +240,23 @@ <h3>
:
<code>obj</code>
</dt>
<dd class="fsdocs-param-docs"></dd>
<dd class="fsdocs-param-docs">
<p>
The object that should be deep copied
</p>
</dd>
<dt class="fsdocs-param">
<span class="fsdocs-param-name">
?includeInstanceProperties
</span>
:
<code>bool</code>
</dt>
<dd class="fsdocs-param-docs">
<p>
Whether to include instance properties (= 'static' properties on the class) as dynamic properties on the new instance for matched DynamicObj. Default is true
</p>
</dd>
</dl>
<dl class="fsdocs-returns">
<dt>
Expand Down
Loading

0 comments on commit f42440e

Please sign in to comment.