Ejemplo n.º 1
0
        public override int GetHashCode()
        {
            int hashCode = -437011463;

            hashCode = hashCode * -1521134295 + Id.GetHashCode();
            hashCode = hashCode * -1521134295 + LabBookId.GetHashCode();
            hashCode = hashCode * -1521134295 + Contrast75.GetHashCode();
            hashCode = hashCode * -1521134295 + Tw75.GetHashCode();
            hashCode = hashCode * -1521134295 + Sp75.GetHashCode();
            hashCode = hashCode * -1521134295 + Contrast100.GetHashCode();
            hashCode = hashCode * -1521134295 + Tw100.GetHashCode();
            hashCode = hashCode * -1521134295 + Sp100.GetHashCode();
            hashCode = hashCode * -1521134295 + Contrast150.GetHashCode();
            hashCode = hashCode * -1521134295 + Tw150.GetHashCode();
            hashCode = hashCode * -1521134295 + Sp150.GetHashCode();
            hashCode = hashCode * -1521134295 + Contrast240.GetHashCode();
            hashCode = hashCode * -1521134295 + Tw240.GetHashCode();
            hashCode = hashCode * -1521134295 + Sp240.GetHashCode();
            hashCode = hashCode * -1521134295 + OtherA.GetHashCode();
            hashCode = hashCode * -1521134295 + OtherAtype.GetHashCode();
            hashCode = hashCode * -1521134295 + OtherB.GetHashCode();
            hashCode = hashCode * -1521134295 + OtherBtype.GetHashCode();
            hashCode = hashCode * -1521134295 + ContrastClass.GetHashCode();
            hashCode = hashCode * -1521134295 + ContrastYield.GetHashCode();
            hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(Comment);

            hashCode = hashCode * -1521134295 + Created.GetHashCode();
            hashCode = hashCode * -1521134295 + Updated.GetHashCode();
            return(hashCode);
        }
Ejemplo n.º 2
0
    /// <summary>
    /// Updates the values of the two other sliders.
    /// </summary>
    public void Sync()
    {
        //skip heavy calculations if no change was made
        if (slider.value != Latest)
        {
            Latest = slider.value;
        }
        else
        {
            return;
        }

        //avoid division by zero and split it evenly instead
        if (OtherA.Get() == 0 && OtherB.Get() == 0)
        {
            OtherA.Set((1 - Latest) / 2f);
            OtherB.Set((1 - Latest) / 2f);
        }
        else
        {
            //scale the new luma of each column proportionally the current values
            float multiplier = (1 - Latest) / (OtherA.Get() + OtherB.Get());
            OtherA.Set(OtherA.Get() * multiplier);
            OtherB.Set(OtherB.Get() * multiplier);
        }
    }