Example #1
0
        private void SetSelection(string outcomeType)
        {
            switch (outcomeType)
            {
            case "1":
                BackgroundColor1 = BackgroundColor1.Equals(Selected) ? UnSelected : Selected; BackgroundColorX = UnSelected; BackgroundColor2 = UnSelected;
                break;

            case "x":
                BackgroundColorX = BackgroundColorX.Equals(Selected) ? UnSelected : Selected; BackgroundColor1 = UnSelected; BackgroundColor2 = UnSelected;
                break;

            case "2":
                BackgroundColor2 = BackgroundColor2.Equals(Selected) ? UnSelected : Selected; BackgroundColor1 = UnSelected; BackgroundColorX = UnSelected;
                break;
            }
        }
Example #2
0
        public int GetSettingsHashCode()
        {
            var hashes = new int[]
            { TextColor.GetHashCode(),
                OverrideTextColor.GetHashCode(),
                BackgroundColor.GetHashCode(),
                BackgroundColor2.GetHashCode(),
                GradientString.GetHashCode(),
                Display2Rows.GetHashCode(),
                ProbabilityText.GetHashCode(),
                Weight.GetHashCode(),
                CutoffTime.GetHashCode(),
                chkUsePb.Checked.GetHashCode(),
                dataGridSplits.Rows.GetHashCode() };

            // Rough hashing algorithm thanks to https://stackoverflow.com/questions/3404715/
            return(hashes.Aggregate(hashes.Length, (hash, element) => unchecked (314159 * hash + element)));
        }