Example #1
0
 static void Main()
 {
     Application.EnableVisualStyles();
     Application.SetCompatibleTextRenderingDefault(false);
     Application.Run(new Cartographer());
     DataGrabber dataGrabber = new DataGrabber();
 }
Example #2
0
        public void CalculateSafety(DataGrabber grabber)
        {
            double safety = this.TPPMargin;

            // Previously Won Factor
            if (this.TermsInPower >= 4)
            {
                safety += 10.0f;
            }
            else if (this.TermsInPower >= 2)
            {
                safety += 5.0f;
            }

            // State Impact Factor
            foreach (StateElectorate stateElec in grabber.StateElectorates)
            {
                if (stateElec.FederalElectorate.Name == this.Name)
                {
                    if (stateElec.WinningParty == this.WinningParty)
                    {
                        safety += 2.0f;
                    }

                    else
                    {
                        if (stateElec.WinningParty != null)
                        {
                            safety -= 4.0f;
                        }
                    }
                }
            }

            if (safety < 5)
            {
                this.SeatSafety = "Marginal Seat";
            }
            else if (safety > 5 && safety < 10)
            {
                this.SeatSafety = "Moderately Safe";
            }
            else if (safety > 10 && safety < 15)
            {
                this.SeatSafety = "Safe";
            }
            else if (safety > 15 && safety < 25)
            {
                this.SeatSafety = "Very Safe";
            }
            else if (safety > 25)
            {
                this.SeatSafety = "Rock Solid";
            }
        }
Example #3
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");
        }