Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>This functionality is built into <a href="http://nhforge.org/wikis/burrow/stateful-fields.aspx" rel="nofollow noreferrer">NHibernate Burrow</a>. If you don't happen to use NHibernate in your application, the source code for NHibernate Burrow is available <a href="http://sourceforge.net/projects/nhcontrib/files/NHibernate.Burrow/" rel="nofollow noreferrer">here</a>. Feel free to dig in, see how they did it, and rip out any parts that our useful to you (as long as you comply with the <a href="http://www.gnu.org/licenses/lgpl-2.1.html" rel="nofollow noreferrer">LGPL license</a>).</p> <p>The most relevant code seems to be in StatefulFieldProcessor.cs lines 51 - 72.</p> <pre><code> /// &lt;summary&gt; /// Get the FieldInfo - Attribute pairs that have the customer attribute of type &lt;typeparamref name="AT"/&gt; /// &lt;/summary&gt; /// &lt;typeparam name="AT"&gt;&lt;/typeparam&gt; /// &lt;returns&gt;&lt;/returns&gt; protected IDictionary&lt;FieldInfo, AT&gt; GetFieldInfo&lt;AT&gt;() where AT : Attribute { IDictionary&lt;FieldInfo, AT&gt; retVal = new Dictionary&lt;FieldInfo, AT&gt;(); foreach (FieldInfo fi in GetFields()) foreach (AT a in Attribute.GetCustomAttributes(fi, typeof (AT))) retVal.Add(fi, a); return retVal; } protected IDictionary&lt;FieldInfo, StatefulField&gt; GetStatefulFields() { IDictionary&lt;FieldInfo, StatefulField&gt; retVal; Type controlType = Control.GetType(); if (controlType.Assembly == webAssembly) return null; if (!fieldInfoCache.TryGetValue(controlType, out retVal)) fieldInfoCache[controlType] = retVal = GetFieldInfo&lt;StatefulField&gt;(); return retVal; } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload