コード例 #1
0
ファイル: DrawMarker.cs プロジェクト: cyberslacking/Fork
        private void OnLableValueChanged(string lable, object value)
        {
            CommandChangeState c = new CommandChangeState(Global.control.Objects);

            switch (lable)
            {
            case "Name":
                marker.ToolTipText = (string)value;
                break;

            case "ToolTipMode":
                marker.ToolTipMode = (MarkerTooltipMode)value;
                break;

            case "Lat":
            case "Lng":
                marker.Position = property.LocalPosition;
                PointsArray[0]  = property.LocalPosition;
                break;

            case "MarkerType":
                MARKER_TYPE markerType = (MARKER_TYPE)value;
                if (markerType == MARKER_TYPE.Green)
                {
                    property.ImageFile = @"image\marker_0.ico";
                }
                else if (markerType == MARKER_TYPE.Yellow)
                {
                    property.ImageFile = @"image\marker_2.ico";
                }
                else if (markerType == MARKER_TYPE.Red)
                {
                    property.ImageFile = @"image\marker_1.ico";
                }
                else if (markerType == MARKER_TYPE.Gray)
                {
                    property.ImageFile = @"image\marker_3.ico";
                }
                marker.SetBitmap(new Bitmap(AppDomain.CurrentDomain.BaseDirectory + property.ImageFile));
                this.NotifyImageChanged(this, new EventArgs());
                break;
            }
            Global.control.UpdateMarkerLocalPosition(marker);
            Global.control.PropertyChanged(property);
            Global.control.Refresh();
        }