コード例 #1
0
 protected Event(GRLocation location, string dateTimeStamp, int ID, string eventType)
 {
     this.eventLocation = location;
     this.dateTimeStamp = dateTimeStamp;
     this.ID            = ID;
     this.eventType     = eventType;
 }
コード例 #2
0
        public void GetLocationTest()
        {
            GRLocation expectedLocation = new GRLocation(10, 12);
            TweetEvent te            = new TweetEvent(expectedLocation, "dateTime", "some text");
            GRLocation eventLocation = te.EventLocation;

            Assert.AreEqual(expectedLocation, eventLocation);
        }
コード例 #3
0
        public void GRLocationTest()
        {
            double     lat       = 0;
            double     longt     = 0;
            GRLocation location1 = new GRLocation(lat, longt);

            Assert.AreEqual(lat, location1.Latitude);
            Assert.AreEqual(longt, location1.Longitude);
        }
コード例 #4
0
        private static GRLocation GetLocationFromNode(XmlNode parent, XmlNamespaceManager nsmgr)
        {
            XmlNode locationNode = GetNodeWithTag("location", parent, nsmgr);
            XmlNode latNode      = GetNodeWithTag("lat", locationNode, nsmgr);
            XmlNode longNode     = GetNodeWithTag("long", locationNode, nsmgr);

            GRLocation location = new GRLocation(Convert.ToDouble(latNode.InnerText), Convert.ToDouble(longNode.InnerText));

            return(location);
        }
コード例 #5
0
        public void SetLocationTest()
        {
            GRLocation original         = new GRLocation(0, 0);
            GRLocation expectedLocation = new GRLocation(10, 12);
            TweetEvent te = new TweetEvent(original, "dateTime", "some text");

            te.EventLocation = expectedLocation;

            Assert.AreEqual(expectedLocation, te.EventLocation);
        }
コード例 #6
0
        private static StatusUpdateEvent ProcessStatusEvent(XmlNode eventNode, XmlNode statusNode, XmlNamespaceManager nsmgr)
        {
            XmlNode idNode         = GetNodeWithTag("eventid", eventNode, nsmgr);
            XmlNode dateTimeNode   = GetNodeWithTag("datetimestamp", statusNode, nsmgr);
            XmlNode statusTextNode = GetNodeWithTag("text", statusNode, nsmgr);

            string     stringID = idNode.InnerText.Substring(2);
            int        ID       = Convert.ToInt32(stringID);
            GRLocation location = GetLocationFromNode(statusNode, nsmgr);

            return(new StatusUpdateEvent(location, dateTimeNode.InnerText, statusTextNode.InnerText, ID));
        }
コード例 #7
0
        private static PhotoEvent ProcessPhotoEvent(XmlNode eventNode, XmlNode photoEventNode, XmlNamespaceManager nsmgr)
        {
            XmlNode    idNode       = GetNodeWithTag("eventid", eventNode, nsmgr);
            XmlNode    dateTimeNode = GetNodeWithTag("datetimestamp", photoEventNode, nsmgr);
            XmlNode    photoNode    = GetNodeWithTag("photo", photoEventNode, nsmgr);
            XmlNode    filepathNode = GetNodeWithTag("filepath", photoEventNode, nsmgr);
            GRLocation location     = GetLocationFromNode(photoEventNode, nsmgr);

            string stringID = idNode.InnerText.Substring(2);
            int    ID       = Convert.ToInt32(stringID);

            return(new PhotoEvent(location, dateTimeNode.InnerText, filepathNode.InnerText, ID));
        }
コード例 #8
0
        private static void Write(string ns, XmlTextWriter writer, GRLocation location)
        {
            writer.WriteStartElement(ns + "location");

            writer.WriteStartElement(ns + "lat");
            writer.WriteString(location.Latitude.ToString());
            writer.WriteEndElement();

            writer.WriteStartElement(ns + "long");
            writer.WriteString(location.Longitude.ToString());
            writer.WriteEndElement();

            writer.WriteEndElement();
        }
コード例 #9
0
        private static VideoEvent ProcessVideoEvent(XmlNode eventNode, XmlNode videoEventNode, XmlNamespaceManager nsmgr)
        {
            XmlNode    idNode        = GetNodeWithTag("eventid", eventNode, nsmgr);
            XmlNode    startTimeNode = GetNodeWithTag("start-time", videoEventNode, nsmgr);
            XmlNode    endTimeNode   = GetNodeWithTag("end-time", videoEventNode, nsmgr);
            XmlNode    dtStartNode   = GetNodeWithTag("datetimestamp", startTimeNode, nsmgr);
            XmlNode    dtEndNode     = GetNodeWithTag("datetimestamp", endTimeNode, nsmgr);
            XmlNode    filepathNode  = GetNodeWithTag("filepath", videoEventNode, nsmgr);
            GRLocation location      = GetLocationFromNode(videoEventNode, nsmgr);

            string stringID = idNode.InnerText.Substring(2);
            int    ID       = Convert.ToInt32(stringID);

            return(new VideoEvent(location, filepathNode.InnerText, dtStartNode.InnerText, dtEndNode.InnerText, ID));
        }
コード例 #10
0
 public StatusUpdateEvent(GRLocation location, string dateTimeStamp, string text, int ID) : base(location, dateTimeStamp, ID, "STATUS")
 {
     this.statusText = text;
 }
コード例 #11
0
 public PhotoEvent(GRLocation location, string dateTimeStamp, string photoFilePath, int ID) : base(location, dateTimeStamp, ID, "PHOTO")
 {
     this.photoFilePath = photoFilePath;
 }
コード例 #12
0
 public TweetEvent(GRLocation location, string dateTimeStamp, string tweetText, int ID) : base(location, dateTimeStamp, ID, "TWEET")
 {
     this.tweetText = tweetText;
 }