Пример #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
        public static Settings GetDefault()
        {
            Settings settings = new Settings()
            {
                Version       = Settings.CurrentVersion,
                MainFilters   = SportFilter.GetAllSportFilters(),
                BreackedSport = BreackedFilter.GetAllBreackedFilters(),
                UserSettings  = new UserSettings()
            };

            settings.UserSettings.IsCheckAuth              = false;
            settings.UserSettings.IsMusic                  = false;
            settings.UserSettings.IsDoubleButton           = true;
            settings.UserSettings.IsSetPause               = false;
            settings.UserSettings.IsCheckBalance           = true;
            settings.UserSettings.IsUseAnimation           = true;
            settings.UserSettings.RoundForas               = true;
            settings.UserSettings.RoundTotals              = true;
            settings.UserSettings.RoundITotals             = true;
            settings.UserSettings.IsAsianForas             = true;
            settings.UserSettings.IsAsianTotals            = true;
            settings.UserSettings.UseMemoryChache          = true;
            settings.UserSettings.IsDoubleClickOpenForks   = true;
            settings.UserSettings.IsFullStyleCalc          = true;
            settings.UserSettings.IsRowsBrowserTemplate    = true;
            settings.UserSettings.IsHighlightingNewForks   = true;
            settings.UserSettings.IsSendDnt                = true;
            settings.UserSettings.IsLoadImage              = true;
            settings.UserSettings.IsFakeBrowserWindowsSize = true;
            settings.UserSettings.ChromeLanguage           = EChromeLanguage.Ru;
            settings.UserSettings.NewListForksFilterType   = ENewListForksFilter.Default;
            settings.UserSettings.SoundFile                = "sound01.wav";
            settings.UserSettings.SoundVolume              = 0.5;
            settings.UserSettings.CurrencyItems            = CurrencyItem.GetAllCurrencies().Values.ToList <CurrencyItem>();
            settings.UserSettings.BookmakersList           = new List <Bookmaker>();
            settings.UserSettings.BookmakersList           = AllBookmakersHelper.GetAllBookmakers();
            settings.UserSettings.FakeProfile              = new FakeProfileFactory().Generate();
            settings.UserSettings.UserHotKeys              = UserHotKeys.Default;
            settings.UserSettings.IniciatorMax             = 1000;
            settings.UserSettings.IniciatorMin             = 0;
            settings.UserSettings.CalcOptically            = 0.2;
            SettingVersionUpdater.SetBookmakersGroup(settings);
            settings.UserSettings.IsUseWebGl       = true;
            settings.UserSettings.IsBlockedScripts = true;
            return(settings);
        }
Пример #4
0
        public static void GroupCurrentBookmakers()
        {
            List <Bookmaker> allBookmakers = AllBookmakersHelper.GetAllBookmakers();
            Dictionary <EBookmakers, List <EBookmakers> > source = new Dictionary <EBookmakers, List <EBookmakers> >();
            MirrorsGroupsManager mirrorsGroupsManager            = new MirrorsGroupsManager();

            foreach (Bookmaker bookmaker in allBookmakers)
            {
                EBookmakers bookmakerGroup = mirrorsGroupsManager.GetBookmakerGroup(bookmaker.EBookmaker);
                if (bookmakerGroup == EBookmakers._None)
                {
                    throw new ArgumentException("");
                }
                if (!source.ContainsKey(bookmakerGroup))
                {
                    source.Add(bookmakerGroup, new List <EBookmakers>());
                }
                source[bookmakerGroup].Add(bookmaker.EBookmaker);
            }
            source.Where <KeyValuePair <EBookmakers, List <EBookmakers> > >((Func <KeyValuePair <EBookmakers, List <EBookmakers> >, bool>)(x => x.Value.Count > 1)).Select <KeyValuePair <EBookmakers, List <EBookmakers> >, KeyValuePair <EBookmakers, List <EBookmakers> > >((Func <KeyValuePair <EBookmakers, List <EBookmakers> >, KeyValuePair <EBookmakers, List <EBookmakers> > >)(x => x)).ToDictionary <KeyValuePair <EBookmakers, List <EBookmakers> >, EBookmakers, List <EBookmakers> >((Func <KeyValuePair <EBookmakers, List <EBookmakers> >, EBookmakers>)(x => x.Key), (Func <KeyValuePair <EBookmakers, List <EBookmakers> >, List <EBookmakers> >)(x => x.Value));
        }
Пример #5
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("Додеделать как понадобиться");
            }
        }
Пример #6
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);
        }
Пример #7
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);
        }