Added meeting scheduler, toolbar (closes #2)

This commit is contained in:
scoliono 2021-03-01 15:03:22 -08:00
parent 1e4d9d1bd9
commit 8aca4c8fc7
27 changed files with 1557 additions and 268 deletions

View File

@ -93,12 +93,24 @@
} }
"Entry" "Entry"
{ {
"MsmKey" = "8:_89C6893B8CE24B97A5B9FBE20DC47AE5"
"OwnerKey" = "8:_UNDEFINED"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
"MsmKey" = "8:_C7272BF4A9D24FD39D08ABB04570B03C" "MsmKey" = "8:_C7272BF4A9D24FD39D08ABB04570B03C"
"OwnerKey" = "8:_UNDEFINED" "OwnerKey" = "8:_UNDEFINED"
"MsmSig" = "8:_UNDEFINED" "MsmSig" = "8:_UNDEFINED"
} }
"Entry" "Entry"
{ {
"MsmKey" = "8:_CA9E161B9664471B86DC3E674B2C3E37"
"OwnerKey" = "8:_UNDEFINED"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
"MsmKey" = "8:_EBEE36C33EDCA5A5ABEBF8285F4E5150" "MsmKey" = "8:_EBEE36C33EDCA5A5ABEBF8285F4E5150"
"OwnerKey" = "8:_46C8C60227CD93D9A3ADA497BA320E90" "OwnerKey" = "8:_46C8C60227CD93D9A3ADA497BA320E90"
"MsmSig" = "8:_UNDEFINED" "MsmSig" = "8:_UNDEFINED"
@ -239,7 +251,7 @@
{ {
"Name" = "8:.NET Framework" "Name" = "8:.NET Framework"
"Message" = "8:[VSDNETMSG]" "Message" = "8:[VSDNETMSG]"
"FrameworkVersion" = "8:.NETFramework,Version=v4.0,Profile=Client" "FrameworkVersion" = "8:.NETFramework,Version=v3.0"
"AllowLaterVersions" = "11:FALSE" "AllowLaterVersions" = "11:FALSE"
"InstallUrl" = "8:http://go.microsoft.com/fwlink/?LinkId=131000" "InstallUrl" = "8:http://go.microsoft.com/fwlink/?LinkId=131000"
} }
@ -422,6 +434,46 @@
"IsDependency" = "11:FALSE" "IsDependency" = "11:FALSE"
"IsolateTo" = "8:" "IsolateTo" = "8:"
} }
"{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_89C6893B8CE24B97A5B9FBE20DC47AE5"
{
"SourcePath" = "8:..\\FemboyWatchdog\\media\\beep.wav"
"TargetName" = "8:beep.wav"
"Tag" = "8:"
"Folder" = "8:_6CC34141C38547F1960B28776AFE013A"
"Condition" = "8:"
"Transitive" = "11:FALSE"
"Vital" = "11:TRUE"
"ReadOnly" = "11:FALSE"
"Hidden" = "11:FALSE"
"System" = "11:FALSE"
"Permanent" = "11:FALSE"
"SharedLegacy" = "11:FALSE"
"PackageAs" = "3:1"
"Register" = "3:1"
"Exclude" = "11:FALSE"
"IsDependency" = "11:FALSE"
"IsolateTo" = "8:"
}
"{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_CA9E161B9664471B86DC3E674B2C3E37"
{
"SourcePath" = "8:..\\FemboyWatchdog\\media\\klaxon.wav"
"TargetName" = "8:klaxon.wav"
"Tag" = "8:"
"Folder" = "8:_6CC34141C38547F1960B28776AFE013A"
"Condition" = "8:"
"Transitive" = "11:FALSE"
"Vital" = "11:TRUE"
"ReadOnly" = "11:FALSE"
"Hidden" = "11:FALSE"
"System" = "11:FALSE"
"Permanent" = "11:FALSE"
"SharedLegacy" = "11:FALSE"
"PackageAs" = "3:1"
"Register" = "3:1"
"Exclude" = "11:FALSE"
"IsDependency" = "11:FALSE"
"IsolateTo" = "8:"
}
"{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_EBEE36C33EDCA5A5ABEBF8285F4E5150" "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_EBEE36C33EDCA5A5ABEBF8285F4E5150"
{ {
"AssemblyRegister" = "3:1" "AssemblyRegister" = "3:1"
@ -511,6 +563,17 @@
"Property" = "8:TARGETDIR" "Property" = "8:TARGETDIR"
"Folders" "Folders"
{ {
"{9EF0B969-E518-4E46-987F-47570745A589}:_6CC34141C38547F1960B28776AFE013A"
{
"Name" = "8:media"
"AlwaysCreate" = "11:FALSE"
"Condition" = "8:"
"Transitive" = "11:FALSE"
"Property" = "8:_2F6493A357C84CC6A5D7796898769E45"
"Folders"
{
}
}
} }
} }
"{1525181F-901A-416C-8A58-119130FE478E}:_E3FA4026E3914317A7CCE3DFB7BF7A85" "{1525181F-901A-416C-8A58-119130FE478E}:_E3FA4026E3914317A7CCE3DFB7BF7A85"
@ -562,15 +625,15 @@
{ {
"Name" = "8:Microsoft Visual Studio" "Name" = "8:Microsoft Visual Studio"
"ProductName" = "8:FemboyWatchdog" "ProductName" = "8:FemboyWatchdog"
"ProductCode" = "8:{C882488C-8174-4E3C-AC32-6152755025CE}" "ProductCode" = "8:{4560E035-D9FD-4A3E-AD0C-0C92F99B2AC7}"
"PackageCode" = "8:{2782296D-C54B-4CAD-8DE9-FC3459327BC4}" "PackageCode" = "8:{7F6425A9-589D-4803-92D1-C7C5D2F61ED5}"
"UpgradeCode" = "8:{85E61D1C-4678-4F3E-898C-C62A75112C1A}" "UpgradeCode" = "8:{85E61D1C-4678-4F3E-898C-C62A75112C1A}"
"AspNetVersion" = "8:4.0.30319.0" "AspNetVersion" = "8:4.0.30319.0"
"RestartWWWService" = "11:FALSE" "RestartWWWService" = "11:FALSE"
"RemovePreviousVersions" = "11:TRUE" "RemovePreviousVersions" = "11:TRUE"
"DetectNewerInstalledVersion" = "11:TRUE" "DetectNewerInstalledVersion" = "11:TRUE"
"InstallAllUsers" = "11:TRUE" "InstallAllUsers" = "11:TRUE"
"ProductVersion" = "8:1.0.0" "ProductVersion" = "8:0.3.0"
"Manufacturer" = "8:FemboyFinancial" "Manufacturer" = "8:FemboyFinancial"
"ARPHELPTELEPHONE" = "8:+1 (925) 765-8478" "ARPHELPTELEPHONE" = "8:+1 (925) 765-8478"
"ARPHELPLINK" = "8:http://ff.howfeed.biz/" "ARPHELPLINK" = "8:http://ff.howfeed.biz/"
@ -1081,8 +1144,8 @@
"Type" = "3:15" "Type" = "3:15"
"ContextData" = "8:" "ContextData" = "8:"
"Attributes" = "3:0" "Attributes" = "3:0"
"Setting" = "3:1" "Setting" = "3:2"
"Value" = "8:#1258" "Value" = "8:Please restart your computer to finish installation."
"DefaultValue" = "8:#1258" "DefaultValue" = "8:#1258"
"UsePlugInResources" = "11:TRUE" "UsePlugInResources" = "11:TRUE"
} }

