Пример #1
0
        private static void EnabledAutoBookmaker(EBookmakers bookmaker, Settings settings)
        {
            Dictionary <EBookmakers, Bookmaker> dictionary = settings.UserSettings.BookmakersList.ToDictionary <Bookmaker, EBookmakers, Bookmaker>((Func <Bookmaker, EBookmakers>)(x => x.EBookmaker), (Func <Bookmaker, Bookmaker>)(x => x));

            if (!dictionary.ContainsKey(bookmaker))
            {
                Bookmaker bookmaker1 = AllBookmakersHelper.GetBookmaker(bookmaker);
                settings.UserSettings.BookmakersList.Add(bookmaker1);
            }
            else
            {
                dictionary[bookmaker].IsSupportAutomat = true;
            }
        }
Пример #2
0
        private static void UpdateCurrency(
            EBookmakers bookmaker,
            Settings settings,
            ECurrency newCurrency)
        {
            Dictionary <EBookmakers, Bookmaker> dictionary = settings.UserSettings.BookmakersList.ToDictionary <Bookmaker, EBookmakers, Bookmaker>((Func <Bookmaker, EBookmakers>)(x => x.EBookmaker), (Func <Bookmaker, Bookmaker>)(x => x));

            if (!dictionary.ContainsKey(bookmaker))
            {
                Bookmaker bookmaker1 = AllBookmakersHelper.GetBookmaker(bookmaker);
                settings.UserSettings.BookmakersList.Add(bookmaker1);
            }
            else
            {
                dictionary[bookmaker].CurrentCurrency = newCurrency;
            }
        }
Пример #3
0
        private static void UpdateBookmaker(EBookmakers bookmaker, Settings settings)
        {
            Dictionary <EBookmakers, Bookmaker> dictionary = settings.UserSettings.BookmakersList.ToDictionary <Bookmaker, EBookmakers, Bookmaker>((Func <Bookmaker, EBookmakers>)(x => x.EBookmaker), (Func <Bookmaker, Bookmaker>)(x => x));
            Bookmaker bookmaker1 = AllBookmakersHelper.GetBookmaker(bookmaker);

            if (!dictionary.ContainsKey(bookmaker))
            {
                if (bookmaker1 == null)
                {
                    return;
                }
                settings.UserSettings.BookmakersList.Add(bookmaker1);
            }
            else if (bookmaker1 != null)
            {
                Bookmaker bookmaker2 = dictionary[bookmaker];
                bookmaker1.Login        = bookmaker2.Login;
                bookmaker1.Password     = bookmaker2.Password;
                bookmaker1.Url          = bookmaker2.Url;
                bookmaker1.Proxy        = bookmaker2.Proxy;
                bookmaker1.SportFilters = bookmaker2.SportFilters;
                throw new NotImplementedException("Додеделать как понадобиться");
            }
        }
Пример #4
0
        private static void AddNewBookmaker(EBookmakers bookmaker, Settings settings)
        {
            if (settings.UserSettings.BookmakersList.ToDictionary <Bookmaker, EBookmakers, Bookmaker>((Func <Bookmaker, EBookmakers>)(x => x.EBookmaker), (Func <Bookmaker, Bookmaker>)(x => x)).ContainsKey(bookmaker))
            {
                return;
            }
            Bookmaker bookmaker1 = AllBookmakersHelper.GetBookmaker(bookmaker);

            if (bookmaker1 == null)
            {
                return;
            }
            if (bookmaker == EBookmakers._bet365)
            {
                Bookmaker bookmaker2 = settings.UserSettings.BookmakersList.FirstOrDefault <Bookmaker>((Func <Bookmaker, bool>)(x => x.EBookmaker == EBookmakers._bet365Mobile));
                if (bookmaker2 != null)
                {
                    int num = settings.UserSettings.BookmakersList.IndexOf(bookmaker2);
                    settings.UserSettings.BookmakersList.Insert(num + 1, bookmaker1);
                    return;
                }
            }
            settings.UserSettings.BookmakersList.Add(bookmaker1);
        }
Пример #5
0
        public static IList <KeyValuePair <string, string> > SettingConverterToBookmaker(
            [NotNull] Settings setting)
        {
            MirrorsGroupsManager mirrorsGroupsManager = new MirrorsGroupsManager();
            DublicateList        result = new DublicateList();
            Dictionary <EBookmakers, Bookmaker> dictionary = setting.UserSettings.BookmakersList.ToDictionary <Bookmaker, EBookmakers, Bookmaker>((Func <Bookmaker, EBookmakers>)(x => x.EBookmaker), (Func <Bookmaker, Bookmaker>)(x => x));

            foreach (EBookmakers index1 in mirrorsGroupsManager.AllBookmakers.ToList <EBookmakers>())
            {
                if (dictionary.ContainsKey(index1) || mirrorsGroupsManager.IsPositiveBetRuMirror(index1))
                {
                    EBookmakers index2 = index1;
                    if (mirrorsGroupsManager.IsPositiveBetRuMirror(index1))
                    {
                        try
                        {
                            index2 = mirrorsGroupsManager.OffshoreMirrors[index1];
                        }
                        catch (Exception ex)
                        {
                            Console.WriteLine((object)ex);
                            throw;
                        }
                    }
                    Bookmaker bookmaker;
                    try
                    {
                        if (!dictionary.ContainsKey(index2))
                        {
                            dictionary.Add(index2, AllBookmakersHelper.GetBookmaker(index2));
                            setting.UserSettings.BookmakersList.Add(AllBookmakersHelper.GetBookmaker(index2));
                        }
                        bookmaker = dictionary[index2];
                    }
                    catch
                    {
                        dictionary.Add(index2, AllBookmakersHelper.GetBookmaker(index2));
                        throw;
                    }
                    string empty = string.Empty;
                    if (bookmaker.CommissionCoef > Decimal.Zero && bookmaker.CommissionCoef < new Decimal(100))
                    {
                        empty = bookmaker.CommissionCoef.ToString((IFormatProvider)CultureInfo.InvariantCulture);
                    }
                    result[string.Format("Booker[{0}][commission]", (object)(int)index1)]      = empty;
                    result[string.Format("Booker[{0}][currency_id]", (object)(int)index1)]     = "1";
                    result[string.Format("Booker[{0}][max_bet]", (object)(int)index1)]         = "";
                    result[string.Format("Booker[{0}][round_precision]", (object)(int)index1)] = "1";
                    result[string.Format("Booker[{0}][url]", (object)(int)index1)]             = "";
                }
                else
                {
                    result[string.Format("Booker[{0}][commission]", (object)(int)index1)]      = "";
                    result[string.Format("Booker[{0}][currency_id]", (object)(int)index1)]     = "1";
                    result[string.Format("Booker[{0}][max_bet]", (object)(int)index1)]         = "";
                    result[string.Format("Booker[{0}][round_precision]", (object)(int)index1)] = "1";
                    result[string.Format("Booker[{0}][url]", (object)(int)index1)]             = "";
                }
            }
            SettingsHelper.SetMirrorGroup(result, setting);
            result["Options[hide_links]"]      = "0";
            result["Options[round_precision]"] = "3";
            result["Options[sort_field]"]      = "1";
            return((IList <KeyValuePair <string, string> >)result);
        }