/// <summary>
 /// Returns the current object hash code
 /// </summary>
 /// <returns>Hash code</returns>
 public override int GetHashCode()
 {
     return(
         base.GetHashCode() +
         BackgroundColor.GetHashCode() +
         ForegroundColor.GetHashCode() +
         Character.GetHashCode()
         );
 }
Exemple #2
0
        public override int GetHashCode()
        {
            var hashCode = -1388644900;

            hashCode = hashCode * -1521134295 + color.GetHashCode();
            hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(name);

            hashCode = hashCode * -1521134295 + supply.GetHashCode();
            return(hashCode);
        }
Exemple #3
0
        public override int GetHashCode()
        {
            var hashCode = -2243911;

            hashCode = hashCode * -1521134295 + base.GetHashCode();
            hashCode = hashCode * -1521134295 + character.GetHashCode();
            hashCode = hashCode * -1521134295 + fore.GetHashCode();
            hashCode = hashCode * -1521134295 + back.GetHashCode();
            return(hashCode);
        }
Exemple #4
0
        static void Main(string[] args)
        {
            ConsoleColor bgColor = Console.BackgroundColor;
            ConsoleColor fgColor = Console.ForegroundColor;

            string bgColorCode = ToHex(bgColor.GetHashCode());
            string fgColorCode = ToHex(fgColor.GetHashCode());

            Console.WriteLine(
                String.Format("0x{0}:{1}:{2}", bgColorCode + fgColorCode, bgColor, fgColor)
                );
        }
Exemple #5
0
        public override int GetHashCode()
        {
            var hashCode = 1164796431;

            hashCode = hashCode * -1521134295 + _foreground.GetHashCode();
            hashCode = hashCode * -1521134295 + _background.GetHashCode();
            hashCode = hashCode * -1521134295 + _character.GetHashCode();
            hashCode = hashCode * -1521134295 + _hasForeground.GetHashCode();
            hashCode = hashCode * -1521134295 + _hasBackground.GetHashCode();
            hashCode = hashCode * -1521134295 + _hasCharacter.GetHashCode();
            hashCode = hashCode * -1521134295 + isChanged.GetHashCode();
            return(hashCode);
        }
        static void Main(string[] args)
        {
            //Console.BackgroundColor = ConsoleColor.Red;

            ConsoleColor myFavoriteColor = ConsoleColor.White;

            Method(myFavoriteColor);

            Method(ConsoleColor.Magenta);

            Settings settings = new Settings();

            settings.Color = ConsoleColor.Cyan;


            Console.WriteLine(myFavoriteColor);
            Console.WriteLine(ConsoleColor.Blue);

            Console.WriteLine(myFavoriteColor.GetHashCode());

            int number = 9;

            myFavoriteColor = (ConsoleColor)number;


            string[] listOfAllThePossibleColors = Enum.GetNames(typeof(ConsoleColor));

            Console.WriteLine("**************");
            for (int i = 0; i < listOfAllThePossibleColors.Length; i++)
            {
                Console.WriteLine(listOfAllThePossibleColors[i]);
            }

            ConsoleColor anotherVariable = (ConsoleColor)Enum.Parse(typeof(ConsoleColor), "Cyan");

            PhoneticAlphabet letter = PhoneticAlphabet.Alfa;

            number = 2;

            letter = (PhoneticAlphabet)number;

            PhoneticAlphabet secondLetter = PhoneticAlphabet.Charlie;

            if (letter == PhoneticAlphabet.Alfa)
            {
            }

            Console.WriteLine(letter);
            Console.ReadLine();
        }
Exemple #7
0
 public override int GetHashCode()
 {
     return(790427672 + color.GetHashCode());
 }
Exemple #8
0
 public override int GetHashCode()
 {
     return(Char.GetHashCode()
            ^ ForegroundColor.GetHashCode()
            ^ BackGroundColor.GetHashCode());
 }
Exemple #9
0
 public override int GetHashCode()
 {
     return(Background.GetHashCode() ^ Foreground.GetHashCode() ^ Char.GetHashCode());
 }