public frmSpecialDetails(DotNetSquare.NetSquare.FourSquareSpecial xmlSpecial)
        {
            InitializeComponent();
            Program.arrForm.Add(this);

            lblTitle.Text = "Special";

            int y = lblTitle.Location.Y + lblTitle.Height + 3;

            DotNetSquare.NetSquare.FourSquareVenue xmlVenue = xmlSpecial.venue;
            if (xmlVenue != null)
            {
                ucVenueListItem oVenue = new ucVenueListItem(xmlVenue);
                oVenue.Location = new Point(3, y);
                oVenue.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
                oVenue.Width = pnlForm.Width - 3 * 2;

                pnlForm.Controls.Add(oVenue);

                y = oVenue.Location.Y + oVenue.Height + 3;
            }

            pnlSpecial.Location = new Point(3, y);

            lblType.Text = xmlSpecial.type;
            lblKind.Text = xmlSpecial.message;
            tbMessage.Text = xmlSpecial.description;
        }
        public ucLeaderboardItem(DotNetSquare.NetSquare.FourSquareUser xmlUser, DotNetSquare.NetSquare.FourSquareScore xmlScore)
        {
            InitializeComponent();

            string strName = xmlUser.firstName + " ";
            strName += xmlUser.lastName;
            lblName.Text = strName.Trim();

            string strPictureURL = xmlUser.photo;
            if (!String.IsNullOrEmpty(strPictureURL))
            {
                pbUser.Image = Program.getImageFromURL(strPictureURL);
            }

            string strGender = xmlUser.gender;
            Color colorGender = Color.Black;
            switch (strGender)
            {
                case "female":
                    colorGender = Color.PaleVioletRed;
                    break;

                case "male":
                    colorGender = Color.SteelBlue;
                    break;
            }
            pnlGender.BackColor = colorGender;

            lblRecent.Text = xmlScore.checkinsCount.ToString();
            lblMaxScore.Text = xmlScore.max.ToString();
            lblScore.Text = xmlScore.recent.ToString();
        }
예제 #3
0
        public frmTipDetails(DotNetSquare.NetSquare.FourSquareTip xmlTip)
        {
            InitializeComponent();
            Program.arrForm.Add(this);

            Cursor.Current = Cursors.WaitCursor;

            _strTipID = xmlTip.id;

            string strCreated = xmlTip.createdAt.ToString();
            lblTimestamp.Text = Program.convertAPITimeToCuteTime(strCreated);

            string strDistance = xmlTip.venue.location.Distance;
            if (!String.IsNullOrEmpty(strDistance))
            {
                strDistance = Program.convertDistanceToKM(strDistance);
                strDistance = lblTimestamp.Text + " " + strDistance + " away";
                lblTimestamp.Text = strDistance.Trim();
            }

            int y = lblTimestamp.Location.Y + lblTimestamp.Height + 3;

            DotNetSquare.NetSquare.FourSquareVenue xmlVenue = xmlTip.venue;
            if (xmlVenue != null)
            {
                ucVenueListItem oVenue = new ucVenueListItem(xmlVenue);
                oVenue.Location = new Point(0, 0);
                oVenue.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
                oVenue.Width = pnlVenue.Width;

                pnlVenue.Controls.Add(oVenue);
                pnlVenue.Height = oVenue.Location.Y + oVenue.Height;

                y = pnlVenue.Location.Y + pnlVenue.Height + 3;
            }

            DotNetSquare.NetSquare.FourSquareUser xmlUser = xmlTip.user;
            if (xmlUser != null)
            {
                ucUserListItem oUser = new ucUserListItem(xmlUser);
                oUser.Location = new Point(3, y);
                oUser.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
                oUser.Width = pnlForm.Width - 3 * 2;

                pnlForm.Controls.Add(oUser);

                y = oUser.Location.Y + oUser.Height + 3;
            }

            tbTip.Text = xmlTip.text;

            pnlTip.Location = new Point(3, y);

            y = pnlTip.Location.Y + pnlTip.Height + 3;

            pnlButtons.Location = new Point(3, y + 3);

            Cursor.Current = Cursors.Default;
        }
