Example #1
0
        static void Main(string[] args)
        {
            string[]   FieldsConst = new string[] { FIELD1, FIELD2, FIELD3, FIELD4, FIELD5, FIELD6, FIELD7, FIELD8, FIELD9 };
            RateInfo[] newRates    = new RateInfo[]
            {
                new RateInfo {
                    Value = 1
                },
                new RateInfo {
                    Value = 2
                },
                new RateInfo {
                    Value = 3
                },
                new RateInfo {
                    Value = 4
                },
                new RateInfo {
                    Value = 5
                },
                new RateInfo {
                    Value = 6
                },
                new RateInfo {
                    Value = 7
                },
                new RateInfo {
                    Value = 8
                },
                new RateInfo {
                    Value = 9
                }
            };

            Swap                    us           = new Swap();
            SetPropertyValue        setSwapValue = new SetPropertyValue(SetFieldValue);
            GetPropertyValue <Swap> getSwapValue = new GetPropertyValue <Swap>(GetFieldValue);

            using (us.GetContext(State.Default))
            {
                SetToDefault(us);
            }

            List <RateInfo> rateInfos = GetOriginalRateInfos(us);
            List <Dictionary <FieldName, RateInfo> > productsCombination = new List <Dictionary <FieldName, RateInfo> >();

            GetCombination(us, rateInfos, ref productsCombination);

            foreach (var combination in productsCombination)
            {
                foreach (var item in combination)
                {
                    Console.Write($"{item.Key} " + $"{item.Value.Value}, ");
                }
                Console.WriteLine();
            }

            // Myślę że trzeba tu tylko jeszcze wrzucić wartości do jakichś słowników i będzie to co trzeba.
            // Tylko
            GetAllCombinations(us, FieldsConst, newRates);
        }