public override string ToString()
        {
            string colorCodes = "";

            for (int pairNo = 1; pairNo <= colorMapMinor.Length * colorMapMajor.Length; pairNo++)
            {
                ColorPair pair = NumToColor.GetColorFromPairNumber(pairNo);
                colorCodes += "Pair Num: " + pairNo + "  Colors: " + pair + "\n";
            }
            return(colorCodes);
        }
示例#2
0
        public override string ToString()
        {
            string manual = "";

            for (int i = 1; i < 26; i++)
            {
                ColorMap.ColorPair pair = NumToColor.GetColorFromPairNumber(i);
                manual += String.Format("Pair Number - {0}: Colors - {1} \n", i, pair.ToString());
            }

            return(manual);
        }
        private static void Main(string[] args)
        {
            int   pairNumber = 4;
            print manual     = new print();

            //Console.WriteLine(manual.ToString());
            ColorMap.ColorPair testPair1 = NumToColor.GetColorFromPairNumber(pairNumber);
            Console.WriteLine("[In]Pair Number: {0},[Out] Colors: {1}\n", pairNumber, testPair1);
            Debug.Assert(testPair1.majorColor == Color.White);
            Debug.Assert(testPair1.minorColor == Color.Brown);

            pairNumber = 5;
            testPair1  = NumToColor.GetColorFromPairNumber(pairNumber);
            Console.WriteLine("[In]Pair Number: {0},[Out] Colors: {1}\n", pairNumber, testPair1);
            Debug.Assert(testPair1.majorColor == Color.White);
            Debug.Assert(testPair1.minorColor == Color.SlateGray);

            pairNumber = 23;
            testPair1  = NumToColor.GetColorFromPairNumber(pairNumber);
            Console.WriteLine("[In]Pair Number: {0},[Out] Colors: {1}\n", pairNumber, testPair1);
            Debug.Assert(testPair1.majorColor == Color.Violet);
            Debug.Assert(testPair1.minorColor == Color.Green);

            ColorMap.ColorPair testPair2 = new ColorMap.ColorPair()
            {
                majorColor = Color.Yellow, minorColor = Color.Green
            };
            pairNumber = ColorToNum.GetPairNumberFromColor(testPair2);
            Console.WriteLine("[In]Colors: {0}, [Out] PairNumber: {1}\n", testPair2, pairNumber);
            Debug.Assert(pairNumber == 18);

            testPair2 = new ColorMap.ColorPair()
            {
                majorColor = Color.Red, minorColor = Color.Blue
            };
            pairNumber = ColorToNum.GetPairNumberFromColor(testPair2);
            Console.WriteLine("[In]Colors: {0}, [Out] PairNumber: {1}", testPair2, pairNumber);
            Debug.Assert(pairNumber == 6);
        }