Ejemplo n.º 1
0
        public override Panel CreatePanel()
        {
            var container = new FlowLayoutPanel
            {
                FlowDirection = FlowDirection.TopDown
            };

            container.AutoSize = true;

            Label eventType = new Label();

            eventType.Text     = this.ID + " Tracklog Event";
            eventType.AutoSize = true;
            eventType.Font     = new Font(eventType.Font.Name, 15, FontStyle.Bold);
            Label locationText = new Label();

            locationText.AutoSize = true;



            MapHelper     mapHelper = MapHelper.Instance();
            StringBuilder location  = new StringBuilder();

            location.Append("Start Location: ");
            location.AppendLine(XMLTracklogLoader.GetStartCordinatesOfTrack(this.Filepath).ToString());
            location.Append("End Location: ");
            location.Append(XMLTracklogLoader.GetEndCordinatesOfTrack(this.Filepath));
            locationText.Text = location.ToString();

            Label trackName = new Label();

            trackName.AutoSize = true;
            trackName.Text     = "TrackName: " + XMLTracklogLoader.GetTrackName(this.Filepath);
            List <XMLTracklogLoader.WayPoints> waypoints = XMLTracklogLoader.GetWaypoints(this.Filepath);
            Label waypointHeading = new Label();

            waypointHeading.Font     = new Font(waypointHeading.Font, FontStyle.Bold);
            waypointHeading.Text     = "\nWaypoints";
            waypointHeading.AutoSize = true;
            Label waypointLabel = new Label();

            waypointLabel.AutoSize = true;
            StringBuilder waypointString = new StringBuilder();

            foreach (var point in waypoints)
            {
                waypointLabel.Text += point.Name + " " + point.Coordinates + "\n";
            }

            Label dateText = new Label();

            dateText.AutoSize = true;
            dateText.Text     = "Date: " + this.Datetimestamp.ToString();

            Label linkHeading = new Label();

            linkHeading.Text     = "\nLinks to event: ";
            linkHeading.Font     = new Font(linkHeading.Font, FontStyle.Bold);
            linkHeading.AutoSize = true;
            Label linkLabel = new Label();

            linkLabel.AutoSize = true;
            StringBuilder linkString = new StringBuilder();

            foreach (string link in this.Links)
            {
                linkString.AppendLine(link);
            }
            linkLabel.Text = linkString.ToString();
            container.Controls.Add(eventType);
            container.Controls.Add(locationText);
            container.Controls.Add(dateText);
            container.Controls.Add(trackName);
            container.Controls.Add(waypointHeading);
            container.Controls.Add(waypointLabel);
            container.Controls.Add(linkHeading);
            container.Controls.Add(linkLabel);

            return(container);
        }
Ejemplo n.º 2
0
        public override void Render()
        {
            MapHelper mh = MapHelper.Instance();

            mh.AddMarker("twitter", new Bitmap(Properties.Resources.twitter), this.Location, "Date: " + this.Datetimestamp.ToString() + "\n" + this.Text, this);
        }