Example #1
0
        public List <KeyValuePair <string, VisitedLocation> > GetAllLocations(ISortMethod <string, VisitedLocation> i_SortStartegy)
        {
            SortedDictionary <string, VisitedLocation>     allLocations    = m_ILocationsMap.GetAllLocations(m_ConnectedUser);
            List <KeyValuePair <string, VisitedLocation> > sortedLocations = i_SortStartegy.Sort(allLocations);

            return(sortedLocations);
        }
Example #2
0
        private void radioButtons_CheckedChanged(object sender, EventArgs e)
        {
            RadioButton radioButton = sender as RadioButton;

            if (radioButton.Checked)
            {
                m_SortMethod = m_radioButtonsMethods[radioButton.Name];
                loadLocationsList();
            }
        }
Example #3
0
        public List <KeyValuePair <string, VisitedLocation> > HardcodedLocation(ISortMethod <string, VisitedLocation> i_SortStartegy)
        {
            SortedDictionary <string, VisitedLocation> fakeLocations = new SortedDictionary <string, VisitedLocation>();

            fakeLocations["Rishon Lezion"] = new VisitedLocation("Rishon Lezion", 12, 5, 4, 3, 31.961020, 34.801620);
            fakeLocations["Ashdod"]        = new VisitedLocation("Ashdod", 12, 0, 3, 9, 31.8024, 34.6405);
            fakeLocations["Ashkelon"]      = new VisitedLocation("Ashkelon", 14, 9, 2, 3, 31.6677203, 34.5996736);
            fakeLocations["Tel Aviv"]      = new VisitedLocation("Tel Aviv", 10, 2, 2, 6, 32.0750224, 34.7771282);
            List <KeyValuePair <string, VisitedLocation> > sortedLocations = i_SortStartegy.Sort(fakeLocations);

            return(sortedLocations);
        }
Example #4
0
        private void DrawSortingChart(ISortMethod<double> method, double[] selection)
        {
            sortChart.Series[0].Points.Clear();
            for(int i =0; i<selection.Length; i++){
                sortChart.Series[0].Points.AddY(selection[i]);
                if (i == method.PrimaryItemIndex) {
                    sortChart.Series[0].Points[i].Color = Color.Red;
                }

                if (i == method.SecondaryItemIndex)
                {
                    sortChart.Series[0].Points[i].Color = Color.Green;
                }
            }
        }
Example #5
0
 public void SelectMethod(ISortMethod method)
 {
     Method = method;
 }