예제 #4
0
 // checked in users at a venue
 public frmCheckinList(string strTitle, DotNetSquare.NetSquare.FourSquareCheckins xmlCheckins, string strVenueID)
 {
     InitializeComponent();
     Program.arrForm.Add(this);
     _strTitle = strTitle;
     _xmlCheckins = xmlCheckins;
     _strVenueID = strVenueID;
     _TimeSinceEpoch = Program.ToUnixTime(Program.SevenDaysAgo());
 }
예제 #5
0
        public ucScoreListItem(DotNetSquare.NetSquare.FourSquareCheckinScore xmlScore)
        {
            InitializeComponent();

            lblScore.Text = xmlScore.Points.ToString();

            string strIconURL = xmlScore.icon;
            pbIcon.Image = Program.getImageFromURL(strIconURL);

            lblMessage.Text = xmlScore.message;
        }
        public ucSpecialListItem(DotNetSquare.NetSquare.FourSquareSpecial xmlSpecial)
        {
            InitializeComponent();

            _xmlSpecial = xmlSpecial;

            lblType.Text = xmlSpecial.type;

            lblKind.Text = xmlSpecial.message;

            lblMessage.Text = xmlSpecial.description;
        }
예제 #7
0
        public static string buildAddress(DotNetSquare.NetSquare.FourSquareLocation xmlLocation)
        {
            string strReturn = "";

            //address
            string strLabel = "";
            string strItem = "";

            //address
            strItem = xmlLocation.Address;
            if (!String.IsNullOrEmpty(strItem))
            {
                strLabel += strItem + " ";
            }

            //crossstreet
            strItem = xmlLocation.CrossStreet;
            if (!String.IsNullOrEmpty(strItem))
            {
                strLabel += "(" + strItem.Trim() + ") ";
            }

            //city
            strItem = xmlLocation.City;
            String strCity = strItem;
            if (!String.IsNullOrEmpty(strItem))
            {
                strLabel += strItem.Trim() + " ";
            }

            //state
            strItem = xmlLocation.State;
            string strState = strItem;
            if (!String.IsNullOrEmpty(strItem))
            {
                if (!strCity.Equals(strState))
                {
                    strLabel += strItem.Trim() + " ";
                }
            }

            //zip
            strItem = xmlLocation.PostalCode;
            if (!String.IsNullOrEmpty(strItem))
            {
                strLabel += strItem + " ";
            }

            strReturn = strLabel;

            return strReturn;
        }
예제 #8
0
        public ucTipListItem(DotNetSquare.NetSquare.FourSquareTip xmlTip)
        {
            InitializeComponent();

            _xmlTip = xmlTip;

            _strTipID = xmlTip.id;

            _strTip = xmlTip.text;
            lblText.Text = _strTip;

            //timestamp
            string strCreated = xmlTip.createdAt;
            lblTimestamp.Text = Program.convertAPITimeToCuteTime(strCreated);

            //distance
            string strDistance = xmlTip.venue.location.Distance;
            if (!String.IsNullOrEmpty(strDistance))
            {
                lblTimestamp.Text += " " + Program.convertDistanceToKM(strDistance) + " away";
            }

            DotNetSquare.NetSquare.FourSquareUser xmlUser = xmlTip.user;
            if (xmlUser != null)
            {
                _strUserID = xmlUser.id;

                string strGender = xmlUser.gender;
                Color colorGender = Color.Black;
                switch (strGender)
                {
                    case "female":
                        colorGender = Color.PaleVioletRed;
                        break;

                    case "male":
                        colorGender = Color.SteelBlue;
                        break;
                }
                pnlGender.BackColor = colorGender;

                string strPictureURL = xmlUser.photo;
                if (!String.IsNullOrEmpty(strPictureURL))
                {
                    pbUser.Image = Program.getImageFromURL(strPictureURL);
                }

                string strName = xmlUser.firstName + " ";
                strName += xmlUser.lastName;
                lblName.Text = strName.Trim();
            }
        }
예제 #9
0
        public ucBadgeListItem(DotNetSquare.NetSquare.FourSquareBadge xmlBadge)
        {
            InitializeComponent();

            //name
            lblName.Text = xmlBadge.name;

            //icon
            string strIconURL = Program.GetSmallBadge(xmlBadge);
            pbBadge.Image = Program.getImageFromURL(strIconURL);

            //description
            lblDescription.Text = xmlBadge.description;
        }
