Added CPU Usage monitor host app to the LEDNotifier project.
authorDean Camera <dean@fourwalledcubicle.com>
Sun, 20 Dec 2009 05:40:17 +0000 (05:40 +0000)
committerDean Camera <dean@fourwalledcubicle.com>
Sun, 20 Dec 2009 05:40:17 +0000 (05:40 +0000)
Projects/LEDNotifier/CPUUsageApp/CPUMonitor.Designer.cs [new file with mode: 0644]
Projects/LEDNotifier/CPUUsageApp/CPUMonitor.cs [new file with mode: 0644]
Projects/LEDNotifier/CPUUsageApp/CPUMonitor.csproj [new file with mode: 0644]
Projects/LEDNotifier/CPUUsageApp/CPUMonitor.resx [new file with mode: 0644]
Projects/LEDNotifier/CPUUsageApp/Program.cs [new file with mode: 0644]
Projects/LEDNotifier/CPUUsageApp/Properties/AssemblyInfo.cs [new file with mode: 0644]
Projects/LEDNotifier/CPUUsageApp/Properties/Resources.Designer.cs [new file with mode: 0644]
Projects/LEDNotifier/CPUUsageApp/Properties/Resources.resx [new file with mode: 0644]
Projects/LEDNotifier/CPUUsageApp/Properties/Settings.Designer.cs [new file with mode: 0644]
Projects/LEDNotifier/CPUUsageApp/Properties/Settings.settings [new file with mode: 0644]
Projects/LEDNotifier/LEDMixerApp/LEDMixer.Designer.cs