185
FemboyWatchdog/AboutBox.Designer.cs generated Normal file
View File

@ -0,0 +1,185 @@
namespace FemboyWatchdog
{
partial class AboutBox
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.tableLayoutPanel = new System.Windows.Forms.TableLayoutPanel();
this.logoPictureBox = new System.Windows.Forms.PictureBox();
this.labelProductName = new System.Windows.Forms.Label();
this.labelVersion = new System.Windows.Forms.Label();
this.labelCopyright = new System.Windows.Forms.Label();
this.labelCompanyName = new System.Windows.Forms.Label();
this.textBoxDescription = new System.Windows.Forms.TextBox();
this.okButton = new System.Windows.Forms.Button();
this.tableLayoutPanel.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.logoPictureBox)).BeginInit();
this.SuspendLayout();
//
// tableLayoutPanel
//
this.tableLayoutPanel.ColumnCount = 2;
this.tableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33F));
this.tableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 67F));
this.tableLayoutPanel.Controls.Add(this.logoPictureBox, 0, 0);
this.tableLayoutPanel.Controls.Add(this.labelProductName, 1, 0);
this.tableLayoutPanel.Controls.Add(this.labelVersion, 1, 1);
this.tableLayoutPanel.Controls.Add(this.labelCopyright, 1, 2);
this.tableLayoutPanel.Controls.Add(this.labelCompanyName, 1, 3);
this.tableLayoutPanel.Controls.Add(this.textBoxDescription, 1, 4);
this.tableLayoutPanel.Controls.Add(this.okButton, 1, 5);
this.tableLayoutPanel.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel.Location = new System.Drawing.Point(9, 9);
this.tableLayoutPanel.Name = "tableLayoutPanel";
this.tableLayoutPanel.RowCount = 6;
this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10F));
this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10F));
this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10F));
this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10F));
this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10F));
this.tableLayoutPanel.Size = new System.Drawing.Size(417, 265);
this.tableLayoutPanel.TabIndex = 0;
//
// logoPictureBox
//
this.logoPictureBox.Dock = System.Windows.Forms.DockStyle.Fill;
this.logoPictureBox.Image = global::FemboyWatchdog.Properties.Resources.ff;
this.logoPictureBox.Location = new System.Drawing.Point(3, 3);
this.logoPictureBox.Name = "logoPictureBox";
this.tableLayoutPanel.SetRowSpan(this.logoPictureBox, 6);
this.logoPictureBox.Size = new System.Drawing.Size(131, 259);
this.logoPictureBox.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.logoPictureBox.TabIndex = 12;
this.logoPictureBox.TabStop = false;
//
// labelProductName
//
this.labelProductName.Dock = System.Windows.Forms.DockStyle.Fill;
this.labelProductName.Location = new System.Drawing.Point(143, 0);
this.labelProductName.Margin = new System.Windows.Forms.Padding(6, 0, 3, 0);
this.labelProductName.MaximumSize = new System.Drawing.Size(0, 17);
this.labelProductName.Name = "labelProductName";
this.labelProductName.Size = new System.Drawing.Size(271, 17);
this.labelProductName.TabIndex = 19;
this.labelProductName.Text = "Product Name";
this.labelProductName.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// labelVersion
//
this.labelVersion.Dock = System.Windows.Forms.DockStyle.Fill;
this.labelVersion.Location = new System.Drawing.Point(143, 26);
this.labelVersion.Margin = new System.Windows.Forms.Padding(6, 0, 3, 0);
this.labelVersion.MaximumSize = new System.Drawing.Size(0, 17);
this.labelVersion.Name = "labelVersion";
this.labelVersion.Size = new System.Drawing.Size(271, 17);
this.labelVersion.TabIndex = 0;
this.labelVersion.Text = "Version";
this.labelVersion.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// labelCopyright
//
this.labelCopyright.Dock = System.Windows.Forms.DockStyle.Fill;
this.labelCopyright.Location = new System.Drawing.Point(143, 52);
this.labelCopyright.Margin = new System.Windows.Forms.Padding(6, 0, 3, 0);
this.labelCopyright.MaximumSize = new System.Drawing.Size(0, 17);
this.labelCopyright.Name = "labelCopyright";
this.labelCopyright.Size = new System.Drawing.Size(271, 17);
this.labelCopyright.TabIndex = 21;
this.labelCopyright.Text = "Copyright";
this.labelCopyright.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// labelCompanyName
//
this.labelCompanyName.Dock = System.Windows.Forms.DockStyle.Fill;
this.labelCompanyName.Location = new System.Drawing.Point(143, 78);
this.labelCompanyName.Margin = new System.Windows.Forms.Padding(6, 0, 3, 0);
this.labelCompanyName.MaximumSize = new System.Drawing.Size(0, 17);
this.labelCompanyName.Name = "labelCompanyName";
this.labelCompanyName.Size = new System.Drawing.Size(271, 17);
this.labelCompanyName.TabIndex = 22;
this.labelCompanyName.Text = "Company Name";
this.labelCompanyName.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// textBoxDescription
//
this.textBoxDescription.Dock = System.Windows.Forms.DockStyle.Fill;
this.textBoxDescription.Location = new System.Drawing.Point(143, 107);
this.textBoxDescription.Margin = new System.Windows.Forms.Padding(6, 3, 3, 3);
this.textBoxDescription.Multiline = true;
this.textBoxDescription.Name = "textBoxDescription";
this.textBoxDescription.ReadOnly = true;
this.textBoxDescription.ScrollBars = System.Windows.Forms.ScrollBars.Both;
this.textBoxDescription.Size = new System.Drawing.Size(271, 126);
this.textBoxDescription.TabIndex = 23;
this.textBoxDescription.TabStop = false;
this.textBoxDescription.Text = "Description";
//
// okButton
//
this.okButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.okButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.okButton.Location = new System.Drawing.Point(339, 239);
this.okButton.Name = "okButton";
this.okButton.Size = new System.Drawing.Size(75, 23);
this.okButton.TabIndex = 24;
this.okButton.Text = "&OK";
//
// AboutBox
//
this.AcceptButton = this.okButton;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(435, 283);
this.Controls.Add(this.tableLayoutPanel);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "AboutBox";
this.Padding = new System.Windows.Forms.Padding(9);
this.ShowIcon = false;
this.ShowInTaskbar = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "AboutBox";
this.tableLayoutPanel.ResumeLayout(false);
this.tableLayoutPanel.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.logoPictureBox)).EndInit();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel;
private System.Windows.Forms.PictureBox logoPictureBox;
private System.Windows.Forms.Label labelProductName;
private System.Windows.Forms.Label labelVersion;
private System.Windows.Forms.Label labelCopyright;
private System.Windows.Forms.Label labelCompanyName;
private System.Windows.Forms.TextBox textBoxDescription;
private System.Windows.Forms.Button okButton;
}
}

