private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e) { FootballHedge.Properties.Settings.Default.MailAllow = false; FootballHedge.Properties.Settings.Default.Save(); XMLData.SaveSettings(this); Environment.Exit(0); }
public void ClearAllData() { XMLData.DeleteFiles(); FootData.Clear(); LWData.Items.Clear(); ComboBoxEvents.Items.Clear(); ComboBoxEvents.Items.Add("All"); ComboBoxEvents.SelectedIndex = 0; SuspendedMatches.Clear(); }
public UpdateAltTeamNames(MainWindow MainF, string Team1, string Team2) { InitializeComponent(); this.MainF = MainF; TextBoxTeam1.Text = XMLData.ReturnAltTeamName(Team1); TextBoxTeam2.Text = XMLData.ReturnAltTeamName(Team2); LabelTeamName1.Text = Team1; LabelTeamName2.Text = Team2; }
private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e) { string Team1 = LabelTeamName1.Text; string Team2 = LabelTeamName2.Text; string RepPatter = FootballHedge.Properties.Settings.Default.RepPattern; foreach (FData item in MainF.FootData) { if (item.Team1 == Team1 && item.Team2 == Team2) { item.Match = Regex.Replace(TextBoxTeam1.Text + "|" + TextBoxTeam2.Text, RepPatter, "").ToUpper(); } } XMLData.UpdateAltTeamName(Team1, TextBoxTeam1.Text); XMLData.UpdateAltTeamName(Team2, TextBoxTeam2.Text); }
private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e) { XMLData.SaveSettings(MainF); FootballHedge.Properties.Settings.Default.Save(); if (LeaguesChange) { MainF.UpdateEventsInMainDataBase(); } MainF.UpdateControls(); IEditableCollectionView items = SelectedLeagues.Items; if (items.CanRemove) { items.Remove(SelectedLeagues.Items); } e.Cancel = false; }
public MainWindow() { InitializeComponent(); timer1.Interval = new TimeSpan(0, 0, 2); timer1.Tick += timer1_Tick; PD = new ParsedData(this); XMLData.LoadSettings(this); XMLData xd = new XMLData(); xd.Load(FootData, Bookmakers); UpdateControls(); WriteBreakToFile.ClearFile(); WriteDataTotable("All"); }
private void MenuItem_LoadSettings(object sender, RoutedEventArgs e) { XMLData.LoadSettings(this); }
private void MenuItem_Load(object sender, RoutedEventArgs e) { XMLData xd = new XMLData(); xd.Load(FootData, Bookmakers); }
private void MenuItem_Save(object sender, RoutedEventArgs e) { XMLData xd = new XMLData(); xd.Save(this, FootData); }
public void UpLay(List <FData> FootData, List <ParsedDataFromPage> PD, int id) { double MLimit = FootballHedge.Properties.Settings.Default.MailplLimit; foreach (ParsedDataFromPage item in PD) { int i; for (i = FootData.Count - 1; i >= 0; i--) { if (FootData[i].Team1 == item.Team1 && FootData[i].Team2 == item.Team2) { if (item.delete) { FootData.RemoveAt(i); } else { FootData[i].SizeX[0] = item.Size[0]; FootData[i].SizeX[1] = item.Size[1]; FootData[i].SizeX[2] = item.Size[2]; MainF.LastMatchbookUpdate(); foreach (KeyValuePair <int, X> it in FootData[i].XKoef) { if (MainF.Bookmakers[it.Key].Type != BrokerType.BACK) { continue; } for (int q = 0; q < 3; q++) { if (it.Value.Koef[q] >= MainF.Bookmakers[it.Key].Limit && FootData[i].Lay[q] > item.Lay[q]) { double p0 = CalcLayPL(it.Value.Koef[q], item.Lay[q]); if (p0 >= 1 && MainF.Bookmakers[it.Key].InUse) { WriteBreakToFile.LogSave("Lay " + MainF.Bookmakers[it.Key].Name + " | " + item.Team1 + "-" + item.Team2 + " [" + q.ToString() + "] " + FootData[i].Lay[q].ToString() + " -> " + item.Lay[q].ToString()); changecolor = true; } if (p0 >= MLimit && p0 >= MainF.Bookmakers[it.Key].PLlimit && MainF.Bookmakers[it.Key].EMailing) { StringBuilder selection = new StringBuilder(); switch (q) { case 0: selection.Append("Draw"); break; case 1: selection.Append(item.Team1); break; case 2: selection.Append(item.Team2); break; default: selection.Append("uknown"); break; } PrepareMessage(item.Team1 + "-" + item.Team2, selection.ToString(), it.Value.Koef[q], item.Lay[q], MainF.Bookmakers[it.Key].Name, it.Value.LastUpdate, FootData[i].time); } } } } FootData[i].XKoef[id].Koef[0] = item.X[0]; FootData[i].XKoef[id].Koef[1] = item.X[1]; FootData[i].XKoef[id].Koef[2] = item.X[2]; FootData[i].Lay[0] = item.Lay[0]; FootData[i].Lay[1] = item.Lay[1]; FootData[i].Lay[2] = item.Lay[2]; } break; } } if (i < 0) { if (item.delete) { continue; } if (MainF.SuspendedMatches.Count > 0 && MainF.SuspendedMatches.FindIndex(str => str == item.Team1 + " - " + item.Team2) != -1) { continue; } string RepPatter = FootballHedge.Properties.Settings.Default.RepPattern; DateTime dt = DateTime.Parse(item.time, System.Globalization.CultureInfo.CurrentCulture); FData NI = new FData(id); NI.Team1 = item.Team1; NI.Team2 = item.Team2; NI.Match = Regex.Replace(XMLData.ReturnAltTeamName(item.Team1) + "|" + XMLData.ReturnAltTeamName(item.Team2), RepPatter, "").ToUpper(); NI.League = item.League; NI.SizeX = item.Size; //NI.Koef[id, 0] = item.X[0]; //NI.Koef[id, 1] = item.X[1]; //NI.Koef[id, 2] = item.X[2]; NI.XKoef[id].Koef[0] = item.X[0]; NI.XKoef[id].Koef[1] = item.X[1]; NI.XKoef[id].Koef[2] = item.X[2]; NI.Lay[0] = item.Lay[0]; NI.Lay[1] = item.Lay[1]; NI.Lay[2] = item.Lay[2]; NI.time = dt; FootData.Add(NI); MainF.LastMatchbookUpdate(); if (item.League != null) { MainF.CheckAndUpdateEventsCombobox(item.League); } } } }