BMap.NET.WindowsForm/BPlacesSuggestionControl.cs

(开头部分) 4KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using Newtonsoft.Json.Linq;
using System;
using System.Drawing;
using System.Windows.Forms;

namespace BMap.NET.WindowsForm
{
    /// <summary>
    /// 导航路线起点\终点位置建议控件
    /// </summary>
    partial class BPlacesSuggestionControl : UserControl
    {
        public event EndPointSelectedEventHandler EndPointSelected;

        /// <summary>
        /// 类型(起点或终点)
        /// </summary>
        public PointType Type
        {
            get;
            set;
        }

        private JToken _content;

        /// <summary>
        /// 位置项
        /// </summary>
        public JToken Content
        {
            get
            {
                return _content;
            }
            set
            {
                _content = value;
                // 解析 具体json格式参见api文档
                if (_content != null)
                {
                    int index = 0;
                    foreach (JObject place in _content)
                    {
                        BPlacesSuggestionItem item = new BPlacesSuggestionItem();
                        item.Type = Type;
                        item.Index = index++;
                        item.DataSource = place;
                        item.Width = flpPlaces.Width;
                        flpPlaces.Controls.Add(item);
                        item.Margin = new System.Windows.Forms.Padding(0);
                        item.EndPointSelected += new EndPointSelectedEventHandler(item_EndPointSelected);
                    }
                    foreach (Control c in flpPlaces.Controls)
                    {
                        _places_height += c.Height;
                    }
                    Selected = false;
                }
            }
        }
后面还有 102 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。