diff options
| author | william341 <[email protected]> | 2017-05-28 12:37:00 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2017-05-28 12:37:00 -0700 |
| commit | 771c20cfb3a703e0f1550fdcf9eb07b78298c944 (patch) | |
| tree | 59cb532e15ebff313fdba2be264d78ec0033f407 /ShiftOS_TheReturn/ShiftnetSite.cs | |
| parent | 496b0cbf8659c99203f48210fd39c572400ae623 (diff) | |
| parent | c7ba7d733c756d196f98dd4533289a1ef4db715f (diff) | |
| download | shiftos_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_TheReturn/ShiftnetSite.cs')
| -rw-r--r-- | ShiftOS_TheReturn/ShiftnetSite.cs | 99 |
1 files changed, 99 insertions, 0 deletions
diff --git a/ShiftOS_TheReturn/ShiftnetSite.cs b/ShiftOS_TheReturn/ShiftnetSite.cs new file mode 100644 index 0000000..07b4698 --- /dev/null +++ b/ShiftOS_TheReturn/ShiftnetSite.cs @@ -0,0 +1,99 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ShiftOS.Engine +{ + /// <summary> + /// Interface for creating a Shiftnet website. + /// </summary> + public interface IShiftnetSite + { + /// <summary> + /// Called when the page is loaded. Perform data population here. + /// </summary> + void Setup(); + + /// <summary> + /// Occurs when a ShiftOS skin is loaded. + /// </summary> + void OnSkinLoad(); + + /// <summary> + /// Occurs when a Shiftorium upgrade is installed. + /// </summary> + void OnUpgrade(); + + /// <summary> + /// Invoke this to navigate the parent browser to a specified Shiftnet URL. + /// </summary> + event Action<string> GoToUrl; + + /// <summary> + /// Invoke this to tell the parent browser to navigate to the previous page. + /// </summary> + event Action GoBack; + } + + /// <summary> + /// Marks a shiftnet site as a fundamental, and will make it display on the homepage. + /// </summary> + public class ShiftnetFundamentalAttribute : Attribute + { + + } + + /// <summary> + /// Interface for creating a Shiftnet client. + /// </summary> + public interface IShiftnetClient + { + /// <summary> + /// Navigates the client to a specified Shiftnet URL. + /// </summary> + /// <param name="url">The URL to navigate to.</param> + void NavigateToUrl(string url); + + /// <summary> + /// Refreshes the current page. + /// </summary> + void RefreshSite(); + } + + /// <summary> + /// Marks this class as a Shiftnet website. + /// </summary> + [AttributeUsage(AttributeTargets.Class, AllowMultiple =false)] + public class ShiftnetSiteAttribute : Attribute + { + /// <summary> + /// Creates a new instance of the <see cref="ShiftnetSiteAttribute"/> class. + /// </summary> + /// <param name="url">The URL that links to this site</param> + /// <param name="name">The name of this site</param> + /// <param name="description">The description of this site</param> + public ShiftnetSiteAttribute(string url, string name, string description) + { + Url = url; + Name = name; + Description = description; + } + + /// <summary> + /// Gets the Shiftnet URL for this site. + /// </summary> + public string Url { get; private set; } + + /// <summary> + /// Gets the name of this website. + /// </summary> + public string Name { get; private set; } + + /// <summary> + /// Gets the description of this website. + /// </summary> + public string Description { get; private set; } + } +} |