103
FemboyWatchdog/AboutBox.cs Normal file
View File

@ -0,0 +1,103 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Reflection;
using System.Windows.Forms;
namespace FemboyWatchdog
{
partial class AboutBox : Form
{
public AboutBox()
{
InitializeComponent();
this.Text = String.Format("About {0}", AssemblyTitle);
this.labelProductName.Text = AssemblyProduct;
this.labelVersion.Text = String.Format("Version {0}", AssemblyVersion);
this.labelCopyright.Text = AssemblyCopyright + " " + AssemblyCompany;
this.labelCompanyName.Text = "All rights reversed.";
this.textBoxDescription.Text = AssemblyDescription;
}
#region Assembly Attribute Accessors
public string AssemblyTitle
{
get
{
object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyTitleAttribute), false);
if (attributes.Length > 0)
{
AssemblyTitleAttribute titleAttribute = (AssemblyTitleAttribute)attributes[0];
if (titleAttribute.Title != "")
{
return titleAttribute.Title;
}
}
return System.IO.Path.GetFileNameWithoutExtension(Assembly.GetExecutingAssembly().CodeBase);
}
}
public string AssemblyVersion
{
get
{
return Assembly.GetExecutingAssembly().GetName().Version.ToString();
}
}
public string AssemblyDescription
{
get
{
object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyDescriptionAttribute), false);
if (attributes.Length == 0)
{
return "";
}
return ((AssemblyDescriptionAttribute)attributes[0]).Description;
}
}
public string AssemblyProduct
{
get
{
object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyProductAttribute), false);
if (attributes.Length == 0)
{
return "";
}
return ((AssemblyProductAttribute)attributes[0]).Product;
}
}
public string AssemblyCopyright
{
get
{
object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCopyrightAttribute), false);
if (attributes.Length == 0)
{
return "";
}
return ((AssemblyCopyrightAttribute)attributes[0]).Copyright;
}
}
public string AssemblyCompany
{
get
{
object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCompanyAttribute), false);
if (attributes.Length == 0)
{
return "";
}
return ((AssemblyCompanyAttribute)attributes[0]).Company;
}
}
#endregion
}
}

View File

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@ -14,6 +14,7 @@
<TargetFrameworkProfile> <TargetFrameworkProfile>
</TargetFrameworkProfile> </TargetFrameworkProfile>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<IsWebBootstrapper>false</IsWebBootstrapper>
<PublishUrl>publish\</PublishUrl> <PublishUrl>publish\</PublishUrl>
<Install>true</Install> <Install>true</Install>
<InstallFrom>Disk</InstallFrom> <InstallFrom>Disk</InstallFrom>
@ -26,7 +27,6 @@
<MapFileExtensions>true</MapFileExtensions> <MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision> <ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion> <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust> <UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled> <BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup> </PropertyGroup>
@ -49,6 +49,10 @@
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
</PropertyGroup> </PropertyGroup>
<PropertyGroup>
<StartupObject>
</StartupObject>
</PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="AForge, Version=2.2.5.0, Culture=neutral, PublicKeyToken=c1db6ff4eaa06aeb, processorArchitecture=MSIL"> <Reference Include="AForge, Version=2.2.5.0, Culture=neutral, PublicKeyToken=c1db6ff4eaa06aeb, processorArchitecture=MSIL">
<HintPath>..\packages\AForge.2.2.5\lib\AForge.dll</HintPath> <HintPath>..\packages\AForge.2.2.5\lib\AForge.dll</HintPath>
@ -79,22 +83,49 @@
<Private>True</Private> <Private>True</Private>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Drawing" /> <Reference Include="System.Drawing" />
<Reference Include="System.Speech" /> <Reference Include="System.Speech" />
<Reference Include="System.Windows.Forms" /> <Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="AboutBox.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="AboutBox.Designer.cs">
<DependentUpon>AboutBox.cs</DependentUpon>
</Compile>
<Compile Include="GlobalHooks.cs" /> <Compile Include="GlobalHooks.cs" />
<Compile Include="LocationTracker.cs" /> <Compile Include="LocationProvider.cs" />
<Compile Include="MeetingNotification.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="MeetingNotification.Designer.cs">
<DependentUpon>MeetingNotification.cs</DependentUpon>
</Compile>
<Compile Include="MeetingProvider.cs" />
<Compile Include="Program.cs" /> <Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Settings.cs" /> <Compile Include="Settings.cs" />
<Compile Include="Monitor.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Monitor.Designer.cs">
<DependentUpon>Monitor.cs</DependentUpon>
</Compile>
<Compile Include="Toolbar.cs"> <Compile Include="Toolbar.cs">
<SubType>Form</SubType> <SubType>Form</SubType>
</Compile> </Compile>
<Compile Include="Toolbar.Designer.cs"> <Compile Include="Toolbar.Designer.cs">
<DependentUpon>Toolbar.cs</DependentUpon> <DependentUpon>Toolbar.cs</DependentUpon>
</Compile> </Compile>
<EmbeddedResource Include="AboutBox.resx">
<DependentUpon>AboutBox.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="MeetingNotification.resx">
<DependentUpon>MeetingNotification.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx"> <EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator> <Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput> <LastGenOutput>Resources.Designer.cs</LastGenOutput>
@ -105,6 +136,9 @@
<DependentUpon>Resources.resx</DependentUpon> <DependentUpon>Resources.resx</DependentUpon>
<DesignTime>True</DesignTime> <DesignTime>True</DesignTime>
</Compile> </Compile>
<EmbeddedResource Include="Monitor.resx">
<DependentUpon>Monitor.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Toolbar.resx"> <EmbeddedResource Include="Toolbar.resx">
<DependentUpon>Toolbar.cs</DependentUpon> <DependentUpon>Toolbar.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
@ -141,6 +175,10 @@
<Content Include="media\beep.wav"> <Content Include="media\beep.wav">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<Content Include="media\klaxon.wav">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<None Include="Resources\ff.png" />
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup> <PropertyGroup>

View File

@ -5,7 +5,7 @@ using Newtonsoft.Json;
namespace FemboyWatchdog namespace FemboyWatchdog
{ {
class LocationTracker class LocationProvider
{ {
private WebClient _wcIp; private WebClient _wcIp;
private WebClient _wcLocation; private WebClient _wcLocation;
@ -23,7 +23,7 @@ namespace FemboyWatchdog
} }
public LocationTracker(double interval = 15.0) public LocationProvider(double interval = 15.0)
{ {
_wcIp = new WebClient(); _wcIp = new WebClient();
_wcLocation = new WebClient(); _wcLocation = new WebClient();
@ -70,7 +70,7 @@ namespace FemboyWatchdog
catch (JsonSerializationException err) { } catch (JsonSerializationException err) { }
} }
void ip_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e) private void ip_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e)
{ {
if (e.Cancelled || e.Error != null) if (e.Cancelled || e.Error != null)
return; return;
@ -82,7 +82,7 @@ namespace FemboyWatchdog
string.Format( string.Format(
"http://api.ipstack.com/{0}?access_key={1}&fields=latitude,longitude,region_name,country_name,city", "http://api.ipstack.com/{0}?access_key={1}&fields=latitude,longitude,region_name,country_name,city",
e.Result, e.Result,
"31d59064bb7ef00a9daff4794b73118c" Properties.Settings.Default.IpStackApiToken
) )
)); ));
} }

View File

@ -0,0 +1,73 @@
namespace FemboyWatchdog
{
partial class MeetingNotification
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.alertLabel = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// alertLabel
//
this.alertLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.alertLabel.BackColor = System.Drawing.Color.Yellow;
this.alertLabel.Font = new System.Drawing.Font("Arial", 32.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.alertLabel.Location = new System.Drawing.Point(10, 10);
this.alertLabel.Name = "alertLabel";
this.alertLabel.Size = new System.Drawing.Size(480, 230);
this.alertLabel.TabIndex = 0;
this.alertLabel.Text = "ALERT: A COMPANY MEETING IS TAKING PLACE";
this.alertLabel.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// MeetingNotification
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.Red;
this.ClientSize = new System.Drawing.Size(500, 250);
this.Controls.Add(this.alertLabel);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.Name = "MeetingNotification";
this.ShowIcon = false;
this.ShowInTaskbar = false;
this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "MeetingNotification";
this.TopMost = true;
this.Load += new System.EventHandler(this.MeetingNotification_Load);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Label alertLabel;
}
}

View File

@ -0,0 +1,53 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Media;
using System.Text;
using System.Windows.Forms;
namespace FemboyWatchdog
{
public partial class MeetingNotification : Form
{
private Timer _flasher;
private int _timesFlashed;
public MeetingNotification()
{
InitializeComponent();
_flasher = new Timer();
_flasher.Interval = 500;
_flasher.Tick += new EventHandler(_flasher_Tick);
_timesFlashed = 0;
}
private void _flasher_Tick(object sender, EventArgs e)
{
if (++_timesFlashed > 10)
{
Close();
return;
}
if (Visible)
{
Hide();
}
else
{
Show();
}
}
private void MeetingNotification_Load(object sender, EventArgs e)
{
_flasher.Start();
SoundPlayer snd = new SoundPlayer(@"media\klaxon.wav");
snd.Play();
}
}
}

View File

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@ -0,0 +1,134 @@
using System;
using System.Net;
using System.Windows.Forms;
using Newtonsoft.Json;
namespace FemboyWatchdog
{
class MeetingProvider
{
private WebClient _meetingChecker;
private WebClient _meetingCreator;
private Timer _timer;
private MeetingInfo _meetInfo;
private DateTime _lastMeetingResponseTime = DateTime.MinValue;
private double _checkInterval;
private const double _DATETIME_EPSILON = 30.0;
public bool Checking { get; private set; }
public event EventHandler<MeetingInfo> MeetingStarted;
internal class MeetingInfo : EventArgs
{
public DateTime LastMeetingTime;
public string Error;
}
public MeetingProvider(double interval = 5.0)
{
_meetingChecker = new WebClient();
_meetingChecker.DownloadStringCompleted += new DownloadStringCompletedEventHandler(_meetingChecker_DownloadStringCompleted);
_meetingCreator = new WebClient();
_meetingCreator.Headers[HttpRequestHeader.ContentType] = "application/x-www-form-urlencoded";
_meetingCreator.UploadStringCompleted += new UploadStringCompletedEventHandler(_meetingCreator_UploadStringCompleted);
_checkInterval = interval;
Checking = false;
}
private void _meetingCreator_UploadStringCompleted(object sender, UploadStringCompletedEventArgs e)
{
// apparently headers get unset if you reuse the WebClient
_meetingCreator.Headers[HttpRequestHeader.ContentType] = "application/x-www-form-urlencoded";
if (e.Cancelled || e.Error != null)
return;
try
{
MeetingInfo response = JsonConvert.DeserializeObject<MeetingInfo>(e.Result);
if (response.Error != null)
return;
_meetInfo = response;
}
catch (JsonSerializationException err) { }
}
public void StartMeeting()
{
_meetingCreator.UploadStringAsync(
new Uri(Properties.Settings.Default.FemboyApiBaseUrl + "meet"),
"token=" + Properties.Settings.Default.FemboyApiToken
);
}
public void StartChecking()
{
if (Checking)
return;
_timer = new Timer();
_timer.Interval = Convert.ToInt32(_checkInterval * 1000);
_timer.Tick += new EventHandler(_timer_Tick);
_timer.Start();
Checking = true;
}
private void _meetingChecker_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e)
{
if (e.Cancelled || e.Error != null)
return;
try
{
MeetingInfo response = JsonConvert.DeserializeObject<MeetingInfo>(e.Result);
if (response.Error != null)
return;
_meetInfo = response;
// if a meeting is happened long ago, we don't care about it.
// also, avoid reacting twice to the same meeting.
if (Math.Abs((DateTime.UtcNow - _meetInfo.LastMeetingTime).TotalSeconds) <= _DATETIME_EPSILON
&& (DateTime.UtcNow - _lastMeetingResponseTime).TotalSeconds >= _checkInterval)
{
_lastMeetingResponseTime = _meetInfo.LastMeetingTime;
OnMeetingStarted(_meetInfo);
}
}
catch (JsonSerializationException err) { }
}
protected virtual void OnMeetingStarted(MeetingInfo e)
{
EventHandler<MeetingInfo> handler = MeetingStarted;
if (handler != null)
{
handler(this, e);
}
}
private void _timer_Tick(object sender, EventArgs e)
{
if (!_meetingChecker.IsBusy)
{
try
{
_meetingChecker.DownloadStringAsync(new Uri(
string.Format(
"{0}meet/?token={1}",
Properties.Settings.Default.FemboyApiBaseUrl,
Properties.Settings.Default.FemboyApiToken
)
));
}
catch (WebException err) { }
}
}
}
}

99
FemboyWatchdog/Monitor.Designer.cs generated Normal file
View File

@ -0,0 +1,99 @@
using AForge.Controls;
namespace FemboyWatchdog
{
partial class Monitor
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
CloseCurrentVideoSource();
GlobalHooks.UnhookWindowsHookEx(_hookID);
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.label1 = new System.Windows.Forms.Label();
this.vsp = new AForge.Controls.VideoSourcePlayer();
this.label2 = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// label1
//
this.label1.AutoSize = true;
this.label1.BackColor = System.Drawing.Color.Red;
this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label1.Location = new System.Drawing.Point(12, 9);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(183, 13);
this.label1.TabIndex = 0;
this.label1.Text = "YOU ARE BEING MONITORED";
//
// vsp
//
this.vsp.Location = new System.Drawing.Point(217, 9);
this.vsp.Name = "vsp";
this.vsp.Size = new System.Drawing.Size(256, 144);
this.vsp.TabIndex = 1;
this.vsp.VideoSource = null;
//
// label2
//
this.label2.AutoSize = true;
this.label2.BackColor = System.Drawing.Color.Yellow;
this.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label2.Location = new System.Drawing.Point(12, 76);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(187, 13);
this.label2.TabIndex = 2;
this.label2.Text = "\"SMILE!\" YOU\'RE ON CAMERA";
this.label2.Visible = false;
//
// Monitor
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(488, 164);
this.Controls.Add(this.label2);
this.Controls.Add(this.label1);
this.Controls.Add(this.vsp);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.Name = "Monitor";
this.ShowInTaskbar = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
this.Text = "FemboyWatchdog Monitor";
this.TopMost = true;
this.TransparencyKey = System.Drawing.SystemColors.Control;
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Label label1;
private AForge.Controls.VideoSourcePlayer vsp;
private System.Windows.Forms.Label label2;
}
}

