aboutsummaryrefslogtreecommitdiff
path: root/ShiftOS.WinForms/ShiftnetSites/DesktopWidgetWebsite.cs
diff options
context:
space:
mode:
authorwilliam341 <[email protected]>2017-05-28 12:37:00 -0700
committerGitHub <[email protected]>2017-05-28 12:37:00 -0700
commit771c20cfb3a703e0f1550fdcf9eb07b78298c944 (patch)
tree59cb532e15ebff313fdba2be264d78ec0033f407 /ShiftOS.WinForms/ShiftnetSites/DesktopWidgetWebsite.cs
parent496b0cbf8659c99203f48210fd39c572400ae623 (diff)
parentc7ba7d733c756d196f98dd4533289a1ef4db715f (diff)
downloadshiftos_thereturn-771c20cfb3a703e0f1550fdcf9eb07b78298c944.tar.gz
shiftos_thereturn-771c20cfb3a703e0f1550fdcf9eb07b78298c944.tar.bz2
shiftos_thereturn-771c20cfb3a703e0f1550fdcf9eb07b78298c944.zip
Merge pull request #1 from shiftos-game/master
welp, no longer a dev.
Diffstat (limited to 'ShiftOS.WinForms/ShiftnetSites/DesktopWidgetWebsite.cs')
-rw-r--r--ShiftOS.WinForms/ShiftnetSites/DesktopWidgetWebsite.cs92
1 files changed, 92 insertions, 0 deletions
diff --git a/ShiftOS.WinForms/ShiftnetSites/DesktopWidgetWebsite.cs b/ShiftOS.WinForms/ShiftnetSites/DesktopWidgetWebsite.cs
new file mode 100644
index 0000000..efb0a9b
--- /dev/null
+++ b/ShiftOS.WinForms/ShiftnetSites/DesktopWidgetWebsite.cs
@@ -0,0 +1,92 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Drawing;
+using System.Data;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+using ShiftOS.Engine;
+using ShiftOS.WinForms.Tools;
+using ShiftOS.WinForms.Applications;
+using Newtonsoft.Json;
+using static ShiftOS.Objects.ShiftFS.Utils;
+
+namespace ShiftOS.WinForms.ShiftnetSites
+{
+ [ShiftnetSite("shiftnet/superdesk", "SuperDesk", "Empower the ShiftOS Desktop like never before.")]
+ [ShiftnetFundamental]
+ public partial class DesktopWidgetWebsite : UserControl, Engine.IShiftnetSite
+ {
+ public DesktopWidgetWebsite()
+ {
+ InitializeComponent();
+
+ }
+
+ public event Action GoBack;
+ public event Action<string> GoToUrl;
+
+ public void OnSkinLoad()
+ {
+ ControlManager.SetupControls(this);
+ this.pictureBox1.Left = (this.Width - pictureBox1.Width) / 2;
+ ControlManager.ControlSetup += (ctrl) =>
+ {
+ try
+ {
+ this.Invoke(new Action(() =>
+ {
+ lbwhatissuperdesk.Left = (this.Width - lbwhatissuperdesk.Width) / 2;
+ lbthisissuperdesk.Top = lbwhatissuperdesk.Top + lbwhatissuperdesk.Height + 10;
+ lbthisissuperdesk.Left = (this.Width - lbthisissuperdesk.Width) / 2;
+
+ lbgetthepackage.Top = lbthisissuperdesk.Top + lbthisissuperdesk.Height + 10;
+ lbgetthepackage.Left = (this.Width - lbgetthepackage.Width) / 2;
+
+ lbpackagedesc.Top = lbgetthepackage.Top + lbgetthepackage.Height + 10;
+ lbpackagedesc.Left = (this.Width - lbpackagedesc.Width) / 2;
+
+ lnkdownload.Top = lbpackagedesc.Top + lbpackagedesc.Height + 10;
+ lnkdownload.Left = (this.Width - lnkdownload.Width) / 2;
+
+ lnkdownload.LinkColor = lbpackagedesc.ForeColor;
+ }));
+ }
+ catch
+ {
+ }
+ };
+ }
+
+ public void OnUpgrade()
+ {
+ }
+
+ public void Setup()
+ {
+ this.HorizontalScroll.Maximum = 0;
+ this.AutoScroll = false;
+ this.VerticalScroll.Visible = false;
+ this.AutoScroll = true;
+
+ }
+
+ private void lnkdownload_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
+ {
+ var attrib = typeof(Applications.WidgetManagerFrontend).GetCustomAttributes(false).FirstOrDefault(x => x is StpContents) as StpContents;
+ if(attrib != null)
+ {
+ FileSkimmerBackend.GetFile(new[] { ".stp" }, FileOpenerStyle.Save, (file) =>
+ {
+ WriteAllText(file, JsonConvert.SerializeObject(attrib));
+ });
+ }
+ else
+ {
+ Infobox.Show("Service not available.", "The Shiftnet service you requested is not available.");
+ }
+ }
+ }
+}