Exemplo n.º 1
0
        // Keep this as a separate function so inheritors can call it in their ctors

        protected void Calculate(ICollection coll, IBuildContext ctxt, Fingerprint cached)
        {
            CompositeFingerprint cf = cached as CompositeFingerprint;

            children = new Fingerprint[coll.Count];
            int i = 0;

            if (cf != null && cf.children.Length == coll.Count)
            {
                foreach (IFingerprintable item in coll)
                {
                    children[i] = GenericFingerprints.GetFingerprint(item, ctxt,
                                                                     cf.children[i]);
                    i++;
                }
            }
            else
            {
                foreach (IFingerprintable item in coll)
                {
                    children[i] = GenericFingerprints.GetFingerprint(item, ctxt, null);
                    i++;
                }
            }

            value = Calculate(children);
        }
Exemplo n.º 2
0
        protected override void CloneTo(Result r)
        {
            base.CloneTo(r);

            CompositeFingerprint fp = (CompositeFingerprint)r;

            fp.children = (Fingerprint[])children.Clone();
        }