235
FemboyWatchdog/Monitor.cs Normal file
View File

@ -0,0 +1,235 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Drawing.Imaging;
using System.IO;
using System.Media;
using System.Net;
using System.Runtime.InteropServices;
using System.Speech.Synthesis;
using System.Text;
using System.Windows.Forms;
using AForge.Video;
using AForge.Video.DirectShow;
namespace FemboyWatchdog
{
public partial class Monitor : Form
{
private DateTime clockIn = DateTime.Now;
private LocationProvider tracker;
private FilterInfoCollection videoDevices;
private VideoCaptureDevice videoDevice;
private VideoCapabilities[] videoCapabilities;
private Timer labelBlinkTimer;
private Timer ttsTimer;
private Timer mousemvmtTimer;
private int mousemvmtCount = 0;
/* mouse movements come in as a stream, so we'll say a mouse movement is "over" by waiting
a certain time with no movement */
private Timer lastmousemvmtTimer;
private SpeechSynthesizer ss;
private SolidBrush brush = new SolidBrush(Color.Red);
private Font font = new Font(FontFamily.GenericSansSerif, 24);
private GlobalHooks.LowLevelMouseProc _proc;
private static IntPtr _hookID = IntPtr.Zero;
public Monitor()
{
_proc = OnMouseMessage;
GlobalHooks.SetHook(_proc);
InitializeComponent();
ss = new SpeechSynthesizer();
tracker = new LocationProvider();
ttsTimer = new Timer();
ttsTimer.Interval = 15000;
labelBlinkTimer = new Timer();
labelBlinkTimer.Interval = 1000;
mousemvmtTimer = new Timer();
mousemvmtTimer.Interval = 60000;
mousemvmtTimer.Start();
lastmousemvmtTimer = new Timer();
lastmousemvmtTimer.Interval = 500;
// hook events
vsp.NewFrame += new AForge.Controls.VideoSourcePlayer.NewFrameHandler(vsp_NewFrame);
ttsTimer.Tick += new EventHandler(ttsTimer_Tick);
labelBlinkTimer.Tick += new EventHandler(labelBlinkTimer_Tick);
mousemvmtTimer.Tick += new EventHandler(mousemvmtTimer_Tick);
lastmousemvmtTimer.Tick += new EventHandler(lastmousemvmtTimer_Tick);
OpenCamera();
ttsTimer.Start();
}
private void lastmousemvmtTimer_Tick(object sender, EventArgs e)
{
++mousemvmtCount;
lastmousemvmtTimer.Stop();
}
private void mousemvmtTimer_Tick(object sender, EventArgs e)
{
int movements = mousemvmtCount;
// need to reset the count before showing dialogs because a non-response means it will never get reset
mousemvmtCount = 0;
if (movements < 5)
{
SoundPlayer snd = new SoundPlayer(@"media\beep.wav");
snd.Play();
DialogResult answer = MessageBox.Show(
this,
string.Format("WORKER: Your productivity ({0}) is below 5 mouse movements/minute. Are you sleeping?", mousemvmtCount),
"EMPLOYEE ALERT",
MessageBoxButtons.YesNo,
MessageBoxIcon.Exclamation
);
if (answer == DialogResult.Yes)
{
MessageBox.Show(
this,
"Expect a formal termination letter from human resources soon.",
"YOU'RE FIRED!",
MessageBoxButtons.OK,
MessageBoxIcon.Information
);
}
}
}
private IntPtr OnMouseMessage(int nCode, IntPtr wParam, IntPtr lParam)
{
if (nCode >= 0 && (GlobalHooks.MouseMessages)wParam == GlobalHooks.MouseMessages.WM_MOUSEMOVE)
{
if (!lastmousemvmtTimer.Enabled)
lastmousemvmtTimer.Start();
}
return GlobalHooks.CallNextHookEx(_hookID, nCode, wParam, lParam);
}
private void OpenCamera()
{
try
{
videoDevices = new FilterInfoCollection(FilterCategory.VideoInputDevice);
if (videoDevices.Count != 0)
{
videoDevice = new VideoCaptureDevice(videoDevices[0].MonikerString);
}
else
{
/*
MessageBox.Show(this, "Camera device not found! Get a webcam!", "Error initializing camera", MessageBoxButtons.OK, MessageBoxIcon.Error);
Environment.Exit(-2);
*/
vsp.Dispose();
return;
}
videoCapabilities = videoDevice.VideoCapabilities;
if (videoCapabilities.Length == 0)
{
/*
MessageBox.Show(this, "Camera does not support video capture! Get a better webcam!", "Error initializing camera", MessageBoxButtons.OK, MessageBoxIcon.Error);
Environment.Exit(-3);
*/
vsp.Dispose();
return;
}
// adjust VSP's resolution so as to not stretch the picture
double aspectRatio = 1.0 * videoCapabilities[0].FrameSize.Width / videoCapabilities[0].FrameSize.Height;
vsp.Size = new System.Drawing.Size(Convert.ToInt32(aspectRatio * 144), 144);
OpenVideoSource(videoDevice);
}
catch (Exception err)
{
/*
MessageBox.Show(this, err.ToString(), "Error initializing camera", MessageBoxButtons.OK, MessageBoxIcon.Error);
Environment.Exit(-1);
*/
vsp.Dispose();
}
}
private void labelBlinkTimer_Tick(object sender, EventArgs e)
{
this.label2.Visible = !this.label2.Visible;
}
private void ttsTimer_Tick(object sender, EventArgs e)
{
string msg = "You are being monitored.";
if (tracker.LocationData != null)
msg += string.Format(" Your location is: {0}, {1}", tracker.LocationData.latitude, tracker.LocationData.longitude);
ss.SpeakAsync(msg);
}
public void OpenVideoSource(IVideoSource source)
{
try
{
// set busy cursor
this.Cursor = Cursors.WaitCursor;
// stop current video source
CloseCurrentVideoSource();
// start new video source
vsp.VideoSource = source;
vsp.Start();
this.Cursor = Cursors.Default;
labelBlinkTimer.Start();
}
catch { }
}
public void CloseCurrentVideoSource()
{
try
{
if (vsp.VideoSource != null)
{
vsp.SignalToStop();
// wait ~ 3 seconds
for (int i = 0; i < 30; i++)
{
if (!vsp.IsRunning)
break;
System.Threading.Thread.Sleep(100);
}
if (vsp.IsRunning)
{
vsp.Stop();
}
vsp.VideoSource = null;
labelBlinkTimer.Stop();
}
}
catch { }
}
private void vsp_NewFrame(object sender, ref Bitmap image)
{
try
{
DateTime now = DateTime.Now;
Graphics g = Graphics.FromImage(image);
// paint current time
g.DrawString(now.ToString(), font, brush, new Point(5, 5));
g.DrawString("Clock in time: " + clockIn.ToString(), font, brush, new Point(5, image.Height - font.Height - 5));
}
catch
{ }
}
}
}