예제 #10
0
        public ucUserListItem(DotNetSquare.NetSquare.FourSquareUser xmlUser)
        {
            InitializeComponent();

            lblUserID.Text = xmlUser.id;

            string strName = xmlUser.firstName + " ";
            strName += xmlUser.lastName;
            lblName.Text = strName.Trim();

            string strPictureURL = xmlUser.photo;
            if (!String.IsNullOrEmpty(strPictureURL))
            {
                pbUser.Image = Program.getImageFromURL(strPictureURL);
            }

            string strGender = xmlUser.gender;
            Color colorGender = Color.Black;
            switch (strGender)
            {
                case "female":
                    colorGender = Color.PaleVioletRed;
                    break;

                case "male":
                    colorGender = Color.SteelBlue;
                    break;
            }
            pnlGender.BackColor = colorGender;

            _strFacebookID = xmlUser.contact.facebook;
            if (String.IsNullOrEmpty(_strFacebookID))
            {
                pbFacebook.Visible = false;
            }

            _strTwitterID = xmlUser.contact.twitter;
            if (String.IsNullOrEmpty(_strTwitterID))
            {
                pbTwitter.Visible = false;
            }

            lblPhone.Text = xmlUser.contact.phone;
            lblEmail.Text = xmlUser.contact.email;
        }
        public ucCheckinListItem(DotNetSquare.NetSquare.FourSquareCheckin xmlCheckin)
        {
            InitializeComponent();

            _xmlCheckin = xmlCheckin;

            DotNetSquare.NetSquare.FourSquareUser xmlUser = xmlCheckin.user;
            if (xmlUser != null)
            {
                string strGender = xmlUser.gender;
                Color colorGender = Color.Black;
                switch (strGender)
                {
                    case "female":
                        colorGender = Color.PaleVioletRed;
                        break;

                    case "male":
                        colorGender = Color.SteelBlue;
                        break;
                }
                pnlGender.BackColor = colorGender;

                string strPictureURL = xmlUser.photo;
                if (!String.IsNullOrEmpty(strPictureURL))
                {
                    pbUser.Image = Program.getImageFromURL(strPictureURL);
                }

                string strName = xmlUser.firstName + " ";
                strName += xmlUser.lastName;
                lblName.Text = strName.Trim();
            }

            if (xmlCheckin.venue != null)
            {
                lblVenue.Text = xmlCheckin.venue.name;
            }
            else
            {
                lblVenue.Text = "";
            }
            lblShout.Text = xmlCheckin.shout;

            //timestamp
            string strCreated = xmlCheckin.createdAt.ToString();
            lblTimestamp.Text = Program.convertAPITimeToCuteTime(strCreated);

            // distance
            string strDistance = "";

            if (xmlCheckin.venue != null)
            {
                strDistance = xmlCheckin.venue.location.Distance;
            }

            if ((!String.IsNullOrEmpty(strDistance)))
            {
                lblTimestamp.Text += " " + Program.convertDistanceToKM(strDistance) + " away";
            }
        }
예제 #12
0
 public static String GetSmallBadge(DotNetSquare.NetSquare.FourSquareBadge objBadge)
 {
     String Response = "";
     Response += objBadge.image.Prefix;
     Response += objBadge.image.sizes[0].ToString();
     Response += objBadge.image.Name;
     return Response;
 }
예제 #13
0
 public frmDashboard(DotNetSquare.NetSquare.FourSquareUser StrToken)
 {
     InitializeComponent();
     Program.arrForm.Add(this);
     _strLoggedInUserDetailXML = StrToken;
 }
예제 #14
0
        public ucVenueListItem(DotNetSquare.NetSquare.FourSquareVenue xmlVenue)
        {
            InitializeComponent();

            LoadData(xmlVenue, "");
        }