diff --git a/Projects/LEDNotifier/CPUUsageApp/CPUMonitor.Designer.cs b/Projects/LEDNotifier/CPUUsageApp/CPUMonitor.Designer.cs
new file mode 100644 (file)
index 0000000..020cda4
--- /dev/null
@@ -0,0 +1,131 @@
+namespace CPUMonitor\r
+{\r
+    partial class frmCPU\r
+    {\r
+        /// <summary>\r
+        /// Required designer variable.\r
+        /// </summary>\r
+        private System.ComponentModel.IContainer components = null;\r
+\r
+        /// <summary>\r
+        /// Clean up any resources being used.\r
+        /// </summary>\r
+        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>\r
+        protected override void Dispose(bool disposing)\r
+        {\r
+            if (disposing && (components != null))\r
+            {\r
+                components.Dispose();\r
+            }\r
+            base.Dispose(disposing);\r
+        }\r
+\r
+        #region Windows Form Designer generated code\r
+\r
+        /// <summary>\r
+        /// Required method for Designer support - do not modify\r
+        /// the contents of this method with the code editor.\r
+        /// </summary>\r
+        private void InitializeComponent()\r
+        {\r
+            this.components = new System.ComponentModel.Container();\r
+            this.serSerialPort = new System.IO.Ports.SerialPort(this.components);\r
+            this.tmrCPUTimer = new System.Windows.Forms.Timer(this.components);\r
+            this.cmbComPort = new System.Windows.Forms.ComboBox();\r
+            this.pcCPUUsage = new System.Diagnostics.PerformanceCounter();\r
+            this.lblCPU = new System.Windows.Forms.Label();\r
+            this.nicoNotifyIcon = new System.Windows.Forms.NotifyIcon(this.components);\r
+            this.btnMinimizeToTray = new System.Windows.Forms.Button();\r
+            this.btnExit = new System.Windows.Forms.Button();\r
+            ((System.ComponentModel.ISupportInitialize)(this.pcCPUUsage)).BeginInit();\r
+            this.SuspendLayout();\r
+            // \r
+            // tmrCPUTimer\r
+            // \r
+            this.tmrCPUTimer.Enabled = true;\r
+            this.tmrCPUTimer.Interval = 1000;\r
+            this.tmrCPUTimer.Tick += new System.EventHandler(this.tmrCPUTimer_Tick);\r
+            // \r
+            // cmbComPort\r
+            // \r
+            this.cmbComPort.FormattingEnabled = true;\r
+            this.cmbComPort.Location = new System.Drawing.Point(48, 12);\r
+            this.cmbComPort.Name = "cmbComPort";\r
+            this.cmbComPort.Size = new System.Drawing.Size(156, 21);\r
+            this.cmbComPort.TabIndex = 0;\r
+            this.cmbComPort.SelectedIndexChanged += new System.EventHandler(this.cbPort_SelectedIndexChanged);\r
+            // \r
+            // pcCPUUsage\r
+            // \r
+            this.pcCPUUsage.CategoryName = "Processor";\r
+            this.pcCPUUsage.CounterName = "% Processor Time";\r
+            this.pcCPUUsage.InstanceName = "_Total";\r
+            // \r
+            // lblCPU\r
+            // \r
+            this.lblCPU.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
+            this.lblCPU.Location = new System.Drawing.Point(44, 36);\r
+            this.lblCPU.Name = "lblCPU";\r
+            this.lblCPU.Size = new System.Drawing.Size(160, 28);\r
+            this.lblCPU.TabIndex = 1;\r
+            this.lblCPU.Text = "0%";\r
+            this.lblCPU.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;\r
+            // \r
+            // nicoNotifyIcon\r
+            // \r
+            this.nicoNotifyIcon.Text = "CPU Usage Monitor";\r
+            this.nicoNotifyIcon.Visible = true;\r
+            // \r
+            // btnMinimizeToTray\r
+            // \r
+            this.btnMinimizeToTray.Location = new System.Drawing.Point(12, 67);\r
+            this.btnMinimizeToTray.Name = "btnMinimizeToTray";\r
+            this.btnMinimizeToTray.Size = new System.Drawing.Size(111, 28);\r
+            this.btnMinimizeToTray.TabIndex = 2;\r
+            this.btnMinimizeToTray.Text = "Minimize to Tray";\r
+            this.btnMinimizeToTray.UseVisualStyleBackColor = true;\r
+            this.btnMinimizeToTray.Click += new System.EventHandler(this.btnMinimizeToTray_Click);\r
+            // \r
+            // btnExit\r
+            // \r
+            this.btnExit.Location = new System.Drawing.Point(126, 67);\r
+            this.btnExit.Name = "btnExit";\r
+            this.btnExit.Size = new System.Drawing.Size(111, 28);\r
+            this.btnExit.TabIndex = 3;\r
+            this.btnExit.Text = "Exit";\r
+            this.btnExit.UseVisualStyleBackColor = true;\r
+            this.btnExit.Click += new System.EventHandler(this.btnExit_Click);\r
+            // \r
+            // frmCPU\r
+            // \r
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);\r
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;\r
+            this.ClientSize = new System.Drawing.Size(249, 106);\r
+            this.Controls.Add(this.btnExit);\r
+            this.Controls.Add(this.btnMinimizeToTray);\r
+            this.Controls.Add(this.lblCPU);\r
+            this.Controls.Add(this.cmbComPort);\r
+            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;\r
+            this.MaximizeBox = false;\r
+            this.Name = "frmCPU";\r
+            this.Text = "CPU Usage Monitor";\r
+            this.WindowState = System.Windows.Forms.FormWindowState.Minimized;\r
+            this.Load += new System.EventHandler(this.Form1_Load);\r
+            ((System.ComponentModel.ISupportInitialize)(this.pcCPUUsage)).EndInit();\r
+            this.ResumeLayout(false);\r
+\r
+        }\r
+\r
+        #endregion\r
+\r
+        private System.IO.Ports.SerialPort serSerialPort;\r
+        private System.Windows.Forms.Timer tmrCPUTimer;\r
+        private System.Windows.Forms.ComboBox cmbComPort;\r
+        private System.Diagnostics.PerformanceCounter pcCPUUsage;\r
+        private System.Windows.Forms.Label lblCPU;\r
+        private System.Windows.Forms.NotifyIcon nicoNotifyIcon;\r
+        private System.Windows.Forms.Button btnMinimizeToTray;\r
+        private System.Windows.Forms.Button btnExit;\r
+    }\r
+}\r
+\r
diff --git a/Projects/LEDNotifier/CPUUsageApp/CPUMonitor.cs b/Projects/LEDNotifier/CPUUsageApp/CPUMonitor.cs
new file mode 100644 (file)
index 0000000..4e2a6f9
--- /dev/null
@@ -0,0 +1,113 @@
+using System;\r
+using System.Collections.Generic;\r
+using System.ComponentModel;\r
+using System.Data;\r
+using System.Drawing;\r
+using System.Linq;\r
+using System.Text;\r
+using System.Windows.Forms;\r
+using Microsoft.Win32;\r
+\r
+namespace CPUMonitor\r
+{\r
+    public partial class frmCPU : Form\r
+    {\r
+        private RegistryKey AppRegKey;\r
+\r
+        private const int LIGHT_MAX = 0x1F;\r
+\r
+        public frmCPU()\r
+        {\r
+            InitializeComponent();\r
+\r
+            nicoNotifyIcon.Icon = this.Icon;\r
+            nicoNotifyIcon.MouseClick += new MouseEventHandler(TrayIconClick);        \r
+        }\r
+\r
+        private void Form1_Load(object sender, EventArgs e)\r
+        {\r
+            AppRegKey = Registry.CurrentUser.CreateSubKey("Software\\CPUMonitor");\r
+\r
+            for (int i = 1; i <= 99; i++)\r
+                cmbComPort.Items.Add("COM" + i.ToString());\r
+\r
+            cmbComPort.SelectedIndex = System.Convert.ToInt32(AppRegKey.GetValue("Port", "1")) - 1;\r
+            serSerialPort.PortName = cmbComPort.Text;\r
+\r
+            Hide();\r
+        }\r
+\r
+        private void NotifyLight(int Red, int Green, int Blue)\r
+        {\r
+            byte[] buffer = new byte[3];\r
+            buffer[0] = (byte)(0x80 | (Red & LIGHT_MAX));\r
+            buffer[1] = (byte)(0x40 | (Green & LIGHT_MAX));\r
+            buffer[2] = (byte)(0x20 | (Blue & LIGHT_MAX));\r
+\r
+            try\r
+            {\r
+                serSerialPort.PortName = cmbComPort.Text;\r
+                serSerialPort.Open();\r
+                serSerialPort.Write(buffer, 0, buffer.Length);\r
+                serSerialPort.Close();\r
+            }\r
+            catch (Exception e)\r
+            {\r
+\r
+            }\r
+        }\r
+\r
+        private void tmrCPUTimer_Tick(object sender, EventArgs e)\r
+        {\r
+            float CPUUsage = pcCPUUsage.NextValue();\r
+\r
+            int Red = 0;\r
+            int Green = 0;\r
+            int Blue = 0;\r
+\r
+            if (CPUUsage < 25)\r
+            {\r
+                Green = (int)((LIGHT_MAX / 25) * CPUUsage);\r
+            }\r
+            else if (CPUUsage < 50)\r
+            {\r
+                Blue = (int)((LIGHT_MAX / 25) * (CPUUsage - 25));\r
+                Green = LIGHT_MAX - Blue;\r
+            }\r
+            else if (CPUUsage < 75)\r
+            {\r
+                Red = (int)((LIGHT_MAX / 25) * (CPUUsage - 50));\r
+                Blue = LIGHT_MAX - Red;\r
+            }\r
+            else\r
+            {\r
+                Red = LIGHT_MAX;\r
+            }\r
+\r
+            NotifyLight(Red, Green, Blue);\r
+            lblCPU.Text = ((int)CPUUsage).ToString() + "%";\r
+        }\r
+\r
+        private void btnExit_Click(object sender, EventArgs e)\r
+        {\r
+            Application.Exit();\r
+        }\r
+\r
+        private void btnMinimizeToTray_Click(object sender, EventArgs e)\r
+        {\r
+            this.Hide();\r
+        }\r
+\r
+        private void TrayIconClick(object sender, MouseEventArgs e)\r
+        {\r
+            this.Show();\r
+            this.WindowState = FormWindowState.Normal;\r
+        }\r
+\r
+        private void cbPort_SelectedIndexChanged(object sender, EventArgs e)\r
+        {\r
+            AppRegKey.SetValue("Port", cmbComPort.SelectedIndex + 1);\r
+            serSerialPort.PortName = cmbComPort.Text;\r
+        }\r
+    }\r
+}\r
diff --git a/Projects/LEDNotifier/CPUUsageApp/CPUMonitor.csproj b/Projects/LEDNotifier/CPUUsageApp/CPUMonitor.csproj
new file mode 100644 (file)
index 0000000..4203903
--- /dev/null
@@ -0,0 +1,90 @@
+<?xml version="1.0" encoding="utf-8"?>\r
+<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
+  <PropertyGroup>\r
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>\r
+    <ProductVersion>9.0.21022</ProductVersion>\r
+    <SchemaVersion>2.0</SchemaVersion>\r
+    <ProjectGuid>{6040B049-4241-4FFD-B388-AACDA78D1469}</ProjectGuid>\r
+    <OutputType>WinExe</OutputType>\r
+    <AppDesignerFolder>Properties</AppDesignerFolder>\r
+    <RootNamespace>CPUMonitor</RootNamespace>\r
+    <AssemblyName>CPUMonitor</AssemblyName>\r
+    <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>\r
+    <FileAlignment>512</FileAlignment>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
+    <DebugSymbols>true</DebugSymbols>\r
+    <DebugType>full</DebugType>\r
+    <Optimize>false</Optimize>\r
+    <OutputPath>bin\Debug\</OutputPath>\r
+    <DefineConstants>DEBUG;TRACE</DefineConstants>\r
+    <ErrorReport>prompt</ErrorReport>\r
+    <WarningLevel>4</WarningLevel>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">\r
+    <DebugType>pdbonly</DebugType>\r
+    <Optimize>true</Optimize>\r
+    <OutputPath>bin\Release\</OutputPath>\r
+    <DefineConstants>TRACE</DefineConstants>\r
+    <ErrorReport>prompt</ErrorReport>\r
+    <WarningLevel>4</WarningLevel>\r
+  </PropertyGroup>\r
+  <ItemGroup>\r
+    <Reference Include="System" />\r
+    <Reference Include="System.Core">\r
+      <RequiredTargetFramework>3.5</RequiredTargetFramework>\r
+    </Reference>\r
+    <Reference Include="System.Xml.Linq">\r
+      <RequiredTargetFramework>3.5</RequiredTargetFramework>\r
+    </Reference>\r
+    <Reference Include="System.Data.DataSetExtensions">\r
+      <RequiredTargetFramework>3.5</RequiredTargetFramework>\r
+    </Reference>\r
+    <Reference Include="System.Data" />\r
+    <Reference Include="System.Deployment" />\r
+    <Reference Include="System.Drawing" />\r
+    <Reference Include="System.Windows.Forms" />\r
+    <Reference Include="System.Xml" />\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <Compile Include="CPUMonitor.cs">\r
+      <SubType>Form</SubType>\r
+    </Compile>\r
+    <Compile Include="CPUMonitor.Designer.cs">\r
+      <DependentUpon>CPUMonitor.cs</DependentUpon>\r
+    </Compile>\r
+    <Compile Include="Program.cs" />\r
+    <Compile Include="Properties\AssemblyInfo.cs" />\r
+    <EmbeddedResource Include="CPUMonitor.resx">\r
+      <DependentUpon>CPUMonitor.cs</DependentUpon>\r
+      <SubType>Designer</SubType>\r
+    </EmbeddedResource>\r
+    <EmbeddedResource Include="Properties\Resources.resx">\r
+      <Generator>ResXFileCodeGenerator</Generator>\r
+      <LastGenOutput>Resources.Designer.cs</LastGenOutput>\r
+      <SubType>Designer</SubType>\r
+    </EmbeddedResource>\r
+    <Compile Include="Properties\Resources.Designer.cs">\r
+      <AutoGen>True</AutoGen>\r
+      <DependentUpon>Resources.resx</DependentUpon>\r
+    </Compile>\r
+    <None Include="Properties\Settings.settings">\r
+      <Generator>SettingsSingleFileGenerator</Generator>\r
+      <LastGenOutput>Settings.Designer.cs</LastGenOutput>\r
+    </None>\r
+    <Compile Include="Properties\Settings.Designer.cs">\r
+      <AutoGen>True</AutoGen>\r
+      <DependentUpon>Settings.settings</DependentUpon>\r
+      <DesignTimeSharedInput>True</DesignTimeSharedInput>\r
+    </Compile>\r
+  </ItemGroup>\r
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />\r
+  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \r
+       Other similar extension points exist, see Microsoft.Common.targets.\r
+  <Target Name="BeforeBuild">\r
+  </Target>\r
+  <Target Name="AfterBuild">\r
+  </Target>\r
+  -->\r
+</Project>
\ No newline at end of file
diff --git a/Projects/LEDNotifier/CPUUsageApp/CPUMonitor.resx b/Projects/LEDNotifier/CPUUsageApp/CPUMonitor.resx
new file mode 100644 (file)
index 0000000..a423527
--- /dev/null
@@ -0,0 +1,132 @@
+<?xml version="1.0" encoding="utf-8"?>\r
+<root>\r
+  <!-- \r
+    Microsoft ResX Schema \r
+    \r
+    Version 2.0\r
+    \r
+    The primary goals of this format is to allow a simple XML format \r
+    that is mostly human readable. The generation and parsing of the \r
+    various data types are done through the TypeConverter classes \r
+    associated with the data types.\r
+    \r
+    Example:\r
+    \r
+    ... ado.net/XML headers & schema ...\r
+    <resheader name="resmimetype">text/microsoft-resx</resheader>\r
+    <resheader name="version">2.0</resheader>\r
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>\r
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>\r
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>\r
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>\r
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">\r
+        <value>[base64 mime encoded serialized .NET Framework object]</value>\r
+    </data>\r
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">\r
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>\r
+        <comment>This is a comment</comment>\r
+    </data>\r
+                \r
+    There are any number of "resheader" rows that contain simple \r
+    name/value pairs.\r
+    \r
+    Each data row contains a name, and value. The row also contains a \r
+    type or mimetype. Type corresponds to a .NET class that support \r
+    text/value conversion through the TypeConverter architecture. \r
+    Classes that don't support this are serialized and stored with the \r
+    mimetype set.\r
+    \r
+    The mimetype is used for serialized objects, and tells the \r
+    ResXResourceReader how to depersist the object. This is currently not \r
+    extensible. For a given mimetype the value must be set accordingly:\r
+    \r
+    Note - application/x-microsoft.net.object.binary.base64 is the format \r
+    that the ResXResourceWriter will generate, however the reader can \r
+    read any of the formats listed below.\r
+    \r
+    mimetype: application/x-microsoft.net.object.binary.base64\r
+    value   : The object must be serialized with \r
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter\r
+            : and then encoded with base64 encoding.\r
+    \r
+    mimetype: application/x-microsoft.net.object.soap.base64\r
+    value   : The object must be serialized with \r
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter\r
+            : and then encoded with base64 encoding.\r
+\r
+    mimetype: application/x-microsoft.net.object.bytearray.base64\r
+    value   : The object must be serialized into a byte array \r
+            : using a System.ComponentModel.TypeConverter\r
+            : and then encoded with base64 encoding.\r
+    -->\r
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">\r
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />\r
+    <xsd:element name="root" msdata:IsDataSet="true">\r
+      <xsd:complexType>\r
+        <xsd:choice maxOccurs="unbounded">\r
+          <xsd:element name="metadata">\r
+            <xsd:complexType>\r
+              <xsd:sequence>\r
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />\r
+              </xsd:sequence>\r
+              <xsd:attribute name="name" use="required" type="xsd:string" />\r
+              <xsd:attribute name="type" type="xsd:string" />\r
+              <xsd:attribute name="mimetype" type="xsd:string" />\r
+              <xsd:attribute ref="xml:space" />\r
+            </xsd:complexType>\r
+          </xsd:element>\r
+          <xsd:element name="assembly">\r
+            <xsd:complexType>\r
+              <xsd:attribute name="alias" type="xsd:string" />\r
+              <xsd:attribute name="name" type="xsd:string" />\r
+            </xsd:complexType>\r
+          </xsd:element>\r
+          <xsd:element name="data">\r
+            <xsd:complexType>\r
+              <xsd:sequence>\r
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />\r
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />\r
+              </xsd:sequence>\r
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />\r
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />\r
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />\r
+              <xsd:attribute ref="xml:space" />\r
+            </xsd:complexType>\r
+          </xsd:element>\r
+          <xsd:element name="resheader">\r
+            <xsd:complexType>\r
+              <xsd:sequence>\r
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />\r
+              </xsd:sequence>\r
+              <xsd:attribute name="name" type="xsd:string" use="required" />\r
+            </xsd:complexType>\r
+          </xsd:element>\r
+        </xsd:choice>\r
+      </xsd:complexType>\r
+    </xsd:element>\r
+  </xsd:schema>\r
+  <resheader name="resmimetype">\r
+    <value>text/microsoft-resx</value>\r
+  </resheader>\r
+  <resheader name="version">\r
+    <value>2.0</value>\r
+  </resheader>\r
+  <resheader name="reader">\r
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\r
+  </resheader>\r
+  <resheader name="writer">\r
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\r
+  </resheader>\r
+  <metadata name="serSerialPort.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">\r
+    <value>17, 17</value>\r
+  </metadata>\r
+  <metadata name="tmrCPUTimer.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">\r
+    <value>137, 17</value>\r
+  </metadata>\r
+  <metadata name="pcCPUUsage.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">\r
+    <value>262, 17</value>\r
+  </metadata>\r
+  <metadata name="nicoNotifyIcon.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">\r
+    <value>383, 17</value>\r
+  </metadata>\r
+</root>
\ No newline at end of file
diff --git a/Projects/LEDNotifier/CPUUsageApp/Program.cs b/Projects/LEDNotifier/CPUUsageApp/Program.cs
new file mode 100644 (file)
index 0000000..02d83c2
--- /dev/null
@@ -0,0 +1,21 @@
+using System;\r
+using System.Collections.Generic;\r
+using System.Linq;\r
+using System.Windows.Forms;\r
+\r
+namespace CPUMonitor\r
+{\r
+    static class Program\r
+    {\r
+        /// <summary>\r
+        /// The main entry point for the application.\r
+        /// </summary>\r
+        [STAThread]\r
+        static void Main()\r
+        {\r
+            Application.EnableVisualStyles();\r
+            Application.SetCompatibleTextRenderingDefault(false);\r
+            Application.Run(new frmCPU());\r
+        }\r
+    }\r
+}\r
diff --git a/Projects/LEDNotifier/CPUUsageApp/Properties/AssemblyInfo.cs b/Projects/LEDNotifier/CPUUsageApp/Properties/AssemblyInfo.cs
new file mode 100644 (file)
index 0000000..f82aa59
--- /dev/null
@@ -0,0 +1,36 @@
+using System.Reflection;\r
+using System.Runtime.CompilerServices;\r
+using System.Runtime.InteropServices;\r
+\r
+// General Information about an assembly is controlled through the following \r
+// set of attributes. Change these attribute values to modify the information\r
+// associated with an assembly.\r
+[assembly: AssemblyTitle("CPUMonitor")]\r
+[assembly: AssemblyDescription("")]\r
+[assembly: AssemblyConfiguration("")]\r
+[assembly: AssemblyCompany("Microsoft")]\r
+[assembly: AssemblyProduct("CPUMonitor")]\r
+[assembly: AssemblyCopyright("Copyright © Microsoft 2009")]\r
+[assembly: AssemblyTrademark("")]\r
+[assembly: AssemblyCulture("")]\r
+\r
+// Setting ComVisible to false makes the types in this assembly not visible \r
+// to COM components.  If you need to access a type in this assembly from \r
+// COM, set the ComVisible attribute to true on that type.\r
+[assembly: ComVisible(false)]\r
+\r
+// The following GUID is for the ID of the typelib if this project is exposed to COM\r
+[assembly: Guid("3e4a61da-cdde-46de-848b-b5206d225e21")]\r
+\r
+// Version information for an assembly consists of the following four values:\r
+//\r
+//      Major Version\r
+//      Minor Version \r
+//      Build Number\r
+//      Revision\r
+//\r
+// You can specify all the values or you can default the Build and Revision Numbers \r
+// by using the '*' as shown below:\r
+// [assembly: AssemblyVersion("1.0.*")]\r
+[assembly: AssemblyVersion("1.0.0.0")]\r
+[assembly: AssemblyFileVersion("1.0.0.0")]\r
diff --git a/Projects/LEDNotifier/CPUUsageApp/Properties/Resources.Designer.cs b/Projects/LEDNotifier/CPUUsageApp/Properties/Resources.Designer.cs
new file mode 100644 (file)
index 0000000..43ba43e
--- /dev/null
@@ -0,0 +1,71 @@
+//------------------------------------------------------------------------------\r
+// <auto-generated>\r
+//     This code was generated by a tool.\r
+//     Runtime Version:2.0.50727.4927\r
+//\r
+//     Changes to this file may cause incorrect behavior and will be lost if\r
+//     the code is regenerated.\r
+// </auto-generated>\r
+//------------------------------------------------------------------------------\r
+\r
+namespace CPUMonitor.Properties\r
+{\r
+\r
+\r
+    /// <summary>\r
+    ///   A strongly-typed resource class, for looking up localized strings, etc.\r
+    /// </summary>\r
+    // This class was auto-generated by the StronglyTypedResourceBuilder\r
+    // class via a tool like ResGen or Visual Studio.\r
+    // To add or remove a member, edit your .ResX file then rerun ResGen\r
+    // with the /str option, or rebuild your VS project.\r
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0")]\r
+    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]\r
+    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]\r
+    internal class Resources\r
+    {\r
+\r
+        private static global::System.Resources.ResourceManager resourceMan;\r
+\r
+        private static global::System.Globalization.CultureInfo resourceCulture;\r
+\r
+        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]\r
+        internal Resources()\r
+        {\r
+        }\r
+\r
+        /// <summary>\r
+        ///   Returns the cached ResourceManager instance used by this class.\r
+        /// </summary>\r
+        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]\r
+        internal static global::System.Resources.ResourceManager ResourceManager\r
+        {\r
+            get\r
+            {\r
+                if ((resourceMan == null))\r
+                {\r
+                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("CPUMonitor.Properties.Resources", typeof(Resources).Assembly);\r
+                    resourceMan = temp;\r
+                }\r
+                return resourceMan;\r
+            }\r
+        }\r
+\r
+        /// <summary>\r
+        ///   Overrides the current thread's CurrentUICulture property for all\r
+        ///   resource lookups using this strongly typed resource class.\r
+        /// </summary>\r
+        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]\r
+        internal static global::System.Globalization.CultureInfo Culture\r
+        {\r
+            get\r
+            {\r
+                return resourceCulture;\r
+            }\r
+            set\r
+            {\r
+                resourceCulture = value;\r
+            }\r
+        }\r
+    }\r
+}\r
diff --git a/Projects/LEDNotifier/CPUUsageApp/Properties/Resources.resx b/Projects/LEDNotifier/CPUUsageApp/Properties/Resources.resx
new file mode 100644 (file)
index 0000000..ffecec8
--- /dev/null
@@ -0,0 +1,117 @@
+<?xml version="1.0" encoding="utf-8"?>\r
+<root>\r
+  <!-- \r
+    Microsoft ResX Schema \r
+    \r
+    Version 2.0\r
+    \r
+    The primary goals of this format is to allow a simple XML format \r
+    that is mostly human readable. The generation and parsing of the \r
+    various data types are done through the TypeConverter classes \r
+    associated with the data types.\r
+    \r
+    Example:\r
+    \r
+    ... ado.net/XML headers & schema ...\r
+    <resheader name="resmimetype">text/microsoft-resx</resheader>\r
+    <resheader name="version">2.0</resheader>\r
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>\r
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>\r
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>\r
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>\r
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">\r
+        <value>[base64 mime encoded serialized .NET Framework object]</value>\r
+    </data>\r
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">\r
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>\r
+        <comment>This is a comment</comment>\r
+    </data>\r
+                \r
+    There are any number of "resheader" rows that contain simple \r
+    name/value pairs.\r
+    \r
+    Each data row contains a name, and value. The row also contains a \r
+    type or mimetype. Type corresponds to a .NET class that support \r
+    text/value conversion through the TypeConverter architecture. \r
+    Classes that don't support this are serialized and stored with the \r
+    mimetype set.\r
+    \r
+    The mimetype is used for serialized objects, and tells the \r
+    ResXResourceReader how to depersist the object. This is currently not \r
+    extensible. For a given mimetype the value must be set accordingly:\r
+    \r
+    Note - application/x-microsoft.net.object.binary.base64 is the format \r
+    that the ResXResourceWriter will generate, however the reader can \r
+    read any of the formats listed below.\r
+    \r
+    mimetype: application/x-microsoft.net.object.binary.base64\r
+    value   : The object must be serialized with \r
+            : System.Serialization.Formatters.Binary.BinaryFormatter\r
+            : and then encoded with base64 encoding.\r
+    \r
+    mimetype: application/x-microsoft.net.object.soap.base64\r
+    value   : The object must be serialized with \r
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter\r
+            : and then encoded with base64 encoding.\r
+\r
+    mimetype: application/x-microsoft.net.object.bytearray.base64\r
+    value   : The object must be serialized into a byte array \r
+            : using a System.ComponentModel.TypeConverter\r
+            : and then encoded with base64 encoding.\r
+    -->\r
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">\r
+    <xsd:element name="root" msdata:IsDataSet="true">\r
+      <xsd:complexType>\r
+        <xsd:choice maxOccurs="unbounded">\r
+          <xsd:element name="metadata">\r
+            <xsd:complexType>\r
+              <xsd:sequence>\r
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />\r
+              </xsd:sequence>\r
+              <xsd:attribute name="name" type="xsd:string" />\r
+              <xsd:attribute name="type" type="xsd:string" />\r
+              <xsd:attribute name="mimetype" type="xsd:string" />\r
+            </xsd:complexType>\r
+          </xsd:element>\r
+          <xsd:element name="assembly">\r
+            <xsd:complexType>\r
+              <xsd:attribute name="alias" type="xsd:string" />\r
+              <xsd:attribute name="name" type="xsd:string" />\r
+            </xsd:complexType>\r
+          </xsd:element>\r
+          <xsd:element name="data">\r
+            <xsd:complexType>\r
+              <xsd:sequence>\r
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />\r
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />\r
+              </xsd:sequence>\r
+              <xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />\r
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />\r
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />\r
+            </xsd:complexType>\r
+          </xsd:element>\r
+          <xsd:element name="resheader">\r
+            <xsd:complexType>\r
+              <xsd:sequence>\r
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />\r
+              </xsd:sequence>\r
+              <xsd:attribute name="name" type="xsd:string" use="required" />\r
+            </xsd:complexType>\r
+          </xsd:element>\r
+        </xsd:choice>\r
+      </xsd:complexType>\r
+    </xsd:element>\r
+  </xsd:schema>\r
+  <resheader name="resmimetype">\r
+    <value>text/microsoft-resx</value>\r
+  </resheader>\r
+  <resheader name="version">\r
+    <value>2.0</value>\r
+  </resheader>\r
+  <resheader name="reader">\r
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\r
+  </resheader>\r
+  <resheader name="writer">\r
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\r
+  </resheader>\r
+</root>
\ No newline at end of file
diff --git a/Projects/LEDNotifier/CPUUsageApp/Properties/Settings.Designer.cs b/Projects/LEDNotifier/CPUUsageApp/Properties/Settings.Designer.cs
new file mode 100644 (file)
index 0000000..b9bf677
--- /dev/null
@@ -0,0 +1,30 @@
+//------------------------------------------------------------------------------\r
+// <auto-generated>\r
+//     This code was generated by a tool.\r
+//     Runtime Version:2.0.50727.4927\r
+//\r
+//     Changes to this file may cause incorrect behavior and will be lost if\r
+//     the code is regenerated.\r
+// </auto-generated>\r
+//------------------------------------------------------------------------------\r
+\r
+namespace CPUMonitor.Properties\r
+{\r
+\r
+\r
+    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]\r
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "9.0.0.0")]\r
+    internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase\r
+    {\r
+\r
+        private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));\r
+\r
+        public static Settings Default\r
+        {\r
+            get\r
+            {\r
+                return defaultInstance;\r
+            }\r
+        }\r
+    }\r
+}\r
diff --git a/Projects/LEDNotifier/CPUUsageApp/Properties/Settings.settings b/Projects/LEDNotifier/CPUUsageApp/Properties/Settings.settings
new file mode 100644 (file)
index 0000000..abf36c5
--- /dev/null
@@ -0,0 +1,7 @@
+<?xml version='1.0' encoding='utf-8'?>\r
+<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">\r
+  <Profiles>\r
+    <Profile Name="(Default)" />\r
+  </Profiles>\r
+  <Settings />\r
+</SettingsFile>\r
index 885db29..8ed0665 100644 (file)
             // \r
             this.lblBlue.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
             this.lblBlue.Location = new System.Drawing.Point(3, 115);\r
-            this.lblBlue.Name = "lblBlue";\r
+            this.lblBlue.Name = "lblGreen";\r
             this.lblBlue.Size = new System.Drawing.Size(50, 27);\r
             this.lblBlue.TabIndex = 5;\r
-            this.lblBlue.Text = "Blue";\r
+            this.lblBlue.Text = "Green";\r
             this.lblBlue.TextAlign = System.Drawing.ContentAlignment.MiddleRight;\r
             // \r
             // lblGreen\r
             // \r
             this.lblGreen.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
             this.lblGreen.Location = new System.Drawing.Point(3, 163);\r
-            this.lblGreen.Name = "lblGreen";\r
+            this.lblGreen.Name = "lblBlue";\r
             this.lblGreen.Size = new System.Drawing.Size(50, 25);\r
             this.lblGreen.TabIndex = 6;\r
-            this.lblGreen.Text = "Green";\r
+            this.lblGreen.Text = "Blue";\r
             this.lblGreen.TextAlign = System.Drawing.ContentAlignment.MiddleRight;\r
             // \r
             // LEDMixer\r