120
FemboyWatchdog/Monitor.resx Normal file
View File

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@ -1,9 +1,32 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Threading;
using System.Windows.Forms; using System.Windows.Forms;
namespace FemboyWatchdog namespace FemboyWatchdog
{ {
public class MultiFormContext : ApplicationContext
{
private int openForms;
public MultiFormContext(params Form[] forms)
{
openForms = forms.Length;
foreach (var form in forms)
{
form.FormClosed += (s, args) =>
{
//When we have closed the last of the "starting" forms,
//end the program.
if (Interlocked.Decrement(ref openForms) == 0)
ExitThread();
};
form.Show();
}
}
}
static class Program static class Program
{ {
/// <summary> /// <summary>
@ -14,7 +37,7 @@ namespace FemboyWatchdog
{ {
Application.EnableVisualStyles(); Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false); Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Toolbar()); Application.Run(new MultiFormContext(new Monitor(), new Toolbar()));
} }
} }
} }

View File

@ -6,9 +6,9 @@ using System.Runtime.InteropServices;
// set of attributes. Change these attribute values to modify the information // set of attributes. Change these attribute values to modify the information
// associated with an assembly. // associated with an assembly.
[assembly: AssemblyTitle("FemboyWatchdog")] [assembly: AssemblyTitle("FemboyWatchdog")]
[assembly: AssemblyDescription("")] [assembly: AssemblyDescription("FemboyWatchdog is the ultimate corporate surveillance mechanism!")]
[assembly: AssemblyConfiguration("")] [assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")] [assembly: AssemblyCompany("FemboyFinancial Holdings Co., Ltd.")]
[assembly: AssemblyProduct("FemboyWatchdog")] [assembly: AssemblyProduct("FemboyWatchdog")]
[assembly: AssemblyCopyright("Copyright © 2021")] [assembly: AssemblyCopyright("Copyright © 2021")]
[assembly: AssemblyTrademark("")] [assembly: AssemblyTrademark("")]
@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers // You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below: // by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyVersion("0.0.3.0")]
[assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyFileVersion("0.0.3.0")]

View File

@ -59,5 +59,15 @@ namespace FemboyWatchdog.Properties {
resourceCulture = value; resourceCulture = value;
} }
} }
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap ff {
get {
object obj = ResourceManager.GetObject("ff", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
} }
} }

View File

@ -46,7 +46,7 @@
mimetype: application/x-microsoft.net.object.binary.base64 mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding. : and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64 mimetype: application/x-microsoft.net.object.soap.base64
@ -60,6 +60,7 @@
: and then encoded with base64 encoding. : and then encoded with base64 encoding.
--> -->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true"> <xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType> <xsd:complexType>
<xsd:choice maxOccurs="unbounded"> <xsd:choice maxOccurs="unbounded">
@ -68,9 +69,10 @@
<xsd:sequence> <xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" /> <xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence> </xsd:sequence>
<xsd:attribute name="name" type="xsd:string" /> <xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" /> <xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" /> <xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType> </xsd:complexType>
</xsd:element> </xsd:element>
<xsd:element name="assembly"> <xsd:element name="assembly">
@ -85,9 +87,10 @@
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence> </xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" /> <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType> </xsd:complexType>
</xsd:element> </xsd:element>
<xsd:element name="resheader"> <xsd:element name="resheader">
@ -114,4 +117,8 @@
<resheader name="writer"> <resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="ff" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\ff.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root> </root>

View File

@ -22,5 +22,32 @@ namespace FemboyWatchdog.Properties {
return defaultInstance; return defaultInstance;
} }
} }
[global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("http://howfeed.biz/api/")]
public string FemboyApiBaseUrl {
get {
return ((string)(this["FemboyApiBaseUrl"]));
}
}
[global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("1445")]
public string FemboyApiToken {
get {
return ((string)(this["FemboyApiToken"]));
}
}
[global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("31d59064bb7ef00a9daff4794b73118c")]
public string IpStackApiToken {
get {
return ((string)(this["IpStackApiToken"]));
}
}
} }
} }

View File

@ -1,5 +1,15 @@
<?xml version='1.0' encoding='utf-8'?> <?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)"> <SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="FemboyWatchdog.Properties" GeneratedClassName="Settings">
<Profiles /> <Profiles />
<Settings /> <Settings>
<Setting Name="FemboyApiBaseUrl" Type="System.String" Scope="Application">
<Value Profile="(Default)">http://howfeed.biz/api/</Value>
</Setting>
<Setting Name="FemboyApiToken" Type="System.String" Scope="Application">
<Value Profile="(Default)">1445</Value>
</Setting>
<Setting Name="IpStackApiToken" Type="System.String" Scope="Application">
<Value Profile="(Default)">31d59064bb7ef00a9daff4794b73118c</Value>
</Setting>
</Settings>
</SettingsFile> </SettingsFile>

Binary file not shown.

After

Width:  |  Height:  |  Size: 904 KiB

View File