예제 #15
0
        public ucVenueListItem(DotNetSquare.NetSquare.FourSquareVenue xmlVenue, string strCreated)
        {
            InitializeComponent();

            LoadData(xmlVenue, strCreated);
        }
        public frmCheckinDetails(DotNetSquare.NetSquare.FourSquareCheckin  xmlCheckin)
        {
            InitializeComponent();
            Program.arrForm.Add(this);

            Cursor.Current = Cursors.WaitCursor;

            /////////////////////////////////////////////////////////////
            //timestamp
            string strCreated = xmlCheckin.createdAt.ToString();
            lblTimestamp.Text = Program.convertAPITimeToLocalTime(strCreated);

            // distance
            string strDistance = xmlCheckin.venue.location.Distance;
            strDistance = lblTimestamp.Text + " " + Program.convertDistanceToKM(strDistance) + " away";
            lblTimestamp.Text = strDistance.Trim();

            int y = lblTimestamp.Location.Y + lblTimestamp.Height + 3;

            /////////////////////////////////////////////////////////
            // venue
            DotNetSquare.NetSquare.FourSquareVenue xmlVenue = xmlCheckin.venue;
            if (xmlVenue != null)
            {
                _strVenueID = xmlVenue.id;

                ucVenueListItem oVenue = new ucVenueListItem(xmlVenue);
                oVenue.Location = new Point(3, y);
                oVenue.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
                oVenue.Width = pnlForm.Width - 3 * 2;

                pnlForm.Controls.Add(oVenue);

                y = oVenue.Location.Y + oVenue.Height + 3;
            }

            /////////////////////////////////////////////////////////////
            // user
            DotNetSquare.NetSquare.FourSquareUser xmlUser = xmlCheckin.user;
            if (xmlUser != null)
            {
                _strUserID = xmlUser.id;

                ucUserListItem oUser = new ucUserListItem(xmlUser);
                oUser.Location = new Point(3, y);
                oUser.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
                oUser.Width = pnlForm.Width - 3 * 2;

                pnlForm.Controls.Add(oUser);

                y = oUser.Location.Y + oUser.Height + 3;
            }

            ////////////////////////////////////////////////
            // shout
            pnlShout.Location = new Point(3, y);

            string strShout = xmlCheckin.shout;
            tbShout.Text = strShout;

            if (String.IsNullOrEmpty(strShout))
            {
                pnlShout.Visible = false;
                pnlShout.Height = 0;
            }
            else
            {
                y = pnlShout.Location.Y + pnlShout.Height + 3;
            }

            Cursor.Current = Cursors.Default;
        }
 public frmCheckinResults(DotNetSquare.NetSquare.FourSquareCheckin strXML)
 {
     InitializeComponent();
     Program.arrForm.Add(this);
     _strXML = strXML;
 }
예제 #18
0
        private void LoadData(DotNetSquare.NetSquare.FourSquareVenue xmlVenue, string strCreated)
        {
            //id
            _strVenueID = xmlVenue.id;

            //name
            _strVenueName = xmlVenue.name;
            lblName.Text = _strVenueName;

            //herenow
            if (strCreated == "")
            {
                DotNetSquare.NetSquare.FourSquareHereNow sqHereNow = xmlVenue.hereNow;

                if (sqHereNow != null)
                {
                    int iHereNow = sqHereNow.count;
                    if (iHereNow == 0)
                    {
                        lblHereNow.Text = "";
                    }
                    else if (iHereNow == 1)
                    {
                        lblHereNow.Text = "1 user here now";
                    }
                    else
                    {
                        lblHereNow.Text = iHereNow + " users here now";
                    }
                }
                else
                {
                    lblHereNow.Text = "";
                }
            }
            else
            {
                lblHereNow.Text = strCreated;
                lblHereNow.TextAlign = ContentAlignment.TopRight;
            }

            //primarycategory
            List<DotNetSquare.NetSquare.FourSquareCategory> xmlCategories = xmlVenue.categories;
            lblCategory.Text = "";
            foreach (DotNetSquare.NetSquare.FourSquareCategory xmlCategory in xmlCategories)
            {
                if (xmlCategory.primary)
                {
                    //nodename
                    _strCategory = xmlCategory.name;
                    lblCategory.Text = _strCategory;

                    //iconurl
                    _strIconURL = xmlCategory.icon;
                    pbIcon.Image = Program.getImageFromURL(_strIconURL);

                }
            }
            lblAddress.Text = Program.buildAddress(xmlVenue.location);

            _strLat = xmlVenue.location.Lat;
            _strLon = xmlVenue.location.Long;

            //distance
            string strDistance = xmlVenue.location.Distance;
            if (!String.IsNullOrEmpty(strDistance))
            {
                strDistance = Program.convertDistanceToKM(strDistance);
                strDistance = lblHereNow.Text + " " + strDistance + " away";
                lblHereNow.Text = strDistance.Trim();
            }
        }