Beispiel #1
0
        //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        public static string StrImagesToJson(string strImagesFromTweet_I)
        {
            if (string.IsNullOrWhiteSpace(strImagesFromTweet_I))
            {
                return(null);
            }

            string[] arrstrImages = TweetJsonFormat.ParseImages(strImagesFromTweet_I);

            return(JsonConvert.SerializeObject(arrstrImages));
        }
Beispiel #2
0
        //-------------------------------------------------------------------------------------------------------------
        //                                                  //METHODS
        //-------------------------------------------------------------------------------------------------------------
        public Tweet ToTweet()
        {
            Tweet tweetToReturn = new Tweet();

            tweetToReturn.Id            = this.Id;
            tweetToReturn.Likes         = TweetJsonFormat.ProcessLikesFromString(this.Likes);
            tweetToReturn.DatePublished = this.DatePublished;
            tweetToReturn.Text          = this.Text;
            tweetToReturn.Images        = TweetJsonFormat.ProcessIncomingArrayOfImages(this.Images);
            tweetToReturn.PersonId      = this.PersonId;
            tweetToReturn.ResponseId    = this.ResponseId;

            return(tweetToReturn);
        }
Beispiel #3
0
        //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        public TweetJsonFormat(TweetViewModel tweetViewModel)
        {
            this.Id            = tweetViewModel.Id;
            this.DatePublished = tweetViewModel.DatePublished;
            this.Text          = tweetViewModel.Text;
            this.PersonId      = tweetViewModel.PersonId;
            this.ResponseId    = tweetViewModel.ResponseId;

            // this.Likes = tweetViewModel.Likes;
            // this.Images = tweetViewModel.Images;
            this.Likes = Like.ParseLikes(tweetViewModel.Likes);

            this.Images = TweetJsonFormat.ParseImages(tweetViewModel.Images);
        }
Beispiel #4
0
        //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

        public static string ProcessIncomingArrayOfImages(string strImagesFromTweet_I)
        {
            if (string.IsNullOrWhiteSpace(strImagesFromTweet_I))
            {
                return(null);
            }

            string[] arrstrImages = JsonConvert.DeserializeObject <string[]>(strImagesFromTweet_I);

            System.Diagnostics.Debug.WriteLine("IMAGENES!!!!!!!!!!!!!!");
            foreach (string strImage in arrstrImages)
            {
                System.Diagnostics.Debug.WriteLine(strImage);
            }

            return(TweetJsonFormat.ImagesToStr(arrstrImages));
        }
Beispiel #5
0
        //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        public static string ProcessLikesFromString(string strLikes_I)
        {
            Like[] arrlikeLikes = JsonConvert.DeserializeObject <Like[]>(strLikes_I);

            return(TweetJsonFormat.LikesToStr(arrlikeLikes));
        }