示例#1
0
        private void convertData_Click(object sender, EventArgs e)
        {
            ElectorateImporter g_elecImporter = new ElectorateImporter();
            try { g_elecImporter.ParseXLS(_xlsData); }
            catch { }
            try { g_elecImporter.ParseMID(_midData); }
            catch { }
            try { g_elecImporter.ParseMIF(_mifData); }
            catch { }
            m_Electorates = g_elecImporter.MergeData();
            g_elecImporter.MergeDataPhaseTwo(m_Electorates, "data/Qld_Federal-State Electorate Mapping.xls", "data/Federal Election Results-Qld-2004.xls", "data/Qld_State Results by Electorate-2006.xls"); //!TESTING
            convertPB.Image = (Image)pic.ResourceManager.GetObject("Tick");

               // m_Electorates[0].Name;
            for (int i =0; i < m_Electorates.Count; i++)
                pointBox.Items.Add(m_Electorates[i].Name, CheckState.Checked);
            g_Grabber = new DataGrabber();
            g_Grabber.importData();

            Exporter m_exporter = new Exporter(m_Electorates);
            m_exporter.convertToKml(colourMode);
            MessageBox.Show("Saved KML File from XLS and MID/MIF Data");
        }
示例#2
0
        private void generateBut_Click(object sender, EventArgs e)
        {
            List<String> _checkList = new List<string>();
            foreach (object itemChecked in pointBox.CheckedItems)
            {
                _checkList.Add(itemChecked.ToString());
            }

            List<Electorate> _electorates =new List<Electorate>();

            for (int i = 0; i < _checkList.Count; i++)
            {
                if (_checkList.Contains(m_Electorates[i].Name))
                {
                    _electorates.Add(m_Electorates[i]);
                    FederalElectorate fed = g_Grabber.FederalElectorates.Find(delegate(FederalElectorate f) { return f.Name == m_Electorates[i].Name; });
                    m_Electorates[i].SeatSafety = fed.SeatSafety;
                    m_Electorates[i].WinningParty = fed.WinningParty;

                    // SomeObject desiredObject = myObjects.Find(delegate(SomeObject o) { return o.Id == desiredId; });
                }
            }

            Exporter _exporter = new Exporter(_electorates);
            _exporter.convertToKml(colourMode);
            string _textFile = "";
            if (File.Exists("data/kml.kml"))
            {
                _textFile = Directory.GetCurrentDirectory() + "\\data\\kml.kml";
                Console.Out.WriteLine("file exists");
            }

            Console.Out.WriteLine("Saved KML File " + _textFile);
            ge.OpenKmlFile(_textFile, 1);
        }
示例#3
0
 private void convertData_Click(object sender, EventArgs e)
 {
     ElectorateImporter g_elecImporter = new ElectorateImporter();
     g_elecImporter.ParseXLS(_xlsData);
     g_elecImporter.ParseMID(_midData);
     g_elecImporter.ParseMIF(_mifData);
     m_Electorates = g_elecImporter.MergeData();
     Exporter m_exporter = new Exporter(m_Electorates);
     m_exporter.convertToKml();
     convertPB.Image = (Image)pic.ResourceManager.GetObject("Tick");
     MessageBox.Show("Created KML File from XLS and MID/MIF Data");
 }