private void RefreshTimeLineFeed(TimeLinePageControl tlp, CommentData.PostData feed)
        {
            tlp.SP_Comments?.Children?.Clear();
            tlp.SP_Content?.Children?.Clear();
            string imgUri = feed.actor.profile_image_url2 ?? feed.actor.profile_thumbnail_url;

            if (Properties.Settings.Default.GIFProfile && feed.actor.profile_video_url_square_small != null)
            {
                imgUri = feed.actor.profile_video_url_square_small;
            }
            GlobalHelper.AssignImage(tlp.IMG_Profile, imgUri);

            MainWindow.SetClickObject(tlp.IMG_Profile);
            tlp.IMG_Profile.Tag = feed.actor.id;
            tlp.IMG_Profile.MouseLeftButtonDown += GlobalHelper.SubContentMouseEvent;

            tlp.TB_Name.Text = feed.actor.display_name;
            tlp.TB_Date.Text = PostWindow.GetTimeString(feed.created_at);
            GlobalHelper.RefreshContent(feed.content_decorators, feed.content, tlp.TB_Content);
            if (feed.media_type != null && feed.media != null)
            {
                RefreshImageContent(feed.media, tlp.SP_Content);
            }

            bool willDisplayInfo = false;

            if (feed.comment_count > 0)
            {
                willDisplayInfo = true;

                tlp.TB_CommentCount.Visibility = Visibility.Visible;
                var txt = new Bold(new Run($" {feed.comment_count.ToString()}  "))
                {
                    FontSize = 12
                };
                tlp.TB_CommentCount.Inlines.Add(txt);
            }
            else
            {
                tlp.TB_CommentCount.Visibility = Visibility.Collapsed;
                tlp.SP_Comments.Margin         = new Thickness(0, 0, 0, 0);
            }

            if (feed.like_count > 0)
            {
                willDisplayInfo             = true;
                tlp.TB_LikeCount.Visibility = Visibility.Visible;
                var txt = new Bold(new Run($" {feed.like_count.ToString()}  "));
                txt.FontSize = 12;
                tlp.TB_LikeCount.Inlines.Add(txt);
            }
            else
            {
                tlp.TB_LikeCount.Visibility = Visibility.Collapsed;
            }

            int shares = feed.share_count - feed.sympathy_count;

            if (shares > 0)
            {
                willDisplayInfo = true;
                tlp.TB_ShareCount.Visibility = Visibility.Visible;
                var txt = new Bold(new Run($" {shares.ToString()}  "));
                txt.FontSize = 12;
                tlp.TB_ShareCount.Inlines.Add(txt);
            }
            else
            {
                tlp.TB_ShareCount.Visibility = Visibility.Collapsed;
            }

            if (feed.sympathy_count > 0)
            {
                willDisplayInfo           = true;
                tlp.TB_UpCount.Visibility = Visibility.Visible;
                var txt = new Bold(new Run($" {feed.sympathy_count.ToString()}  "));
                txt.FontSize = 12;
                tlp.TB_UpCount.Inlines.Add(txt);
            }
            else
            {
                tlp.TB_UpCount.Visibility = Visibility.Collapsed;
            }

            if (!willDisplayInfo)
            {
                tlp.RD_CommentInfos.Height = new GridLength(0);
            }

            if (feed.closest_with_tags != null && feed.closest_with_tags.Count > 0)
            {
                Separator sep = new Separator();
                tlp.SP_Main.Children.Add(sep);
                sep.Margin = new Thickness(0, 5, 0, 5);
                var TB_Closest_With = GlobalHelper.GetWithFriendTB(feed);
                tlp.SP_Main.Children.Add(TB_Closest_With);
            }
        }
        public TimeLinePageControl GenerateTimeLinePageControl(CommentData.PostData feed)
        {
            TimeLinePageControl tlp = new TimeLinePageControl();

            if (Properties.Settings.Default.ScrollTimeline)
            {
                tlp.SV_Content.MaxHeight = 300;
            }
            try
            {
                try
                {
                    RefreshTimeLineFeed(tlp, feed);
                }
                catch (Exception)
                {
                    tlp.TB_Content.Text = "";
                    tlp.TB_Content.Inlines.Clear();
                    tlp.TB_Content.Inlines.Add(new Bold(new Run("(오류 : 삭제 등의 원인으로 인해 글 원본을 가져올 수 없습니다)")));
                    tlp.GD_Share.Visibility = Visibility.Collapsed;
                }

                if (feed.scrap != null)
                {
                    GlobalHelper.RefreshScrap(feed.scrap, tlp.Scrap_Main);
                }

                MainWindow.SetClickObject(tlp.Card);

                tlp.Card.Tag       = feed.id;
                tlp.TB_Content.Tag = feed.id;
                tlp.SP_Content.Tag = feed.id;

                tlp.Card.MouseLeftButtonDown        += MainContentMouseEvent;
                tlp.TB_Content.MouseRightButtonDown += (s, e) =>
                {
                    Clipboard.SetDataObject(feed.content);
                    MessageBox.Show("클립보드에 글 내용이 복사됐습니다.");
                    e.Handled = true;
                };

                if (feed.verb.Equals("share"))
                {
                    if (feed.@object?.share_count == null || feed.@object?.id == null || feed.@object?.actor?.profile_thumbnail_url == null)
                    {
                        tlp.TB_Content.Inlines.Add(new Bold(new Run("\n(오류 : 삭제 등의 원인으로 인해 공유글 원본을 가져올 수 없습니다)")));
                        tlp.GD_Share.Visibility = Visibility.Collapsed;
                    }
                    else
                    {
                        tlp.GD_ShareCount.Visibility      = Visibility.Visible;
                        tlp.TB_GD_ShareCount.Text         = [email protected]_count.ToString();
                        tlp.GD_Share.Tag                  = [email protected];
                        tlp.GD_Share.MouseLeftButtonDown += ShareContentMouseEvent;

                        string imgUri = [email protected]_image_url2 ?? [email protected]_thumbnail_url;
                        if (Properties.Settings.Default.GIFProfile && [email protected]_video_url_square_small != null)
                        {
                            imgUri = [email protected]_video_url_square_small;
                        }
                        GlobalHelper.AssignImage(tlp.IMG_ProfileShare, imgUri);
                        MainWindow.SetClickObject(tlp.IMG_ProfileShare);

                        tlp.IMG_ProfileShare.Tag = [email protected];
                        tlp.IMG_ProfileShare.MouseLeftButtonDown += GlobalHelper.SubContentMouseEvent;

                        tlp.TB_NameShare.Text = [email protected]_name;
                        tlp.TB_DateShare.Text = PostWindow.GetTimeString([email protected]_at);
                        GlobalHelper.RefreshContent([email protected]_decorators, [email protected], tlp.TB_ShareContent);

                        tlp.TB_ShareContent.MouseRightButtonDown += (s, e) =>
                        {
                            Clipboard.SetDataObject([email protected]);
                            MessageBox.Show("클립보드에 공유한 글 내용이 복사됐습니다.");
                            e.Handled = true;
                        };

                        if ([email protected]_type != null && [email protected] != null)
                        {
                            RefreshImageContent([email protected], tlp.SP_ShareContent);
                        }

                        if ([email protected] != null)
                        {
                            GlobalHelper.RefreshScrap([email protected], tlp.Scrap_Share);
                        }
                        if ([email protected]_with_tags != null && [email protected]_with_tags.Count > 0)
                        {
                            Separator sep = new Separator();
                            tlp.SP_ShareContent.Children.Add(sep);
                            sep.Margin = new Thickness(0, 5, 0, 5);
                            var TB_Closest_With = GlobalHelper.GetWithFriendTB(feed.@object);
                            tlp.SP_ShareContent.Children.Add(TB_Closest_With);
                            tlp.SP_ShareContent.Visibility = Visibility.Visible;
                        }
                    }
                }
                else
                {
                    tlp.GD_Share.Visibility = Visibility.Collapsed;
                }
            }
            catch (Exception e)
            {
                tlp.SP_Content.Background = Brushes.DarkRed;
                tlp.TB_Name.Text          = "오류!";
                tlp.TB_Content.Text       = e.StackTrace;
            }
            return(tlp);
        }