当前位置: 首页>>代码示例>>C#>>正文


C# Pushpin.Count方法代码示例

本文整理汇总了C#中Microsoft.Phone.Controls.Maps.Pushpin.Count方法的典型用法代码示例。如果您正苦于以下问题:C# Pushpin.Count方法的具体用法?C# Pushpin.Count怎么用?C# Pushpin.Count使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Microsoft.Phone.Controls.Maps.Pushpin的用法示例。


在下文中一共展示了Pushpin.Count方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: setMap

        public void setMap()
        {
            IList<Dining1> restaurants = DBHelper.GetRestaurants();           // Access Dining1 Database
            //float[,] latLongArray = new float[restaurants.Count(), 2];    // Create 2 dimensional array to hold latitude and longitude data
            /*Temporary Solution For GeoCoordinate Array.*/
            double[,] latLongArray = {
                                        {36.146405, -86.803178}, //1
                                        {36.141951, -86.797127}, //2
                                        {36.141771, -86.79694},  //3
                                        {36.146321, -86.803037}, //4
                                        {36.146545, -86.803471}, //5
                                        {36.146626, -86.803736}, //6
                                        {36.147418, -86.806839}, //7
                                        {36.147461, -86.806705}, //8
                                        {36.140584, -86.806286}, //9
                                        {36.144847, -86.805728}, //10
                                        {36.145718, -86.800529}, //11
                                        {36.144785, -86.806399}, //12
                                        {36.129392, -86.778613}, //13
                                        {36.144801, -86.802836}, //14
                                        {36.13863, -86.805874},  //15
                                        {36.14654, -86.800662},  //16
                                        {36.148782, -86.803473}, //17
                                        {36.143796, -86.803227}, //18
                                        {36.144929, -86.805791}, //19
                                        {36.147903, -86.805857}, //20
                                        {36.140609, -86.806328}, //21
                                        {36.146587, -86.803428}, //22
                                        {36.149829, -86.80124},  //23
                                        {36.158751, -86.818717}, //24
                                        {36.146313, -86.808728}, //25
                                        {36.148542, -86.799112}, //26
                                        {36.137065, -86.799215}, //27
                                        {36.151832, -86.805135}, //28
                                        {36.148,    -86.8084  }, //29
                                        {36.148266, -86.806459}, //30
                                        {36.1368,   -86.7996  }, //31
                                        {36.14267,  -86.7992  }, //32
                                        {36.151744, -86.803774}, //33
                                        {36.1464,   -86.809   }, //34
                                        {36.150167, -86.797837}, //35
                                        {36.1513,   -86.804124}, //36
                                        {36.148439, -86.806092}, //37
                                        {36.1488,   -86.805   }, //38
                                        {36.13715,  -86.8009  }, //39
                                        {36.150282, -86.800717}, //40
                                        {36.148327, -86.807474}, //41
                                        {36.136348, -86.801419}, //42
                                        {36.148368, -86.807427}, //43
                                        {36.147596, -86.807077}, //44
                                        {36.148299, -86.807506}, //45
                                        {36.136725, -86.799483}, //46
                                        {36.1507,   -86.801198}, //47
                                        {36.14859,  -86.799095}, //48
                                        {36.145667, -86.810038}, //49
                                        {36.13675,  -86.8025  }  //50

                                    };

            Pushpin[] restaurantLocations = new Pushpin[restaurants.Count()];   // Create array to hold pushpins
            MapLayer[] pushpinLayers = new MapLayer[restaurants.Count()];

            // Fill Pushpin array with Pushpin Objects
            for (int i = 0; i < restaurantLocations.Count(); i++)
                {
                    restaurantLocations[i] = new Pushpin();
                }

            for (int row = 0; row < 14/*(14 is number in test array) restaurants.Count()*/; row++)
                {
                    //Debug.WriteLine("id: {0} {1},{2}", restaurants[row].Unique_id, restaurants[row].Lat, restaurants[row].Long);
                    latLongArray[row, 0] = latLongArray[row, 0];//(float) restaurants[row].Lat;
                    latLongArray[row, 1] = latLongArray[row, 1];//(float) restaurants[row].Long;

                    restaurantLocations[row].Location = new GeoCoordinate(latLongArray[row, 0],latLongArray[row, 1]);
                    Debug.WriteLine(restaurants[row].Name + ": " + latLongArray[row,0] + "," + latLongArray[row,1]);

                    DiningMap.Children.Add(restaurantLocations[row]);

                }
        }
开发者ID:VandyApps,项目名称:dining-windows,代码行数:81,代码来源:MapDetail.xaml.cs


注:本文中的Microsoft.Phone.Controls.Maps.Pushpin.Count方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。