Example #1
0
 protected override void GenerateDisplayPage(CommunityTab.CommunityPageBuilder builder)
 {
     base.GenerateDisplayPage(builder);
     IApplicationIdentity service = (IApplicationIdentity) base.ServiceProvider.GetService(typeof(IApplicationIdentity));
     if (service != null)
     {
         IDictionary webLinks = service.WebLinks;
         if ((webLinks != null) && (webLinks.Count != 0))
         {
             for (int i = 0; i < this._headings.Length; i++)
             {
                 string str = this._sectionNames[i];
                 if ((str != null) && (str.Length != 0))
                 {
                     if (i != 0)
                     {
                         builder.AddSectionBreak();
                     }
                     WebLink link = (WebLink) webLinks[str + "0"];
                     if (link != null)
                     {
                         string text1 = this._headings[i];
                         builder.AddHeading(this._headings[i], null);
                         builder.AddHorizontalLine();
                         int num2 = 0;
                         while (link != null)
                         {
                             builder.AddHyperLinkWithGlyph(link.Title, link.Url, null, LinkImage);
                             num2++;
                             link = (WebLink) webLinks[str + num2];
                         }
                     }
                 }
             }
         }
     }
 }
Example #2
0
        private void GenerateContactsDisplayPage(CommunityTab.CommunityPageBuilder builder)
        {
            Interop.IMessengerGroup group = null;
            int num = 0;
            if (this._messenger != null)
            {
                Interop.IMessengerGroups myGroups = (Interop.IMessengerGroups) this._messenger.GetMyGroups();
                int count = myGroups.GetCount();
                for (int i = 0; i < count; i++)
                {
                    Interop.IMessengerGroup group2 = (Interop.IMessengerGroup) myGroups.Item(i);
                    string name = group2.GetName();
                    if ((name != null) && name.Equals(this._buddyGroup))
                    {
                        group = group2;
                    }
                }
                if (group == null)
                {
                    group = (Interop.IMessengerGroup) this._messenger.CreateGroup(this._buddyGroup, this._messenger.GetMyServiceId());
                }
            }
            if (group != null)
            {
                Interop.IMessengerContacts contacts = (Interop.IMessengerContacts) group.GetContacts();
                if (contacts != null)
                {
                    num = contacts.GetCount();
                    for (int j = 0; j < num; j++)
                    {
                        string str2;
                        Interop.IMessengerContact contact = (Interop.IMessengerContact) contacts.Item(j);
                        if (contact.GetBlocked())
                        {
                            goto Label_0165;
                        }
                        Image glyph = null;
                        int status = contact.GetStatus();
                        if (status <= 10)
                        {
                            switch (status)
                            {
                                case 1:
                                    goto Label_0121;

                                case 2:
                                    glyph = BuddyGlyph;
                                    goto Label_0128;

                                case 10:
                                    goto Label_0118;
                            }
                            goto Label_0121;
                        }
                        if ((status != 0x12) && (status != 0x22))
                        {
                            goto Label_0121;
                        }
                        glyph = AwayBuddyGlyph;
                        goto Label_0128;
                    Label_0118:
                        glyph = BusyBuddyGlyph;
                        goto Label_0128;
                    Label_0121:
                        glyph = OfflineBuddyGlyph;
                    Label_0128:
                        str2 = contact.GetSigninName();
                        string serviceId = contact.GetServiceId();
                        string friendlyName = contact.GetFriendlyName();
                        builder.AddHyperLinkWithGlyph(friendlyName, new string[] { str2, serviceId }, str2, glyph);
                    Label_0165:;
                    }
                }
            }
            if (num == 0)
            {
                builder.BeginNewSection(false);
                builder.AddImage(InfoGlyph).Padding = new BoxEdges(0, 1, 4, 1);
                builder.PushBold();
                builder.AddText("No contacts found...");
                builder.PopBold();
                builder.EndCurrentSection();
                builder.AddSectionBreak();
                builder.BeginNewSection(20);
                builder.AddTextSpan("There are currently no contacts present in your '" + this._buddyGroup + "' group in Windows Messenger to display here.");
                builder.EndCurrentSection();
            }
            else
            {
                builder.AddSectionBreak();
                builder.AddSectionBreak();
                builder.AddHorizontalLine();
                builder.BeginNewSection(false);
                builder.AddImage(InfoGlyph).Padding = new BoxEdges(0, 1, 4, 1);
                builder.PushBold();
                builder.AddText("Organizing your contacts...");
                builder.PopBold();
                builder.EndCurrentSection();
            }
            builder.AddSectionBreak();
            builder.BeginNewSection(20);
            builder.AddTextSpan("You can use Windows Messenger to organize your contact list, so that you have other contacts appear in this group.");
            builder.EndCurrentSection();
        }