aboutsummaryrefslogtreecommitdiff
path: root/source/WindowsFormsApplication1/Controls/DesktopIcon.cs
diff options
context:
space:
mode:
authorMichaelTheShifter <[email protected]>2016-06-25 08:10:03 -0400
committerMichaelTheShifter <[email protected]>2016-06-25 08:10:03 -0400
commit84f689b91a73e512b035df40bbcf556b008a3b81 (patch)
treeda1020b2b5866c7ce300ac7b9c97112fe80fa1b3 /source/WindowsFormsApplication1/Controls/DesktopIcon.cs
parent6707e2076a63dafab686fd533c95fb8ceb6c23fa (diff)
downloadshiftos-c-_theultimatehacker-84f689b91a73e512b035df40bbcf556b008a3b81.tar.gz
shiftos-c-_theultimatehacker-84f689b91a73e512b035df40bbcf556b008a3b81.tar.bz2
shiftos-c-_theultimatehacker-84f689b91a73e512b035df40bbcf556b008a3b81.zip
Sort source code into folders.
It feels better to know what's responsible for what... Plus I removed some un-needed C# stuff.
Diffstat (limited to 'source/WindowsFormsApplication1/Controls/DesktopIcon.cs')
-rw-r--r--source/WindowsFormsApplication1/Controls/DesktopIcon.cs83
1 files changed, 83 insertions, 0 deletions
diff --git a/source/WindowsFormsApplication1/Controls/DesktopIcon.cs b/source/WindowsFormsApplication1/Controls/DesktopIcon.cs
new file mode 100644
index 0000000..bfb0940
--- /dev/null
+++ b/source/WindowsFormsApplication1/Controls/DesktopIcon.cs
@@ -0,0 +1,83 @@
+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 System.IO;
+
+namespace ShiftOS
+{
+ public partial class DesktopIcon : UserControl
+ {
+ /// <summary>
+ /// User control for a desktop icon.
+ /// </summary>
+ public DesktopIcon()
+ {
+ InitializeComponent();
+ }
+
+ public string IconName
+ {
+ set
+ {
+ lbiconname.Text = value;
+ }
+ get
+ {
+ return lbiconname.Text;
+ }
+ }
+
+ public Image Icon
+ {
+ set
+ {
+ pbicon.Image = value;
+ }
+ get
+ {
+ return pbicon.Image;
+ }
+ }
+
+ //public string LuaAction { get; set; }
+ public string LuaAction = "open_program(\"shiftorium\")";
+ private void Icon_Click(object sender, EventArgs e)
+ {
+ if (File.Exists(Paths.Desktop + IconName))
+ {
+ var fs = new File_Skimmer();
+ fs.OpenFile(Paths.Desktop + IconName);
+ }
+ else
+ {
+ var li = new LuaInterpreter();
+ li.mod(LuaAction);
+ lbiconname.BackColor = Color.White;
+ t.Start();
+ }
+ }
+
+ public Timer t = new Timer();
+
+
+ private void DesktopIcon_Load(object sender, EventArgs e)
+ {
+ t.Interval = 5000;
+ t.Tick += (object s, EventArgs a) =>
+ {
+ lbiconname.BackColor = Color.Transparent;
+ };
+ var st = new Timer();
+ st.Interval = 200;
+ st.Tick += (object s, EventArgs a) => {
+ lbiconname.ForeColor = API.CurrentSkin.IconTextColor;
+ };
+ }
+ }
+}