public void Method(Team team) { IFootball method = GetTeam(team); method.Name = team.ToString(); method.Champion(team, "s"); }
public CountryViewModel() { repository = new Football(); LoadCommands(); LoadTimers(); Messenger.Default.Register <string>(this, FinishedProcessing); }
public void Invoke(IFootball serv) { Console.WriteLine("Add name of stadium: "); var name = Validator.validator_name(Console.ReadLine()); serv.Add(name); }
public void Invoke(IFootball ser) { Console.Write("Add day of the game: "); var day = Validator.validator_day(Console.ReadLine()); ser.AddDayofGame(Convert.ToInt32(day)); }
public void Invoke(IFootball ser) { Console.Write("(Count of place < 100) Add count of place: "); var place = Validator.validator_countplace(Console.ReadLine()); ser.AddCountOfPlace(Convert.ToInt32(place)); }
private void FormObjectFields_FormClosed(object sender, FormClosedEventArgs e) { if ((WhatMainAction == WhatMainAction.Add) && ((_whatLocalAction == WhatLocalAction.Cansel) || (_whatLocalAction == WhatLocalAction.Close))) { IFootball removeobject = Control.CurrObject; Control.CurrObject.Remove(ref removeobject); } int i = 0; while (i < this.Controls.Count) { if (this.Controls[i] is TextBox textBox) { this.Controls.Remove(textBox); } else if (this.Controls[i] is Label label) { this.Controls.Remove(label); } else if (this.Controls[i] is ComboBox comboBox) { this.Controls.Remove(comboBox); } else { i++; } } }
public void Invoke(IFootball ser) { Console.WriteLine("Price < 100"); Console.Write("Add price of ticket: "); var rpice = Validator.validator_priceofTicket(Console.ReadLine()); ser.AddPriceofTicket(Convert.ToDouble(rpice)); }
public new void Remove(ref IFootball footballPlayer) { if (_footballTeam != null) { _footballTeam.RemoveFootballPlayer((FootballPlayer)footballPlayer); } footballPlayer = null; }
private void ButtonDelete_Click(object sender, EventArgs e) { if (listBox.SelectedItem != null) { IFootball footballObject = listBox.SelectedItem as IFootball; Control.RemoveObject(footballObject); listBox.Items.Remove(listBox.SelectedItem); } }
public void Invoke(IFootball ser) { Console.WriteLine("Write name of a stadium"); foreach (var a in ser.SearchFootballStadia(Console.ReadLine())) { Console.WriteLine(a); } Console.ReadKey(); }
public void Invoke(IFootball ser) { Console.WriteLine("Change name: "); int index = Menu.IndexFootball(); Console.WriteLine("Add new name of stadium: "); var name = Validator.validator_name(Console.ReadLine()); ser.Change(name, index); }
public TeamViewModel() { Messenger.Default.Register <string>(this, TeamSelected); repository = new Football(); GameEnteredCommand = new RelayCommand(GameEntered); LiveClickedCommand = new RelayCommand(LiveClicked); MatchClickedCommand = new RelayCommand(MatchClicked); MatchSelectedCommand = new RelayCommand(MatchSelected); FixtureSelectedCommand = new RelayCommand(FixtureSelected); }
public void Invoke(IFootball ser) { Console.WriteLine("Change day of game"); int index = Menu.IndexFootball(); Console.WriteLine("Add new time of game"); var data = Validator.validator_day(Console.ReadLine()); ser.ChangeDayofGame(Convert.ToInt32(data), index); }
public void Invoke(IFootball ser) { Console.WriteLine("(Count of place < 100) Change count of place"); int ind = Menu.IndexFootball(); Console.Write("New count of place: "); var place = Validator.validator_countplace(Console.ReadLine()); ser.ChangeCountofPlace(ind, Convert.ToInt32(place)); }
public void Invoke(IFootball ser) { Console.WriteLine("Price < 100"); Console.WriteLine("Change price if ticket"); int ind = Menu.IndexFootball(); Console.Write("New price: "); var price = Validator.validator_priceofTicket(Console.ReadLine()); ser.ChangePriceofTicket(ind, Convert.ToDouble(price)); }
public MatchEntity(MatchInput input) { _status.Round = -1; _status.Minute = -1; //_status.TotalRound = Convert.ToInt32(input.TranTime / Defines.Match.ROUND_TIME); _status.TotalRound = 2 * Convert.ToInt32(input.TranTime / Defines.Match.ROUND_TIME); input.HomeManager.BalanceProp(); input.AwayManager.BalanceProp(); this._input = input; this._football = new Football(this); this._homeManager = new Manager(input.HomeManager, this, Side.Home); this._awayManager = new Manager(input.AwayManager, this, Side.Away); this._openSide = this.RandomBool() ? Side.Home : Side.Away; this._report = new MatchReport(input); }
public void CreateFormFields(FormObjectFields form, Control control) { const int LabelWidth = 100; const int LabelMarginLeft = 0; const int TextBoxAndComboBoxWidth = 140; const int TextBoxAndComboBoxMarginLeft = 100; const int MarginStep = 30; const int FormMarginTop = 70; int marginTop = 0; IFootball currObject = control.CurrObject; foreach (var property in currObject.GetType().GetProperties()) { string propertyName = GetFieldName(property); Type propertyType = property.PropertyType; form.Controls.Add(CreateLabel(propertyName, LabelWidth, LabelMarginLeft, marginTop)); if ((propertyType == typeof(string)) || (propertyType == typeof(int))) { TextBox textBox = CreateTextBox(propertyName, TextBoxAndComboBoxWidth, TextBoxAndComboBoxMarginLeft, marginTop); if (propertyType == typeof(string)) { textBox.Text = (string)property.GetValue(currObject) ?? ""; } else { textBox.Text = (int)property.GetValue(currObject) != 0 ? property.GetValue(currObject).ToString() : ""; } form.Controls.Add(textBox); } else if (propertyType.IsEnum) { ComboBox comboBox = CreateComboBox(propertyName, TextBoxAndComboBoxWidth, TextBoxAndComboBoxMarginLeft, marginTop); comboBox.Items.Add(""); foreach (var enumName in GetEnumNames(property.PropertyType)) { comboBox.Items.Add(enumName); } comboBox.SelectedIndex = (int)property.GetValue(currObject); form.Controls.Add(comboBox); } else if (propertyType.IsClass) { if (propertyType.IsGenericType) { ComboBox comboBox = CreateComboBox(propertyName, TextBoxAndComboBoxWidth, TextBoxAndComboBoxMarginLeft, marginTop); var listObjects = property.GetValue(currObject) as IList; foreach (var football in listObjects) { comboBox.Items.Add(football); } form.Controls.Add(comboBox); } else { bool genericParameter = IsGenericParameter(property.PropertyType, currObject.GetType()); if (genericParameter) { ComboBox comboBox = CreateComboBox(propertyName, TextBoxAndComboBoxWidth, TextBoxAndComboBoxMarginLeft, marginTop); foreach (var applicationObject in control.ApplicationObjects) { if (applicationObject.GetType() == property.PropertyType) { comboBox.Items.Add(applicationObject); } } comboBox.SelectedItem = property.GetValue(currObject); form.Controls.Add(comboBox); } else { Button buttonComposition = form.Controls["buttonComposition"] as Button; buttonComposition.Location = new Point(buttonComposition.Location.X, marginTop); buttonComposition.Visible = true; control.CompositionObject = property.GetValue(currObject); } } } marginTop += MarginStep; } Button buttonOk = form.Controls["ButtonOk"] as Button; Button buttonCansel = form.Controls["ButtonCancel"] as Button; buttonOk.Location = new Point(buttonOk.Location.X, marginTop); buttonCansel.Location = new Point(buttonCansel.Location.X, marginTop); form.Height = marginTop + FormMarginTop; }
public void Remove(ref IFootball footballTeam) { footballTeam = null; }
public void Invoke(IFootball ser) { Console.WriteLine("Delete stadium:"); ser.Delete(Menu.IndexFootball()); }
public void AddObject(IFootball footballObject) { Control.AddObject(footballObject); listBox.Items.Add(footballObject); listBox.SelectedItem = footballObject; }
public StandingsViewModel() { repository = new Football(); TeamClickedCommand = new RelayCommand(TeamClicked); LoadStandings(); }
public void Remove(ref IFootball obj) { obj = null; }