public SummaryUpdateArgs(PointDataSummary res)
 {
     this.result = res;
 }
        public PointDataSummary GetForPlaceMark(PlaceMark pm)
        {
            PointDataSummary ret = null;
            string guid = pm.Id;

            if (PDSummaries.ContainsKey(guid))
            {

                ret = PDSummaries[guid];

            }
            else
            {
                ret = new PointDataSummary();
                ret.Guid = guid;
                ret.Name = pm.Name; // this is temp until data is retrieved
                ret.Latitude = pm.Location.Latitude;
                ret.Longitude = pm.Location.Longitude;
                ret.LayerId = pm.FeedId;

                PDSummaries[guid] = ret;
            }

            if (!IsCurrent(guid))
            {
                UpdateSummaryByGuid(guid);
            }

            return ret;
        }
        public PointDataSummary ShowByGuid(string guid)
        {
            PointDataSummary ret = null;
            if (PDSummaries.ContainsKey(guid))
            {
                ret = PDSummaries[guid];
            }
            else
            {
                ret = new PointDataSummary();
                ret.Guid = guid;
                PDSummaries[guid] = ret;
            }

            if (!IsCurrent(guid))
            {
                UpdateSummaryByGuid(guid);
            }

            return ret;
        }
        public void FormatAndPostCommentToTwitter(string tweetText, PointDataSummary pds, int commentId)
        {
            string reqUrl = this.BaseURL + "Home/GetLinkForComment.json/" + commentId;

            WebClient shurlClient = new WebClient();
            shurlClient.OpenReadCompleted += new OpenReadCompletedEventHandler(shurlClient_OpenReadCompleted);
            shurlClient.Headers["RequestGuid"] = pds.Guid;
            shurlClient.Headers["TweetText"] = tweetText;
            shurlClient.OpenReadAsync(new Uri(reqUrl));
        }
 public void EditPointDataSummary(PointDataSummary val)
 {
     PDSummaries[val.Guid] = val;
     string jsonUrl = BaseURL + "Summaries/Edit.json/" + val.Id;
     WebRequest req = WebRequest.Create(jsonUrl);
     req.Headers["RequestGuid"] = val.Guid;
     req.Method = "POST";
     req.ContentType = "application/x-www-form-urlencoded";
     req.BeginGetRequestStream(EditPlaceMarkSummaryPostRequest, req);
 }
        private void Save_Click(object sender, RoutedEventArgs e)
        {
            if (tbName.Text.Length < 8)
            {
                tbName.BorderBrush = new SolidColorBrush(Colors.Red);
                tbNameReq.Visibility = Visibility.Visible;
                return;
            }

            if (tbDescription.Text.Length < 8)
            {
                tbName.BorderBrush = new SolidColorBrush(Colors.Black);
                tbDescription.BorderBrush = new SolidColorBrush(Colors.Red);
                tbNameReq.Visibility = Visibility.Collapsed;
                tbDescReq.Visibility = Visibility.Visible;
                return;
            }

            PointDataSummary temp = new PointDataSummary();
            temp.Description = HttpUtility.HtmlEncode(this.tbDescription.Text);
            temp.Name = HttpUtility.HtmlEncode(this.tbName.Text);
            temp.LayerId = this.ParentView.User.currentUser.user_id.ToString();
            temp.Latitude = this.ParentView.Pin.Location.Latitude;
            temp.Longitude = this.ParentView.Pin.Location.Longitude;
            //temp.Tag = this.ParentView.User.currentUser.screen_name;
            temp.Guid = Guid.NewGuid().ToString();

            //"Description", "LayerId", "Latitude", "Longitude", "Tag", "Guid", "Name"
            //string name = this.tbName.Text

            this.ParentView.CurrentSummary = temp;
            this.ParentView.Summary.CreatePointDataSummary(temp);

            ClearForm();
            this.ParentView.Visibility = Visibility.Collapsed;
        }
Example #7
0
 // Removed by Cory Fowler to Implement Advanced Search Component
 //void txtSearchQuery_KeyUp(object sender, KeyEventArgs e)
 //{
 //    if (e.Key == Key.Enter)
 //    {
 //        this.Service.GeoSearch(txtSearchQuery.Text, OpenDataMap);
 //    }
 //}
 //void Summaries_CommunitySummaryUpdate(SummariesController sender)
 //{
 //    //PointDataSummaryId
 //    int id = int.Parse(PointDataSummaryId);
 //    var list = from a in sender.PDSummaries where a.Value.Id == id select a;
 //    //if(sender.PDSummaries
 //}
 public void ShowTweetWin(PointDataSummary pds)
 {
     TweetEnterWin win = new TweetEnterWin();
     win.DataContext = pds;
     win.Closing += TweetWin_Closing;
     win.Show();
 }
Example #8
0
        // HACK: Callback after point is created by _pointDataViewCreate
        public void PointCreated(PointDataSummary pds)
        {
            // Delegate method is called more than once, so we will check if it is already on the map, and remove it
            // before adding it.
            UIElement elem = (UIElement)this.currentUserMapLayer.FindName(pds.Guid);
            if (elem != null)
            {
                currentUserMapLayer.Children.Remove(elem);
            }

            ImageBrush brush = new ImageBrush();
            SolidColorBrush stroke = new SolidColorBrush(Colors.White);
            brush.ImageSource = new BitmapImage(new Uri(Service.User.currentUser.profile_image_url));

            userGenMapLayer.Children.Remove(_pointDataViewCreate.Pin);
            _pointDataViewCreate.Visibility = Visibility.Collapsed;

            PlaceMark pm = new PlaceMark();
            pm.Location = new Location(pds.Latitude, pds.Longitude);
            pm.Summary = pds;
            pm.Id = pds.Guid;

            Ellipse pin = new Ellipse();
            pin.Fill = brush;
            pin.StrokeThickness = 1;
            pin.Stroke = stroke;
            pin.Width = 22;
            pin.Height = 22;
            pin.Opacity = 0.9;
            pin.Tag = pm;
            pin.Name = pm.Id;

            ToolTipService.SetToolTip(pin, pds.Name);

            pin.MouseLeftButtonUp += pin_MouseLeftButtonUp;
            currentUserMapLayer.AddChild(pin, pm.Location,PositionOrigin.Center);
            pin_MouseLeftButtonUp(pin, null);
        }