@ -1,6 +1,4 @@
using AForge.Controls; namespace FemboyWatchdog
namespace FemboyWatchdog
{ {
partial class Toolbar partial class Toolbar
{ {
@ -19,10 +17,6 @@ namespace FemboyWatchdog
{ {
components.Dispose(); components.Dispose();
} }
CloseCurrentVideoSource();
GlobalHooks.UnhookWindowsHookEx(_hookID);
base.Dispose(disposing); base.Dispose(disposing);
} }
@ -34,57 +28,92 @@ namespace FemboyWatchdog
/// </summary> /// </summary>
private void InitializeComponent() private void InitializeComponent()
{ {
this.label1 = new System.Windows.Forms.Label(); this.menuStrip1 = new System.Windows.Forms.MenuStrip();
this.vsp = new AForge.Controls.VideoSourcePlayer(); this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.label2 = new System.Windows.Forms.Label(); this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.meetingToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.callAMeetingToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.helpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.aboutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.menuStrip1.SuspendLayout();
this.SuspendLayout(); this.SuspendLayout();
// //
// label1 // menuStrip1
// //
this.label1.AutoSize = true; this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.label1.BackColor = System.Drawing.Color.Red; this.fileToolStripMenuItem,
this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.meetingToolStripMenuItem,
this.label1.Location = new System.Drawing.Point(12, 9); this.helpToolStripMenuItem});
this.label1.Name = "label1"; this.menuStrip1.Location = new System.Drawing.Point(0, 0);
this.label1.Size = new System.Drawing.Size(183, 13); this.menuStrip1.Name = "menuStrip1";
this.label1.TabIndex = 0; this.menuStrip1.Size = new System.Drawing.Size(400, 24);
this.label1.Text = "YOU ARE BEING MONITORED"; this.menuStrip1.TabIndex = 1;
this.menuStrip1.Text = "menuStrip1";
this.menuStrip1.MouseEnter += new System.EventHandler(this.menuStrip1_MouseEnter);
// //
// vsp // fileToolStripMenuItem
// //
this.vsp.Location = new System.Drawing.Point(217, 9); this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.vsp.Name = "vsp"; this.exitToolStripMenuItem});
this.vsp.Size = new System.Drawing.Size(256, 144); this.fileToolStripMenuItem.Name = "fileToolStripMenuItem";
this.vsp.TabIndex = 1; this.fileToolStripMenuItem.Size = new System.Drawing.Size(37, 20);
this.vsp.VideoSource = null; this.fileToolStripMenuItem.Text = "File";
// //
// label2 // exitToolStripMenuItem
// //
this.label2.AutoSize = true; this.exitToolStripMenuItem.Name = "exitToolStripMenuItem";
this.label2.BackColor = System.Drawing.Color.Yellow; this.exitToolStripMenuItem.Size = new System.Drawing.Size(92, 22);
this.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.exitToolStripMenuItem.Text = "Exit";
this.label2.Location = new System.Drawing.Point(12, 76); //
this.label2.Name = "label2"; // meetingToolStripMenuItem
this.label2.Size = new System.Drawing.Size(187, 13); //
this.label2.TabIndex = 2; this.meetingToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.label2.Text = "\"SMILE!\" YOU\'RE ON CAMERA"; this.callAMeetingToolStripMenuItem});
this.label2.Visible = false; this.meetingToolStripMenuItem.Name = "meetingToolStripMenuItem";
this.meetingToolStripMenuItem.Size = new System.Drawing.Size(63, 20);
this.meetingToolStripMenuItem.Text = "Meeting";
//
// callAMeetingToolStripMenuItem
//
this.callAMeetingToolStripMenuItem.Name = "callAMeetingToolStripMenuItem";
this.callAMeetingToolStripMenuItem.Size = new System.Drawing.Size(150, 22);
this.callAMeetingToolStripMenuItem.Text = "Call a Meeting";
this.callAMeetingToolStripMenuItem.Click += new System.EventHandler(this.callAMeetingToolStripMenuItem_Click);
//
// helpToolStripMenuItem
//
this.helpToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.aboutToolStripMenuItem});
this.helpToolStripMenuItem.Name = "helpToolStripMenuItem";
this.helpToolStripMenuItem.Size = new System.Drawing.Size(44, 20);
this.helpToolStripMenuItem.Text = "Help";
//
// aboutToolStripMenuItem
//
this.aboutToolStripMenuItem.Name = "aboutToolStripMenuItem";
this.aboutToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
this.aboutToolStripMenuItem.Text = "About";
this.aboutToolStripMenuItem.Click += new System.EventHandler(this.aboutToolStripMenuItem_Click);
// //
// Toolbar // Toolbar
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(488, 164); this.BackColor = System.Drawing.Color.Lime;
this.Controls.Add(this.label2); this.ClientSize = new System.Drawing.Size(400, 24);
this.Controls.Add(this.label1); this.Controls.Add(this.menuStrip1);
this.Controls.Add(this.vsp);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.MainMenuStrip = this.menuStrip1;
this.Name = "Toolbar"; this.Name = "Toolbar";
this.ShowIcon = false;
this.ShowInTaskbar = false; this.ShowInTaskbar = false;
this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
this.StartPosition = System.Windows.Forms.FormStartPosition.Manual; this.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
this.Text = "Toolbar"; this.Text = "FemboyWatchdog Toolbar";
this.TopMost = true; this.TopMost = true;
this.TransparencyKey = System.Drawing.SystemColors.Control; this.TransparencyKey = System.Drawing.Color.Lime;
this.menuStrip1.ResumeLayout(false);
this.menuStrip1.PerformLayout();
this.ResumeLayout(false); this.ResumeLayout(false);
this.PerformLayout(); this.PerformLayout();
@ -92,8 +121,13 @@ namespace FemboyWatchdog
#endregion #endregion
private System.Windows.Forms.Label label1; private System.Windows.Forms.MenuStrip menuStrip1;
private AForge.Controls.VideoSourcePlayer vsp; private System.Windows.Forms.ToolStripMenuItem fileToolStripMenuItem;
private System.Windows.Forms.Label label2; private System.Windows.Forms.ToolStripMenuItem exitToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem meetingToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem callAMeetingToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem helpToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem aboutToolStripMenuItem;
} }
} }

View File

