示例#1
0
        public static Dictionary <string, List <string> > SubFeatures(string feature, List <int> subIndexes)
        {
            #region Get Available Types
            List <string>      availableTemp = new List <string>();
            ElkLib.FeatureType featureType   = ElkLib.ByName(feature);
            switch (featureType)
            {
            case ElkLib.FeatureType.Aerialway:
                availableTemp = Elk.Common.ElkLib.Aerialways;
                break;

            case ElkLib.FeatureType.Aeroway:
                availableTemp = Elk.Common.ElkLib.Aeroways;
                break;

            case ElkLib.FeatureType.Amenity:
                availableTemp = Elk.Common.ElkLib.Amenities;
                break;

            case ElkLib.FeatureType.Barrier:
                availableTemp = Elk.Common.ElkLib.Barrier;
                break;

            case ElkLib.FeatureType.Boundary:
                availableTemp = Elk.Common.ElkLib.Boundary;
                break;

            case ElkLib.FeatureType.Building:
                availableTemp = Elk.Common.ElkLib.Building;
                break;

            case ElkLib.FeatureType.Craft:
                availableTemp = Elk.Common.ElkLib.Craft;
                break;

            case ElkLib.FeatureType.Emergency:
                availableTemp = Elk.Common.ElkLib.Emergency;
                break;

            case ElkLib.FeatureType.Geological:
                availableTemp = Elk.Common.ElkLib.Geological;
                break;

            case ElkLib.FeatureType.Highway:
                availableTemp = Elk.Common.ElkLib.Highway;
                break;

            case ElkLib.FeatureType.Historic:
                availableTemp = Elk.Common.ElkLib.Historic;
                break;

            case ElkLib.FeatureType.Landuse:
                availableTemp = Elk.Common.ElkLib.Landuse;
                break;

            case ElkLib.FeatureType.Leisure:
                availableTemp = Elk.Common.ElkLib.Leisure;
                break;

            case ElkLib.FeatureType.ManMade:
                availableTemp = Elk.Common.ElkLib.ManMade;
                break;

            case ElkLib.FeatureType.Military:
                availableTemp = Elk.Common.ElkLib.Military;
                break;

            case ElkLib.FeatureType.Natural:
                availableTemp = Elk.Common.ElkLib.Natural;
                break;

            case ElkLib.FeatureType.Office:
                availableTemp = Elk.Common.ElkLib.Office;
                break;

            case ElkLib.FeatureType.Place:
                availableTemp = Elk.Common.ElkLib.Places;
                break;

            case ElkLib.FeatureType.Power:
                availableTemp = Elk.Common.ElkLib.Power;
                break;

            case ElkLib.FeatureType.PublicTransport:
                availableTemp = Elk.Common.ElkLib.PublicTransport;
                break;

            case ElkLib.FeatureType.Railway:
                availableTemp = Elk.Common.ElkLib.Railway;
                break;

            case ElkLib.FeatureType.Route:
                availableTemp = Elk.Common.ElkLib.Route;
                break;

            case ElkLib.FeatureType.Shop:
                availableTemp = Elk.Common.ElkLib.Shop;
                break;

            case ElkLib.FeatureType.Sport:
                availableTemp = Elk.Common.ElkLib.Sport;
                break;

            case ElkLib.FeatureType.Tourism:
                availableTemp = Elk.Common.ElkLib.Toursim;
                break;

            case ElkLib.FeatureType.Waterway:
                availableTemp = Elk.Common.ElkLib.Waterway;
                break;
            }
            ;
            availableTemp.Sort();
            #endregion

            List <string> selected = new List <string>();
            if (subIndexes == null || subIndexes.Count == 0)
            {
                selected = new List <string> {
                    "*"
                };
            }
            else
            {
                foreach (int index in subIndexes)
                {
                    try
                    {
                        selected.Add(availableTemp[index]);
                    }
                    catch { }
                }
            }

            return(new Dictionary <string, List <string> >
            {
                { "all", availableTemp },
                { "selected", selected }
            });
        }
示例#2
0
        public TypeSelectForm(ElkLib.FeatureType featureType, List <string> selected, bool individual, bool allowIndividual)
        {
            InitializeComponent();

            #region Get Available Types
            List <string> availableTemp = new List <string>();
            switch (featureType)
            {
            case ElkLib.FeatureType.Aerialway:
                availableTemp = Elk.Common.ElkLib.Aerialways;
                break;

            case ElkLib.FeatureType.Aeroway:
                availableTemp = Elk.Common.ElkLib.Aeroways;
                break;

            case ElkLib.FeatureType.Amenity:
                availableTemp = Elk.Common.ElkLib.Amenities;
                break;

            case ElkLib.FeatureType.Barrier:
                availableTemp = Elk.Common.ElkLib.Barrier;
                break;

            case ElkLib.FeatureType.Boundary:
                availableTemp = Elk.Common.ElkLib.Boundary;
                break;

            case ElkLib.FeatureType.Building:
                availableTemp = Elk.Common.ElkLib.Building;
                break;

            case ElkLib.FeatureType.Craft:
                availableTemp = Elk.Common.ElkLib.Craft;
                break;

            case ElkLib.FeatureType.Emergency:
                availableTemp = Elk.Common.ElkLib.Emergency;
                break;

            case ElkLib.FeatureType.Geological:
                availableTemp = Elk.Common.ElkLib.Geological;
                break;

            case ElkLib.FeatureType.Highway:
                availableTemp = Elk.Common.ElkLib.Highway;
                break;

            case ElkLib.FeatureType.Historic:
                availableTemp = Elk.Common.ElkLib.Historic;
                break;

            case ElkLib.FeatureType.Landuse:
                availableTemp = Elk.Common.ElkLib.Landuse;
                break;

            case ElkLib.FeatureType.Leisure:
                availableTemp = Elk.Common.ElkLib.Leisure;
                break;

            case ElkLib.FeatureType.ManMade:
                availableTemp = Elk.Common.ElkLib.ManMade;
                break;

            case ElkLib.FeatureType.Military:
                availableTemp = Elk.Common.ElkLib.Military;
                break;

            case ElkLib.FeatureType.Natural:
                availableTemp = Elk.Common.ElkLib.Natural;
                break;

            case ElkLib.FeatureType.Office:
                availableTemp = Elk.Common.ElkLib.Office;
                break;

            case ElkLib.FeatureType.Place:
                availableTemp = Elk.Common.ElkLib.Places;
                break;

            case ElkLib.FeatureType.Power:
                availableTemp = Elk.Common.ElkLib.Power;
                break;

            case ElkLib.FeatureType.PublicTransport:
                availableTemp = Elk.Common.ElkLib.PublicTransport;
                break;

            case ElkLib.FeatureType.Railway:
                availableTemp = Elk.Common.ElkLib.Railway;
                break;

            case ElkLib.FeatureType.Route:
                availableTemp = Elk.Common.ElkLib.Route;
                break;

            case ElkLib.FeatureType.Shop:
                availableTemp = Elk.Common.ElkLib.Shop;
                break;

            case ElkLib.FeatureType.Sport:
                availableTemp = Elk.Common.ElkLib.Sport;
                break;

            case ElkLib.FeatureType.Tourism:
                availableTemp = Elk.Common.ElkLib.Toursim;
                break;

            case ElkLib.FeatureType.Waterway:
                availableTemp = Elk.Common.ElkLib.Waterway;
                break;
            }
            ;

            availableTemp.Sort();
            foreach (string s in availableTemp)
            {
                if (!selected.Contains(s))
                {
                    availableTypes.Add(s);
                }
            }
            #endregion

            // hide the Individual Outputs if it's not selectable
            if (!allowIndividual)
            {
                outputsCheckbox.Visibility = System.Windows.Visibility.Hidden;
            }

            // remove the already selected types from the available ways.
            foreach (string s in selected)
            {
                selectedTypes.Add(s);
            }

            // Set the Individual Outputs Checkbox
            if (individual)
            {
                individualOutputs         = true;
                outputsCheckbox.IsChecked = true;
            }
        }