예제 #1
0
        private void Engine_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            try
            {
                Markets.Clear();
                foreach (var item in new MarketsRequest(Engine.Value).Response.Markets.Data.Select(d =>
                                                                                                   new Item
                {
                    Name = d["title"],
                    Value = d["NAME"],
                    Data = d
                }
                                                                                                   ))
                {
                    Markets.Add(item);
                }

                Securities.Clear();
                Boards.Clear();

                Info    = "";
                History = new List <HistoryObject>();
                FirePropertyChanged(nameof(Info));
                FirePropertyChanged(nameof(History));
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error");
            }
        }
예제 #2
0
    public void AddMarket(Resource resource)
    {
        Market market = new Market(resource);

        Markets.Add(resource.Type, market);
        market.AssignTown(this);

        AddResource(resource);
    }
 public new void AddMarket(ResourceUtil.ResourceType type, Market market)
 {
     Markets.Add(type, market);
 }