Beispiel #1
0
 public void Setup()
 {
     //Get the Fundamentals List
     flfundamentals.Controls.Clear();
     foreach (var type in Array.FindAll(ReflectMan.Types, t => t.GetInterfaces().Contains(typeof(IShiftnetSite)) && t.BaseType == typeof(UserControl) && Shiftorium.UpgradeAttributesUnlocked(t)))
     {
         var attrs     = type.GetCustomAttributes(false);
         var attribute = attrs.FirstOrDefault(x => x is ShiftnetSiteAttribute) as ShiftnetSiteAttribute;
         if (attribute != null)
         {
             if (attrs.OfType <ShiftnetFundamentalAttribute>().Any())
             {
                 var dash = new Label();
                 dash.Text     = " - ";
                 dash.AutoSize = true;
                 flfundamentals.Controls.Add(dash);
                 dash.Show();
                 var link = new LinkLabel();
                 link.Text   = attribute.Name;
                 link.Click += (o, a) =>
                 {
                     GoToUrl?.Invoke(attribute.Url);
                 };
                 flfundamentals.Controls.Add(link);
                 flfundamentals.SetFlowBreak(link, true);
                 link.Show();
                 link.LinkColor = SkinEngine.LoadedSkin.ControlTextColor;
             }
         }
     }
 }
Beispiel #2
0
 public void SetupListing()
 {
     fllist.Controls.Clear();
     foreach (var type in Array.FindAll(ReflectMan.Types, t => t.GetInterfaces().Contains(typeof(IShiftnetSite))))
     {
         var attr = type.GetCustomAttributes(false).FirstOrDefault(x => x is ShiftnetSiteAttribute) as ShiftnetSiteAttribute;
         if (attr != null)
         {
             if (attr.Url.StartsWith("shiftnet/"))
             {
                 var lnk = new LinkLabel();
                 lnk.LinkColor = SkinEngine.LoadedSkin.ControlTextColor;
                 lnk.Text      = attr.Name;
                 var desc = new Label();
                 desc.AutoSize    = true;
                 lnk.AutoSize     = true;
                 desc.MaximumSize = new Size(this.Width / 3, 0);
                 desc.Text        = attr.Description;
                 desc.Padding     = new Padding
                 {
                     Bottom = 25,
                     Top    = 0,
                     Left   = 10,
                     Right  = 10
                 };
                 lnk.Click += (o, a) =>
                 {
                     GoToUrl?.Invoke(attr.Url);
                 };
                 fllist.Controls.Add(lnk);
                 fllist.Controls.Add(desc);
                 ControlManager.SetupControls(lnk);
                 lnk.Show();
                 desc.Show();
             }
         }
     }
 }
Beispiel #3
0
 private void btnping_Click(object sender, EventArgs e)
 {
     GoToUrl?.Invoke("shiftnet/shiftsoft/ping");
 }