diff --git a/AffdexMe/AffdexMe.csproj b/AffdexMe/AffdexMe.csproj new file mode 100644 index 0000000..fce5f81 --- /dev/null +++ b/AffdexMe/AffdexMe.csproj @@ -0,0 +1,116 @@ + + + + + Debug + AnyCPU + {5B893EA1-EB11-425A-BF8A-05822F5E2C9A} + WinExe + Properties + AffdexMe + AffdexMe + v4.5 + 512 + {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + 4 + + + x86 + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + $(ProjectDir)Resources\AffdexMe_Logo.ico + + + x86 + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + ..\..\Program Files (x86)\Affectiva\Affdex SDK\bin\debug\Affdex.dll + + + ..\..\Program Files (x86)\Affectiva\Affdex SDK\bin\release\Affdex.dll + + + + + + + + + + + + 4.0 + + + + + + + + MSBuild:Compile + Designer + + + Code + + + $(ProjectDir)MainWindow.xaml + Code + + + + + Code + + + True + True + Resources.resx + + + True + $(ProjectDir)Settings.settings + True + + + ResXFileCodeGenerator + $(ProjectDir)Resources.Designer.cs + + + + SettingsSingleFileGenerator + $(ProjectDir)Settings.Designer.cs + + + + + + + + + + + + + \ No newline at end of file diff --git a/AffdexMe/App.config b/AffdexMe/App.config new file mode 100644 index 0000000..8e15646 --- /dev/null +++ b/AffdexMe/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/AffdexMe/App.cs b/AffdexMe/App.cs new file mode 100644 index 0000000..9168056 --- /dev/null +++ b/AffdexMe/App.cs @@ -0,0 +1,82 @@ +using System; +using System.Collections.Generic; +using System.Configuration; +using System.Data; +using System.Linq; +using System.Threading.Tasks; +using System.Windows; + +using Microsoft.VisualBasic.ApplicationServices; + +namespace AffdexMe +{ + /// + /// Interaction logic for App.xaml + /// + public partial class App : Application + { + } + + + /// + /// From reference source: https://msdn.microsoft.com/en-us/library/vstudio/ms771662(v=vs.90).aspx + /// + public class EntryPoint + { + [STAThread] + public static void Main(string[] args) + { + SingleInstanceManager manager = new SingleInstanceManager(); + manager.Run(args); + } + } + + // Using VB bits to detect single instances and process accordingly: + // * OnStartup is fired when the first instance loads + // * OnStartupNextInstance is fired when the application is re-run again + // NOTE: it is redirected to this instance thanks to IsSingleInstance + public class SingleInstanceManager : WindowsFormsApplicationBase + { + SingleInstanceApplication app; + + public SingleInstanceManager() + { + this.IsSingleInstance = true; + } + + + protected override bool OnStartup(Microsoft.VisualBasic.ApplicationServices.StartupEventArgs e) + { + // First time app is launched + app = new SingleInstanceApplication(); + app.Run(); + return false; + } + + protected override void OnStartupNextInstance(StartupNextInstanceEventArgs eventArgs) + { + // Subsequent launches + base.OnStartupNextInstance(eventArgs); + app.Activate(); + } + } + + public class SingleInstanceApplication : Application + { + + protected override void OnStartup(System.Windows.StartupEventArgs e) + { + base.OnStartup(e); + + // Create and show the application's main window + MainWindow window = new MainWindow(); + window.Show(); + } + + public void Activate() + { + // Reactivate application's main window + this.MainWindow.Activate(); + } + } +} diff --git a/AffdexMe/App.xaml b/AffdexMe/App.xaml new file mode 100644 index 0000000..868f299 --- /dev/null +++ b/AffdexMe/App.xaml @@ -0,0 +1,8 @@ + + + + + diff --git a/AffdexMe/App.xaml.cs b/AffdexMe/App.xaml.cs new file mode 100644 index 0000000..8514a22 --- /dev/null +++ b/AffdexMe/App.xaml.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Configuration; +using System.Data; +using System.Linq; +using System.Threading.Tasks; +using System.Windows; + +namespace AffdexMe +{ + /// + /// Interaction logic for App.xaml + /// + public partial class App : Application + { + } +} diff --git a/AffdexMe/Fonts/Square.ttf b/AffdexMe/Fonts/Square.ttf new file mode 100644 index 0000000..9f1867e Binary files /dev/null and b/AffdexMe/Fonts/Square.ttf differ diff --git a/AffdexMe/MainWindow.xaml b/AffdexMe/MainWindow.xaml new file mode 100644 index 0000000..264d2ab --- /dev/null +++ b/AffdexMe/MainWindow.xaml @@ -0,0 +1,248 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +