public KartaLokace(PPLCG.DataLokace data) : base(data) { Karta = data; ViewLokace vk = new ViewLokace(); vk.Init(data); sp.Children.Add(vk); }
public void Init(PPLCG.DataLokace data) { base.Init(data); boxStin.ListControl.Init(data.Stin); Binding myBinding = new Binding("Zivoty"); myBinding.Source = data; myBinding.Mode = BindingMode.TwoWay; boxZivoty.TextBox.SetBinding(TextBox.TextProperty, myBinding); myBinding = new Binding("Utok"); myBinding.Source = data; myBinding.Mode = BindingMode.TwoWay; boxUtok.TextBox.SetBinding(TextBox.TextProperty, myBinding); myBinding = new Binding("Obrana"); myBinding.Source = data; myBinding.Mode = BindingMode.TwoWay; boxObrana.TextBox.SetBinding(TextBox.TextProperty, myBinding); myBinding = new Binding("Ohrozeni"); myBinding.Source = data; myBinding.Mode = BindingMode.TwoWay; boxOhrozeni.TextBox.SetBinding(TextBox.TextProperty, myBinding); myBinding = new Binding("Stretnuti"); myBinding.Source = data; myBinding.Mode = BindingMode.TwoWay; boxStretnuti.TextBox.SetBinding(TextBox.TextProperty, myBinding); myBinding = new Binding("Teren"); myBinding.Source = data; myBinding.Mode = BindingMode.TwoWay; boxTeren.TextBox.SetBinding(TextBox.TextProperty, myBinding); }
private void LoadKarty(string cesta) { if (!Directory.Exists(cesta)) { return; } string[] data = Directory.GetFiles(cesta); Karty.Clear(); foreach (string s in data) { if (s.Contains(".pk")) { //FileStream f = File.Create(s); Nini.Config.IniConfigSource source = new Nini.Config.IniConfigSource(s); PPLCG.DataKarta dataKarta = new PPLCG.DataKarta(); AKarta k = null; Nini.Config.IConfig config = source.Configs["Karta"]; if (config != null) { dataKarta.Load(config); } switch (dataKarta.Typ) { case PPLCG.ETypy.Doplnek: PPLCG.DataDoplnek dd = new PPLCG.DataDoplnek(); dd.Load(config); k = new KartaDoplnek(dd); break; case PPLCG.ETypy.Hrdina: PPLCG.DataHrdina dh = new PPLCG.DataHrdina(); dh.Load(config); k = new KartaHrdina(dh); break; case PPLCG.ETypy.Lokace: PPLCG.DataLokace dl = new PPLCG.DataLokace(); dl.Load(config); k = new KartaLokace(dl); break; case PPLCG.ETypy.Nepritel: PPLCG.DataNepritel dn = new PPLCG.DataNepritel(); dn.Load(config); k = new KartaNepritel(dn); break; case PPLCG.ETypy.Spojenec: PPLCG.DataSpojenec ds = new PPLCG.DataSpojenec(); ds.Load(config); k = new KartaSpojenec(ds); break; case PPLCG.ETypy.Udalost: PPLCG.DataUdalost du = new PPLCG.DataUdalost(); du.Load(config); k = new KartaUdalost(du); break; case PPLCG.ETypy.Zrada: PPLCG.DataZrada dz = new PPLCG.DataZrada(); dz.Load(config); k = new KartaZrada(dz); break; } if (k != null) { Karty.Add(k); listBox1.Items.Add(k.Karta.Id); } } } }
private void LoadKarty(string cesta) { if (!Directory.Exists(cesta)) return; string[] data = Directory.GetFiles(cesta); Karty.Clear(); foreach (string s in data) { if (s.Contains(".pk")) { //FileStream f = File.Create(s); Nini.Config.IniConfigSource source = new Nini.Config.IniConfigSource(s); PPLCG.DataKarta dataKarta = new PPLCG.DataKarta(); AKarta k = null; Nini.Config.IConfig config = source.Configs["Karta"]; if(config!=null) dataKarta.Load(config); switch(dataKarta.Typ) { case PPLCG.ETypy.Doplnek: PPLCG.DataDoplnek dd = new PPLCG.DataDoplnek(); dd.Load(config); k = new KartaDoplnek(dd); break; case PPLCG.ETypy.Hrdina: PPLCG.DataHrdina dh = new PPLCG.DataHrdina(); dh.Load(config); k = new KartaHrdina(dh); break; case PPLCG.ETypy.Lokace: PPLCG.DataLokace dl = new PPLCG.DataLokace(); dl.Load(config); k = new KartaLokace(dl); break; case PPLCG.ETypy.Nepritel: PPLCG.DataNepritel dn = new PPLCG.DataNepritel(); dn.Load(config); k = new KartaNepritel(dn); break; case PPLCG.ETypy.Spojenec: PPLCG.DataSpojenec ds = new PPLCG.DataSpojenec(); ds.Load(config); k = new KartaSpojenec(ds); break; case PPLCG.ETypy.Udalost: PPLCG.DataUdalost du = new PPLCG.DataUdalost(); du.Load(config); k = new KartaUdalost(du); break; case PPLCG.ETypy.Zrada: PPLCG.DataZrada dz = new PPLCG.DataZrada(); dz.Load(config); k = new KartaZrada(dz); break; } if (k != null) { Karty.Add(k); listBox1.Items.Add(k.Karta.Id); } } } }