Пример #1
0
        private InlinesCollection ComposeInlinesForFollowers(Counters counters)
        {
            InlinesCollection inlinesCollection = new InlinesCollection();
            Run        run        = new Run();
            FontFamily fontFamily = new FontFamily("Segoe WP Semibold");

            run.FontFamily = fontFamily;
            string str = UIStringFormatterHelper.FormatNumberOfSomething(counters.followers, "{0} ", "{0} ", "{0} ", true, null, false);

            run.Text = str;
            inlinesCollection.Add((Inline)run);
            inlinesCollection.Add((Inline) new Run()
            {
                Text = UIStringFormatterHelper.FormatNumberOfSomething(counters.followers, CommonResources.OneFollowerFrm, CommonResources.TwoFourFollowersFrm, CommonResources.FiveFollowersFrm, false, null, false)
            });
            return(inlinesCollection);
        }
Пример #2
0
        private InlinesCollection ComposeInlinesForMembers()
        {
            InlinesCollection inlinesCollection1 = new InlinesCollection();
            Group             group = this._groupData.group;
            InlinesCollection inlinesCollection2 = inlinesCollection1;
            Run        run1        = new Run();
            FontFamily fontFamily1 = new FontFamily("Segoe WP Semibold");

            ((TextElement)run1).FontFamily = fontFamily1;
            string str1 = UIStringFormatterHelper.FormatForUI((long)group.members_count) + Convert.ToChar(160).ToString();

            run1.Text = str1;
            inlinesCollection2.Add((Inline)run1);
            bool   flag = group.GroupType == GroupType.PublicPage;
            Run    run2 = new Run();
            string str2 = UIStringFormatterHelper.FormatNumberOfSomething(group.members_count, flag ? CommonResources.OneSubscriberFrm : CommonResources.OneMemberFrm, flag ? CommonResources.TwoFourSubscribersFrm : CommonResources.TwoFourMembersFrm, flag ? CommonResources.FiveSubscribersFrm : CommonResources.FiveMembersFrm, false, null, false);

            run2.Text = str2;
            Run run3 = run2;

            if (this._groupData.friendsCount > 0)
            {
                Run    run4 = run3;
                string str3 = run4.Text + " · ";
                run4.Text = str3;
                inlinesCollection1.Add((Inline)run3);
                InlinesCollection inlinesCollection3 = inlinesCollection1;
                Run        run5        = new Run();
                FontFamily fontFamily2 = new FontFamily("Segoe WP Semibold");
                ((TextElement)run5).FontFamily = fontFamily2;
                string str4 = UIStringFormatterHelper.FormatForUI((long)this._groupData.friendsCount) + Convert.ToChar(160).ToString();
                run5.Text = str4;
                inlinesCollection3.Add((Inline)run5);
                InlinesCollection inlinesCollection4 = inlinesCollection1;
                Run    run6 = new Run();
                string str5 = UIStringFormatterHelper.FormatNumberOfSomething(this._groupData.friendsCount, CommonResources.OneFriendFrm, CommonResources.TwoFourFriendsFrm, CommonResources.FiveFriendsFrm, false, null, false);
                run6.Text = str5;
                inlinesCollection4.Add((Inline)run6);
            }
            else
            {
                inlinesCollection1.Add((Inline)run3);
            }
            return(inlinesCollection1);
        }
Пример #3
0
        private InlinesCollection ComposeInlinesForFriends(Counters counters)
        {
            InlinesCollection inlinesCollection1 = new InlinesCollection();
            InlinesCollection inlinesCollection2 = inlinesCollection1;
            Run        run1        = new Run();
            FontFamily fontFamily1 = new FontFamily("Segoe WP Semibold");

            ((TextElement)run1).FontFamily = fontFamily1;
            string str1 = UIStringFormatterHelper.FormatNumberOfSomething(counters.friends, "{0} ", "{0} ", "{0} ", true, null, false);

            run1.Text = str1;
            inlinesCollection2.Add((Inline)run1);
            Run    run2 = new Run();
            string str2 = UIStringFormatterHelper.FormatNumberOfSomething(counters.friends, CommonResources.OneFriendFrm, CommonResources.TwoFourFriendsFrm, CommonResources.FiveFriendsFrm, false, null, false);

            run2.Text = str2;
            Run run3 = run2;

            if (counters.mutual_friends > 0)
            {
                Run    run4 = run3;
                string str3 = run4.Text + " · ";
                run4.Text = str3;
                inlinesCollection1.Add((Inline)run3);
                InlinesCollection inlinesCollection3 = inlinesCollection1;
                Run        run5        = new Run();
                FontFamily fontFamily2 = new FontFamily("Segoe WP Semibold");
                ((TextElement)run5).FontFamily = fontFamily2;
                string str4 = UIStringFormatterHelper.FormatNumberOfSomething(counters.mutual_friends, "{0} ", "{0} ", "{0} ", true, null, false);
                run5.Text = str4;
                inlinesCollection3.Add((Inline)run5);
                InlinesCollection inlinesCollection4 = inlinesCollection1;
                Run    run6 = new Run();
                string str5 = UIStringFormatterHelper.FormatNumberOfSomething(counters.mutual_friends, CommonResources.OneMutualFrm, CommonResources.TwoFourMutualFrm, CommonResources.FiveMutualFrm, false, null, false);
                run6.Text = str5;
                inlinesCollection4.Add((Inline)run6);
            }
            else
            {
                inlinesCollection1.Add((Inline)run3);
            }
            return(inlinesCollection1);
        }
Пример #4
0
        private InlinesCollection ComposeInlinesForFriends(Counters counters)
        {
            InlinesCollection inlinesCollection1 = new InlinesCollection();
            InlinesCollection inlinesCollection2 = inlinesCollection1;
            Run        run1        = new Run();
            FontFamily fontFamily1 = new FontFamily("Segoe WP Semibold");

            run1.FontFamily = fontFamily1;
            string str1 = UIStringFormatterHelper.FormatNumberOfSomething(counters.friends, "{0} ", "{0} ", "{0} ", true, null, false);

            run1.Text = str1;
            inlinesCollection2.Add((Inline)run1);
            Run run2 = new Run()
            {
                Text = UIStringFormatterHelper.FormatNumberOfSomething(counters.friends, CommonResources.OneFriendFrm, CommonResources.TwoFourFriendsFrm, CommonResources.FiveFriendsFrm, false, null, false)
            };

            if (counters.mutual_friends > 0)
            {
                run2.Text += " · ";
                inlinesCollection1.Add((Inline)run2);
                InlinesCollection inlinesCollection3 = inlinesCollection1;
                Run        run3        = new Run();
                FontFamily fontFamily2 = new FontFamily("Segoe WP Semibold");
                run3.FontFamily = fontFamily2;
                string str2 = UIStringFormatterHelper.FormatNumberOfSomething(counters.mutual_friends, "{0} ", "{0} ", "{0} ", true, null, false);
                run3.Text = str2;
                inlinesCollection3.Add((Inline)run3);
                inlinesCollection1.Add((Inline) new Run()
                {
                    Text = UIStringFormatterHelper.FormatNumberOfSomething(counters.mutual_friends, CommonResources.OneMutualFrm, CommonResources.TwoFourMutualFrm, CommonResources.FiveMutualFrm, false, null, false)
                });
            }
            else
            {
                inlinesCollection1.Add((Inline)run2);
            }
            return(inlinesCollection1);
        }