Exemple #1
0
        private void button1_Click(object sender, RoutedEventArgs e)
        {
            OpenFileDialog ofd = new OpenFileDialog();

            ofd.Filter = "IGC Files|*.igc";

            bool?openResult = ofd.ShowDialog(this);

            if (openResult.HasValue && openResult.Value == true)
            {
                core.Load(ofd.FileName);

                GridView       gv = new GridView();
                GridViewColumn gvc;

                // 100% dynamic binding with no predef xaml

                gvc = new GridViewColumn();
                gvc.DisplayMemberBinding = new Binding("civilizationID");
                gvc.Header = "ID";
                gv.Columns.Add(gvc);
                gvc = new GridViewColumn();
                gvc.DisplayMemberBinding = new Binding("name");
                gvc.Header = "Name";
                gv.Columns.Add(gvc);
                gvc = new GridViewColumn();
                gvc.DisplayMemberBinding = new Binding("bonusMoney");
                gvc.Header = "Bonus Money";
                gv.Columns.Add(gvc);
                gvc = new GridViewColumn();
                gvc.DisplayMemberBinding = new Binding("incomeMoney");
                gvc.Header = "Income Money";
                gv.Columns.Add(gvc);
                gvc = new GridViewColumn();
                gvc.DisplayMemberBinding = new Binding("hudName");
                gvc.Header = "HUD name";
                gv.Columns.Add(gvc);
                gvc = new GridViewColumn();
                gvc.DisplayMemberBinding = new Binding("initialStationTypeID");
                gvc.Header = "Starting Station";
                gv.Columns.Add(gvc);
                gvc = new GridViewColumn();
                gvc.DisplayMemberBinding = new Binding("lifepod");
                gvc.Header = "Lifepod";
                gv.Columns.Add(gvc);

                listView1.View        = gv;
                listView1.ItemsSource = core.m_civilizations;

                //listView1.DisplayMemberPath = "name";
                //listView1.ItemTemplate = (DataTemplate)Resources["civFormating"];
                //Binding b = new Binding();
                //b.Source = core.m_civilizations;
                //b.Path = new PropertyPath("Name");
                //listBox1.SetBinding(ContentProperty, b);
            }
        }
Exemple #2
0
        private void btLoad_Click(object sender, EventArgs e)
        {
            if (ofdCore.ShowDialog() == DialogResult.OK)
            {
                core.Load(ofdCore.FileName);

                listView1.Clear();
                listView1.Items.Add("m_chaffTypes : " + core.m_chaffTypes.Count.ToString());
                listView1.Items.Add("m_civilizations : " + core.m_civilizations.Count.ToString());
                listView1.Items.Add("m_developments : " + core.m_developments.Count.ToString());
                listView1.Items.Add("m_droneTypes : " + core.m_droneTypes.Count.ToString());
                listView1.Items.Add("m_hullTypes : " + core.m_hullTypes.Count.ToString());
                listView1.Items.Add("m_launcherTypes : " + core.m_launcherTypes.Count.ToString());
                listView1.Items.Add("m_mineTypes : " + core.m_mineTypes.Count.ToString());
                listView1.Items.Add("m_missileTypes : " + core.m_missileTypes.Count.ToString());
                listView1.Items.Add("m_partTypes : " + core.m_partTypes.Count.ToString());
                listView1.Items.Add("m_probeTypes : " + core.m_probeTypes.Count.ToString());
                listView1.Items.Add("m_projectileTypes : " + core.m_projectileTypes.Count.ToString());
                listView1.Items.Add("m_stationTypes : " + core.m_stationTypes.Count.ToString());
                listView1.Items.Add("m_treasureSets : " + core.m_treasureSets.Count.ToString());
                listView1.Items.Add("m_projectileTypes : " + core.m_projectileTypes.Count.ToString());
            }
        }
Exemple #3
0
        static void Main(string[] args)
        {
            if (args.Length != 1)
            {
                Console.Out.Write("error: no argument");
                return;
            }
            IGCCore core = new IGCCore();

            core.Load(args[0]);

            //TODO: fancy print GAs attributes and other array values

            ObjectDumper.Write("Globals-", core.Constants);

            foreach (DataCivilizationIGC civ in core.m_civilizations)
            {
                string civid = "Factions-" + civ.name + "(" + civ.civilizationID + ")-";
                ObjectDumper.Write(civid, civ);
            }
            foreach (DataDevelopmentIGC dev in core.m_developments)
            {
                string devid = "Devels-" + dev.name + "(" + dev.developmentID + ")-";
                ObjectDumper.Write(devid, dev);
            }
            foreach (DataDroneTypeIGC d in core.m_droneTypes)
            {
                string did = "Drones-" + d.name + " (" + d.droneTypeID + ")-";
                ObjectDumper.Write(did, d);
            }
            foreach (DataProjectileTypeIGC p in core.m_projectileTypes)
            {
                string pid = "Projectiles-p#" + p.projectileTypeID + "-";
                ObjectDumper.Write(pid, p);
            }
            foreach (DataStationTypeIGC s in core.m_stationTypes)
            {
                string sid = "Stations-" + s.name + "(" + s.stationTypeID + ")-";
                ObjectDumper.Write(sid, s);
            }
            foreach (DataHullTypeIGC h in core.m_hullTypes)
            {
                string hid = "Ships-" + h.name + "(" + h.hullID + ")-";
                ObjectDumper.Write(hid, h);
            }
            foreach (DataPartTypeIGC p in core.m_partTypes)
            {
                string pid = "Parts-" + p.name + "(" + p.partID + ")-";
                ObjectDumper.Write(pid, p);
            }
            foreach (DataChaffTypeIGC m in core.m_chaffTypes)
            {
                string mid = "Chaffs-" + m.launcherDef.name + "(" + m.expendabletypeID + ")-";
                ObjectDumper.Write(mid, m);
            }
            foreach (DataMineTypeIGC m in core.m_mineTypes)
            {
                string mid = "Mines-" + m.launcherDef.name + "(" + m.expendabletypeID + ")-";
                ObjectDumper.Write(mid, m);
            }
            foreach (DataMissileTypeIGC m in core.m_missileTypes)
            {
                string mid = "Missiles-" + m.launcherDef.name + "(" + m.expendabletypeID + ")-";
                ObjectDumper.Write(mid, m);
            }
            foreach (DataProbeTypeIGC m in core.m_probeTypes)
            {
                string mid = "Probes-" + m.launcherDef.name + "(" + m.expendabletypeID + ")-";
                ObjectDumper.Write(mid, m);
            }
            foreach (DataLauncherTypeIGC l in core.m_launcherTypes)
            {
                string lid = "Launchers-" + l.partID + "-" + l.expendabletypeID + "-";
                ObjectDumper.Write(lid, l);
            }
            foreach (DataTreasureSetIGC t in core.m_treasureSets)
            {
                string tid = "Treasures-" + t.name + "(" + t.treasureSetID + ")-";
                ObjectDumper.Write(tid, t);
            }
        }