예제 #1
0
 protected override void Dispose(bool disposing)
 {
     if (disposing)
     {
         this._timer.Enabled = false;
         if (this._activeTab != null)
         {
             this._activeTab.DisplayChanged -= new EventHandler(this.OnTabDisplayChanged);
             this._activeTab = null;
         }
         foreach (CommunityTab tab in this._tabs)
         {
             ((IDisposable) tab).Dispose();
         }
         this._tabs = null;
     }
     base.Dispose(disposing);
 }
예제 #2
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];
                         }
                     }
                 }
             }
         }
     }
 }
예제 #3
0
 private void OnToolBarButtonClick(object sender, ToolBarButtonClickEventArgs e)
 {
     if (e.Button == this._refreshButton)
     {
         this.UpdateDisplay(true);
     }
     else
     {
         int tag = (int) e.Button.Tag;
         CommunityTab tab = (CommunityTab) this._tabs[tag];
         if (tab != this._activeTab)
         {
             for (int i = 0; i < this._toolBar.Buttons.Count; i++)
             {
                 this._toolBar.Buttons[i].Pushed = false;
             }
             e.Button.Pushed = true;
             if (this._activeTab != null)
             {
                 this._activeTab.DisplayChanged -= new EventHandler(this.OnTabDisplayChanged);
             }
             this._activeTab = tab;
             this.UpdateDisplay(false);
             this._activeTab.DisplayChanged += new EventHandler(this.OnTabDisplayChanged);
         }
     }
 }
예제 #4
0
 public void SetOwner(CommunityTab owner)
 {
     this._owner = owner;
 }
예제 #5
0
 private void AddTab(CommunityTab tab)
 {
     int count = this._tabs.Count;
     this._tabs.Add(tab);
     this._buttonImages.Images.Add(tab.Glyph);
     ToolBarButton button = new ToolBarButton();
     button.ImageIndex = count + 1;
     button.Tag = count;
     button.ToolTipText = tab.Name;
     this._toolBar.Buttons.Add(button);
     if (count == 0)
     {
         button.Pushed = true;
         this._refreshButton.Enabled = tab.SupportsRefresh;
         this._activeTab = tab;
         if (base.IsHandleCreated)
         {
             this.UpdateDisplay(true);
         }
     }
 }
예제 #6
0
 private void GenerateSigningInDisplayPage(CommunityTab.CommunityPageBuilder builder)
 {
     builder.BeginNewSection(false);
     builder.AddImage(InfoGlyph).Padding = new BoxEdges(0, 1, 4, 1);
     builder.PushBold();
     builder.AddText("Signing-in...");
     builder.PopBold();
     builder.EndCurrentSection();
 }
예제 #7
0
 private void GenerateSignInDisplayPage(CommunityTab.CommunityPageBuilder builder)
 {
     builder.BeginNewSection(false);
     builder.AddImage(InfoGlyph).Padding = new BoxEdges(0, 1, 4, 1);
     builder.PushBold();
     builder.AddText("Please sign-in...");
     builder.PopBold();
     builder.EndCurrentSection();
     builder.AddSectionBreak();
     builder.BeginNewSection(20);
     builder.AddTextSpan("You can use the contact list feature to interact with your contacts in the '" + this._buddyGroup + "' group by signing into Windows Messenger service.");
     builder.EndCurrentSection();
     builder.AddSectionBreak();
     builder.BeginNewSection(20);
     builder.AddHyperLink("Sign-in", "SignIn").ToolTip = "Click here to sign-in now";
     builder.EndCurrentSection();
 }
예제 #8
0
 private void GenerateErrorDisplayPage(CommunityTab.CommunityPageBuilder builder)
 {
     builder.BeginNewSection(false);
     builder.AddImage(ErrorGlyph).Padding = new BoxEdges(0, 1, 4, 1);
     builder.PushBold();
     builder.AddText("Error...");
     builder.PopBold();
     builder.EndCurrentSection();
     builder.AddSectionBreak();
     builder.BeginNewSection(20);
     builder.AddTextSpan("Unable to access the Windows Messenger service and display contacts in the '" + this._buddyGroup + "' contact group. To use the contact list feature you must have Windows Messenger version 4.5 or greater on your computer.");
     builder.EndCurrentSection();
     builder.AddSectionBreak();
     builder.BeginNewSection(20);
     builder.AddHyperLink("Click here", "Messenger").ToolTip = "http://messenger.msn.com";
     builder.AddTextSpan(" to download and install the latest version of Windows Messenger. Once you have installed it, click the 'Refresh' button above.");
     builder.EndCurrentSection();
 }
예제 #9
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();
        }
예제 #10
0
 protected override void GenerateDisplayPage(CommunityTab.CommunityPageBuilder builder)
 {
     base.GenerateDisplayPage(builder);
     builder.SetPageWatermark(new Watermark(WatermarkImage, WatermarkPlacement.BottomRight));
     if (this._messenger == null)
     {
         try
         {
             Interop.Messenger messenger = new Interop.Messenger();
             this._messenger = (Interop.IMessenger2) messenger;
         }
         catch
         {
         }
     }
     builder.AddHeading(this._buddyGroup, null);
     builder.AddHorizontalLine();
     if (this._messenger == null)
     {
         this.GenerateErrorDisplayPage(builder);
     }
     else
     {
         try
         {
             int myStatus = this._messenger.GetMyStatus();
             if ((myStatus == 0) || (myStatus == 1))
             {
                 this.GenerateSignInDisplayPage(builder);
             }
             else
             {
                 this.GenerateContactsDisplayPage(builder);
                 this._signingIn = false;
             }
         }
         catch
         {
             if (this._signingIn)
             {
                 this.GenerateSigningInDisplayPage(builder);
             }
             else
             {
                 this.GenerateErrorDisplayPage(builder);
             }
         }
     }
 }