コード例 #1
0
ファイル: LinksCommunityTab.cs プロジェクト: ikvm/webmatrix
 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];
                         }
                     }
                 }
             }
         }
     }
 }
コード例 #2
0
ファイル: BuddyCommunityTab.cs プロジェクト: ikvm/webmatrix
 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);
             }
         }
     }
 }