@ -1,232 +1,47 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel; using System.ComponentModel;
using System.Data;
using System.Drawing; using System.Drawing;
using System.Drawing.Imaging;
using System.IO;
using System.Media;
using System.Net;
using System.Runtime.InteropServices;
using System.Speech.Synthesis;
using System.Text; using System.Text;
using System.Windows.Forms; using System.Windows.Forms;
using AForge.Video;
using AForge.Video.DirectShow;
namespace FemboyWatchdog namespace FemboyWatchdog
{ {
public partial class Toolbar : Form public partial class Toolbar : Form
{ {
private DateTime clockIn = DateTime.Now; private MeetingProvider meetings;
private LocationTracker tracker;
private FilterInfoCollection videoDevices;
private VideoCaptureDevice videoDevice;
private VideoCapabilities[] videoCapabilities;
private Timer labelBlinkTimer;
private Timer ttsTimer;
private Timer mousemvmtTimer;
private int mousemvmtCount = 0;
/* mouse movements come in as a stream, so we'll say a mouse movement is "over" by waiting
a certain time with no movement */
private Timer lastmousemvmtTimer;
private SpeechSynthesizer ss;
private SolidBrush brush = new SolidBrush(Color.Red);
private Font font = new Font(FontFamily.GenericSansSerif, 24);
private GlobalHooks.LowLevelMouseProc _proc;
private static IntPtr _hookID = IntPtr.Zero;
public Toolbar() public Toolbar()
{ {
_proc = OnMouseMessage;
GlobalHooks.SetHook(_proc);
InitializeComponent(); InitializeComponent();
Location = new Point((Screen.PrimaryScreen.Bounds.Width - Width) / 2, 0);
ss = new SpeechSynthesizer(); meetings = new MeetingProvider();
meetings.MeetingStarted += new EventHandler<MeetingProvider.MeetingInfo>(meetings_MeetingStarted);
tracker = new LocationTracker(); meetings.StartChecking();
ttsTimer = new Timer();
ttsTimer.Interval = 15000;
labelBlinkTimer = new Timer();
labelBlinkTimer.Interval = 1000;
mousemvmtTimer = new Timer();
mousemvmtTimer.Interval = 60000;
mousemvmtTimer.Start();
lastmousemvmtTimer = new Timer();
lastmousemvmtTimer.Interval = 500;
// hook events
vsp.NewFrame += new AForge.Controls.VideoSourcePlayer.NewFrameHandler(vsp_NewFrame);
ttsTimer.Tick += new EventHandler(ttsTimer_Tick);
labelBlinkTimer.Tick += new EventHandler(labelBlinkTimer_Tick);
mousemvmtTimer.Tick += new EventHandler(mousemoveTimer_Tick);
lastmousemvmtTimer.Tick += new EventHandler(lastmousemvmtTimer_Tick);
OpenCamera();
ttsTimer.Start();
} }
private void lastmousemvmtTimer_Tick(object sender, EventArgs e) private void meetings_MeetingStarted(object sender, EventArgs e)
{ {
++mousemvmtCount; MeetingNotification alert = new MeetingNotification();
lastmousemvmtTimer.Stop(); alert.Show();
} }
private void mousemoveTimer_Tick(object sender, EventArgs e) private void callAMeetingToolStripMenuItem_Click(object sender, EventArgs e)
{ {
if (mousemvmtCount < 5) meetings.StartMeeting();
{
SoundPlayer snd = new SoundPlayer(@"media\beep.wav");
snd.Play();
DialogResult answer = MessageBox.Show(
this,
string.Format("WORKER: Your productivity ({0}) is below 5 mouse movements/minute. Are you sleeping?", mousemvmtCount),
"EMPLOYEE ALERT",
MessageBoxButtons.YesNo,
MessageBoxIcon.Exclamation
);
if (answer == DialogResult.Yes)
{
MessageBox.Show(
this,
"Expect a formal termination letter from human resources soon.",
"YOU'RE FIRED!",
MessageBoxButtons.OK,
MessageBoxIcon.Information
);
}
}
mousemvmtCount = 0;
} }
private IntPtr OnMouseMessage(int nCode, IntPtr wParam, IntPtr lParam) private void menuStrip1_MouseEnter(object sender, EventArgs e)
{ {
if (nCode >= 0 && (GlobalHooks.MouseMessages)wParam == GlobalHooks.MouseMessages.WM_MOUSEMOVE) Focus();
{
if (!lastmousemvmtTimer.Enabled)
lastmousemvmtTimer.Start();
}
return GlobalHooks.CallNextHookEx(_hookID, nCode, wParam, lParam);
} }
private void OpenCamera() private void aboutToolStripMenuItem_Click(object sender, EventArgs e)
{ {
try AboutBox dialog = new AboutBox();
{ dialog.ShowDialog();
videoDevices = new FilterInfoCollection(FilterCategory.VideoInputDevice);
if (videoDevices.Count != 0)
{
videoDevice = new VideoCaptureDevice(videoDevices[0].MonikerString);
}
else
{
/*
MessageBox.Show(this, "Camera device not found! Get a webcam!", "Error initializing camera", MessageBoxButtons.OK, MessageBoxIcon.Error);
Environment.Exit(-2);
*/
vsp.Dispose();
return;
}
videoCapabilities = videoDevice.VideoCapabilities;
if (videoCapabilities.Length == 0)
{
/*
MessageBox.Show(this, "Camera does not support video capture! Get a better webcam!", "Error initializing camera", MessageBoxButtons.OK, MessageBoxIcon.Error);
Environment.Exit(-3);
*/
vsp.Dispose();
return;
}
// adjust VSP's resolution so as to not stretch the picture
double aspectRatio = 1.0 * videoCapabilities[0].FrameSize.Width / videoCapabilities[0].FrameSize.Height;
vsp.Size = new System.Drawing.Size(Convert.ToInt32(aspectRatio * 144), 144);
OpenVideoSource(videoDevice);
}
catch (Exception err)
{
/*
MessageBox.Show(this, err.ToString(), "Error initializing camera", MessageBoxButtons.OK, MessageBoxIcon.Error);
Environment.Exit(-1);
*/
vsp.Dispose();
}
}
private void labelBlinkTimer_Tick(object sender, EventArgs e)
{
this.label2.Visible = !this.label2.Visible;
}
private void ttsTimer_Tick(object sender, EventArgs e)
{
string msg = "You are being monitored.";
if (tracker.LocationData != null)
msg += string.Format(" Your location is: {0}, {1}", tracker.LocationData.latitude, tracker.LocationData.longitude);
ss.SpeakAsync(msg);
}
public void OpenVideoSource(IVideoSource source)
{
try
{
// set busy cursor
this.Cursor = Cursors.WaitCursor;
// stop current video source
CloseCurrentVideoSource();
// start new video source
vsp.VideoSource = source;
vsp.Start();
this.Cursor = Cursors.Default;
labelBlinkTimer.Start();
}
catch { }
}
public void CloseCurrentVideoSource()
{
try
{
if (vsp.VideoSource != null)
{
vsp.SignalToStop();
// wait ~ 3 seconds
for (int i = 0; i < 30; i++)
{
if (!vsp.IsRunning)
break;
System.Threading.Thread.Sleep(100);
}
if (vsp.IsRunning)
{
vsp.Stop();
}
vsp.VideoSource = null;
labelBlinkTimer.Stop();
}
}
catch { }
}
private void vsp_NewFrame(object sender, ref Bitmap image)
{
try
{
DateTime now = DateTime.Now;
Graphics g = Graphics.FromImage(image);
// paint current time
g.DrawString(now.ToString(), font, brush, new Point(5, 5));
g.DrawString("Clock in time: " + clockIn.ToString(), font, brush, new Point(5, image.Height - font.Height - 5));
}
catch
{ }
} }
} }
} }

View File

@ -117,4 +117,7 @@
<resheader name="writer"> <resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </resheader>
<metadata name="menuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root> </root>

View File

@ -1,6 +1,22 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<configuration> <configuration>
<configSections> <configSections>
<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="FemboyWatchdog.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</sectionGroup>
</configSections> </configSections>
<startup><supportedRuntime version="v2.0.50727"/></startup> <startup><supportedRuntime version="v2.0.50727"/></startup>
<applicationSettings>
<FemboyWatchdog.Properties.Settings>
<setting name="FemboyApiBaseUrl" serializeAs="String">
<value>http://howfeed.biz/api/</value>
</setting>
<setting name="FemboyApiToken" serializeAs="String">
<value>1445</value>
</setting>
<setting name="IpStackApiToken" serializeAs="String">
<value>31d59064bb7ef00a9daff4794b73118c</value>
</setting>
</FemboyWatchdog.Properties.Settings>
</applicationSettings>
</configuration> </configuration>

Binary file not shown.

View File

@ -6,5 +6,6 @@
<package id="AForge.Math" version="2.2.5" targetFramework="net30" /> <package id="AForge.Math" version="2.2.5" targetFramework="net30" />
<package id="AForge.Video" version="2.2.5" targetFramework="net30" /> <package id="AForge.Video" version="2.2.5" targetFramework="net30" />
<package id="AForge.Video.DirectShow" version="2.2.5" targetFramework="net30" /> <package id="AForge.Video.DirectShow" version="2.2.5" targetFramework="net30" />
<package id="NetSparkle.New" version="0.19.2" targetFramework="net30" />
<package id="Newtonsoft.Json" version="9.0.1" targetFramework="net30" /> <package id="Newtonsoft.Json" version="9.0.1" targetFramework="net30" />
</packages> </packages>

View File

@ -4,7 +4,7 @@ The ultimate corporate surveillance mechanism!
## User Requirements ## User Requirements
- .NET Framework 3.5 - .NET Framework 3.0
- Windows XP and up - Windows XP and up