├── .gitignore ├── Not UI Suppressed ├── App.xaml ├── App.xaml.cs ├── LyncExtensions.cs ├── Main.xaml ├── Main.xaml.cs ├── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ ├── Resources.resx │ ├── Settings.Designer.cs │ └── Settings.settings ├── ReadMe-nonUI.txt ├── SuperSimpleLyncKiosk-Not UI Suppressed.csproj ├── SuperSimpleLyncKiosk.ico ├── app.config └── lib │ └── InputSimulator.dll ├── README.md ├── Registry Key Changes ├── 32bit-UISuppression-OFF.reg ├── 32bit-UISuppression-ON.reg ├── 64bit-UISuppression-OFF.reg └── 64bit-UISuppression-ON.reg ├── SuperSimpleLyncKiosk.sln └── UI Suppressed ├── App.xaml ├── App.xaml.cs ├── Converters ├── LyncPresenceColourConverter.cs └── LyncPresenceTextConverter.cs ├── Extensions └── ControlExtension.cs ├── Images ├── contact.png ├── hangup.png └── phone.png ├── Properties ├── AssemblyInfo.cs ├── Resources.Designer.cs ├── Resources.resx ├── Settings.Designer.cs └── Settings.settings ├── ReadMe-UI.txt ├── SuperSimpleLyncKiosk - UI Suppressed.csproj ├── SuperSimpleLyncKiosk - UI Suppressed.csproj.user ├── SuperSimpleLyncKiosk.ico ├── ViewModels ├── Command.cs ├── IncomingCallViewModel.cs ├── MainViewModel.cs ├── NoCallViewModel.cs └── ViewModelBase.cs ├── Views ├── Call.xaml ├── Call.xaml.cs ├── MainView.xaml ├── MainView.xaml.cs ├── NoCall.xaml ├── NoCall.xaml.cs ├── SignInFailed.xaml ├── SignInFailed.xaml.cs ├── SigningIn.xaml └── SigningIn.xaml.cs ├── app.config └── lib └── LyncUISupressionWrapper.dll /.gitignore: -------------------------------------------------------------------------------- 1 | # Build Folders (you can keep bin if you'd like, to store dlls and pdbs) 2 | bin 3 | obj 4 | 5 | # mstest test results 6 | TestResults 7 | 8 | *.suo -------------------------------------------------------------------------------- /Not UI Suppressed/App.xaml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Not UI Suppressed/App.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Configuration; 4 | using System.Data; 5 | using System.Windows; 6 | using System.Diagnostics; 7 | 8 | namespace SuperSimpleLyncKiosk 9 | { 10 | /// 11 | /// Interaction logic for App.xaml 12 | /// 13 | public partial class App : Application 14 | { 15 | protected override void OnStartup(StartupEventArgs e) 16 | { 17 | // Get Reference to the current Process 18 | Process me = Process.GetCurrentProcess(); 19 | // Check how many total processes have the same name as the current one 20 | if (Process.GetProcessesByName(me.ProcessName).Length > 1) 21 | { 22 | Application.Current.Shutdown(); 23 | return; 24 | } 25 | 26 | base.OnStartup(e); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Not UI Suppressed/LyncExtensions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Diagnostics; 3 | using System.Linq; 4 | using System.Runtime.InteropServices; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | using Microsoft.Lync.Model; 8 | using Microsoft.Lync.Model.Conversation; 9 | using Microsoft.Lync.Model.Conversation.AudioVideo; 10 | 11 | namespace SuperSimpleLyncKiosk 12 | { 13 | public static class LyncExtensions 14 | { 15 | public static Task StartAsync(this VideoChannel videoChannel) 16 | { 17 | return Task.Factory.FromAsync(videoChannel.BeginStart, videoChannel.EndStart, null); 18 | } 19 | 20 | public static void AutoAnswerIncomingVideoCalls(this ConversationManager conversationManager) 21 | { 22 | AutoAnswerIncomingVideoCalls(conversationManager, () => true); 23 | } 24 | 25 | public static void AutoAnswerIncomingVideoCalls(this ConversationManager conversationManager, Func predicate) 26 | { 27 | conversationManager.ConversationAdded += (s, e) => ConversationManager_ConversationAdded(s, e, predicate); 28 | } 29 | 30 | public static void AnswerVideo(this Conversation conversation) 31 | { 32 | if (conversation.State == ConversationState.Terminated) 33 | { 34 | return; 35 | } 36 | 37 | var av = (AVModality)conversation.Modalities[ModalityTypes.AudioVideo]; 38 | if (av.CanInvoke(ModalityAction.Connect)) 39 | { 40 | av.Accept(); 41 | 42 | // Get ready to be connected, then WE can start OUR video 43 | av.ModalityStateChanged += AVModality_ModalityStateChanged; 44 | } 45 | } 46 | 47 | private static void ConversationManager_ConversationAdded(object sender, ConversationManagerEventArgs e, Func autoAnswerPredicate) 48 | { 49 | var lync = LyncClient.GetClient(); 50 | var incomingAV = false; 51 | var sb = new StringBuilder(); 52 | var av = e.Conversation.Modalities[ModalityTypes.AudioVideo]; 53 | var im = e.Conversation.Modalities[ModalityTypes.InstantMessage]; 54 | 55 | // Is this an audio/video invitation? 56 | if (av.State == ModalityState.Notified) 57 | { 58 | if (lync.DeviceManager.ActiveAudioDevice != null) 59 | { 60 | sb.Append("Incoming call from "); 61 | incomingAV = true; 62 | } 63 | else 64 | { 65 | av.Reject(ModalityDisconnectReason.NotAcceptableHere); 66 | } 67 | } 68 | if (im.State == ModalityState.Connected) 69 | { 70 | sb.Append("Incoming IM from "); 71 | } 72 | 73 | sb.Append(String.Join(", ", e.Conversation.Participants.Select(i => i.Contact.Uri))); 74 | Debug.WriteLine(sb.ToString()); 75 | 76 | //eventArgs.Conversation.ParticipantAdded += Conversation_ParticipantAdded; 77 | //eventArgs.Conversation.StateChanged += Conversation_ConversationChangedEvent; 78 | //eventArgs.Conversation.ActionAvailabilityChanged += Conversation_ActionAvailabilityChanged; 79 | 80 | if (incomingAV && autoAnswerPredicate()) 81 | { 82 | e.Conversation.AnswerVideo(); 83 | } 84 | } 85 | 86 | private static void AVModality_ModalityStateChanged(object sender, ModalityStateChangedEventArgs e) 87 | { 88 | if (e.NewState == ModalityState.Connected) 89 | { 90 | // We can't start video until it's connected 91 | var vc = ((AVModality)sender).VideoChannel; 92 | vc.StateChanged += VideoChannel_StateChanged; 93 | } 94 | } 95 | 96 | private static void VideoChannel_StateChanged(object sender, ChannelStateChangedEventArgs e) 97 | { 98 | if (e.NewState != ChannelState.Receive) 99 | { 100 | return; 101 | } 102 | 103 | var vc = (VideoChannel)sender; 104 | if (vc.CanInvoke(ChannelAction.Start)) 105 | { 106 | vc.StartAsync().ContinueWith(t => 107 | { 108 | // Go looking around for the IM Window (there had better just be the one we just started) 109 | // and force it to the foreground 110 | IntPtr childHandle = UnsafeNativeMethods.FindWindowEx(IntPtr.Zero, IntPtr.Zero, "IMWindowClass", null); 111 | UnsafeNativeMethods.SetForegroundWindow(childHandle); 112 | 113 | // Try to get the video to go full screen by pressing F5 114 | WindowsInput.InputSimulator.SimulateKeyPress(WindowsInput.VirtualKeyCode.F5); 115 | }); 116 | } 117 | else 118 | { 119 | Debug.WriteLine("CanInvoke said NO!"); 120 | } 121 | } 122 | } 123 | 124 | public static class UnsafeNativeMethods 125 | { 126 | [DllImport("user32.dll")] 127 | public static extern IntPtr FindWindowEx(IntPtr parentHandle, IntPtr childAfter, string className, string windowTitle); 128 | 129 | [DllImport("user32.dll")] 130 | public static extern bool SetForegroundWindow(IntPtr hWnd); 131 | } 132 | } 133 | -------------------------------------------------------------------------------- /Not UI Suppressed/Main.xaml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 16 | 20 | 21 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /Not UI Suppressed/Main.xaml.cs: -------------------------------------------------------------------------------- 1 | using System.Windows; 2 | using Microsoft.Lync.Model; 3 | 4 | namespace SuperSimpleLyncKiosk 5 | { 6 | public partial class Main : Window 7 | { 8 | public Main() 9 | { 10 | InitializeComponent(); 11 | this.WindowState = System.Windows.WindowState.Maximized; 12 | 13 | var lync = LyncClient.GetClient(); 14 | 15 | lync.ConversationManager.AutoAnswerIncomingVideoCalls(() => Properties.Settings.Default.autoAnswer); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Not UI Suppressed/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Resources; 3 | using System.Runtime.CompilerServices; 4 | using System.Runtime.InteropServices; 5 | using System.Windows; 6 | 7 | // General Information about an assembly is controlled through the following 8 | // set of attributes. Change these attribute values to modify the information 9 | // associated with an assembly. 10 | [assembly: AssemblyTitle("SuperSimpleLyncKiosk")] 11 | [assembly: AssemblyDescription("")] 12 | [assembly: AssemblyConfiguration("")] 13 | [assembly: AssemblyCompany("")] 14 | [assembly: AssemblyProduct("SuperSimpleLyncKiosk")] 15 | [assembly: AssemblyCopyright("Copyright © 2012")] 16 | [assembly: AssemblyTrademark("")] 17 | [assembly: AssemblyCulture("")] 18 | 19 | // Setting ComVisible to false makes the types in this assembly not visible 20 | // to COM components. If you need to access a type in this assembly from 21 | // COM, set the ComVisible attribute to true on that type. 22 | [assembly: ComVisible(false)] 23 | 24 | //In order to begin building localizable applications, set 25 | //CultureYouAreCodingWith in your .csproj file 26 | //inside a . For example, if you are using US english 27 | //in your source files, set the to en-US. Then uncomment 28 | //the NeutralResourceLanguage attribute below. Update the "en-US" in 29 | //the line below to match the UICulture setting in the project file. 30 | 31 | //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] 32 | 33 | 34 | [assembly: ThemeInfo( 35 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located 36 | //(used if a resource is not found in the page, 37 | // or application resource dictionaries) 38 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located 39 | //(used if a resource is not found in the page, 40 | // app, or any theme specific resource dictionaries) 41 | )] 42 | 43 | 44 | // Version information for an assembly consists of the following four values: 45 | // 46 | // Major Version 47 | // Minor Version 48 | // Build Number 49 | // Revision 50 | // 51 | // You can specify all the values or you can default the Build and Revision Numbers 52 | // by using the '*' as shown below: 53 | // [assembly: AssemblyVersion("1.0.*")] 54 | [assembly: AssemblyVersion("1.0.0.0")] 55 | [assembly: AssemblyFileVersion("1.0.0.0")] 56 | -------------------------------------------------------------------------------- /Not UI Suppressed/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.17626 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace SuperSimpleLyncKiosk.Properties { 12 | using System; 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources { 26 | 27 | private static global::System.Resources.ResourceManager resourceMan; 28 | 29 | private static global::System.Globalization.CultureInfo resourceCulture; 30 | 31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 32 | internal Resources() { 33 | } 34 | 35 | /// 36 | /// Returns the cached ResourceManager instance used by this class. 37 | /// 38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 39 | internal static global::System.Resources.ResourceManager ResourceManager { 40 | get { 41 | if (object.ReferenceEquals(resourceMan, null)) { 42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("SuperSimpleLyncKiosk.Properties.Resources", typeof(Resources).Assembly); 43 | resourceMan = temp; 44 | } 45 | return resourceMan; 46 | } 47 | } 48 | 49 | /// 50 | /// Overrides the current thread's CurrentUICulture property for all 51 | /// resource lookups using this strongly typed resource class. 52 | /// 53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 54 | internal static global::System.Globalization.CultureInfo Culture { 55 | get { 56 | return resourceCulture; 57 | } 58 | set { 59 | resourceCulture = value; 60 | } 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /Not UI Suppressed/Properties/Resources.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | text/microsoft-resx 107 | 108 | 109 | 2.0 110 | 111 | 112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 113 | 114 | 115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | -------------------------------------------------------------------------------- /Not UI Suppressed/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.269 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace SuperSimpleLyncKiosk.Properties { 12 | 13 | 14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")] 16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { 17 | 18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 19 | 20 | public static Settings Default { 21 | get { 22 | return defaultInstance; 23 | } 24 | } 25 | 26 | [global::System.Configuration.UserScopedSettingAttribute()] 27 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 28 | [global::System.Configuration.DefaultSettingValueAttribute("True")] 29 | public bool autoAnswer { 30 | get { 31 | return ((bool)(this["autoAnswer"])); 32 | } 33 | set { 34 | this["autoAnswer"] = value; 35 | } 36 | } 37 | 38 | [global::System.Configuration.UserScopedSettingAttribute()] 39 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 40 | [global::System.Configuration.DefaultSettingValueAttribute("sip:scottha@microsoft.com")] 41 | public string sipEmailAddress { 42 | get { 43 | return ((string)(this["sipEmailAddress"])); 44 | } 45 | set { 46 | this["sipEmailAddress"] = value; 47 | } 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /Not UI Suppressed/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | True 7 | 8 | 9 | sip:scottha@microsoft.com 10 | 11 | 12 | -------------------------------------------------------------------------------- /Not UI Suppressed/ReadMe-nonUI.txt: -------------------------------------------------------------------------------- 1 | Lync 2012 Super Simple Auto Answer Video Kiosk with Full Screen 2 | 3 | Not UI Suppression Edition 4 | --------------------------------------------------------------- 5 | 6 | What it does 7 | ------------ 8 | Monitors the presence of a user (not the signed in user). Auto-answers and full-screens incoming video calls made to the signed-in user. 9 | 10 | How to use it 11 | ------------- 12 | 1. Lync 2010 should be running and signed in. 13 | 2. Edit the app.config file, changing the value of sipEmailAddress to be the address you wish to monitor presence for. 14 | 15 | More Information 16 | ---------------- 17 | The project repository: https://github.com/shanselman/LyncAutoAnswer 18 | The project page: http://LyncAutoAnswer.com (full description, blog post references, author information etc.) 19 | 20 | A special nod to the InputSimulator project on CodePlex, as I'm using his excellent library: http://inputsimulator.codeplex.com/ -------------------------------------------------------------------------------- /Not UI Suppressed/SuperSimpleLyncKiosk-Not UI Suppressed.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Debug 5 | AnyCPU 6 | 8.0.30703 7 | 2.0 8 | {7EE33536-A206-4C4A-BD79-DEFFCE2EC71B} 9 | WinExe 10 | Properties 11 | SuperSimpleLyncKiosk 12 | SuperSimpleLyncKiosk 13 | v4.0 14 | Client 15 | 512 16 | {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 17 | 4 18 | 19 | 20 | true 21 | full 22 | false 23 | bin\Debug\ 24 | DEBUG;TRACE 25 | prompt 26 | 4 27 | 28 | x86 29 | 30 | 31 | pdbonly 32 | true 33 | bin\Release\ 34 | TRACE 35 | prompt 36 | 4 37 | 38 | x86 39 | 40 | 41 | SuperSimpleLyncKiosk.App 42 | 43 | 44 | SuperSimpleLyncKiosk.ico 45 | 46 | 47 | 48 | False 49 | lib\InputSimulator.dll 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 4.0 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | MSBuild:Compile 72 | Designer 73 | 74 | 75 | MSBuild:Compile 76 | Designer 77 | 78 | 79 | App.xaml 80 | Code 81 | 82 | 83 | 84 | Main.xaml 85 | Code 86 | 87 | 88 | 89 | 90 | Code 91 | 92 | 93 | True 94 | True 95 | Resources.resx 96 | 97 | 98 | True 99 | Settings.settings 100 | True 101 | 102 | 103 | ResXFileCodeGenerator 104 | Resources.Designer.cs 105 | 106 | 107 | 108 | SettingsSingleFileGenerator 109 | Settings.Designer.cs 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 124 | -------------------------------------------------------------------------------- /Not UI Suppressed/SuperSimpleLyncKiosk.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shanselman/LyncAutoAnswer/6c9ac2ba54e3bba0518c0946c47e9eeb62d02bf9/Not UI Suppressed/SuperSimpleLyncKiosk.ico -------------------------------------------------------------------------------- /Not UI Suppressed/app.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 |
6 | 7 | 8 | 9 | 10 | 11 | 12 | True 13 | 14 | 15 | sip:scottha@microsoft.com 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /Not UI Suppressed/lib/InputSimulator.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shanselman/LyncAutoAnswer/6c9ac2ba54e3bba0518c0946c47e9eeb62d02bf9/Not UI Suppressed/lib/InputSimulator.dll -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Lync 2012 Super Simple Auto Answer Video Kiosk with Full Screen, son. 2 | ============== 3 | Lots more info at http://lyncautoanswer.com, be sure to visit. 4 | 5 | I have a machine at my remote office in Seattle that is dedicated to Lync Video. For whatever reason the Lync folks don't include basic checkbox options like "Auto Answer" and "Start Video Automatically when someone calls" and "Make Video Fullscreen." 6 | 7 | I have [dozens of articles on my blog dedicated to Remote Work setup](http://www.hanselman.com/blog/CategoryView.aspx?category=Remote+Work) that I hope you check out. 8 | 9 | So, I did all that myself using the Lync SDK. Which is a nightmare. But it's done, so that's something. 10 | 11 | Feel free to have fun with the code, but I only guarantee that it "Works on My Machine.©™" 12 | 13 | ![](http://www.hanselman.com/blog/content/binary/WindowsLiveWriter/IntroducingRockScroll_C29C/works-on-my-machine-starburst_3.png) 14 | 15 | If you like it, [give money to Diabetes Research](http://hanselman.com/fightdiabetes). 16 | 17 | A special nod to the [InputSimulator project on CodePlex](http://inputsimulator.codeplex.com/), as I'm using his excellent library. I'm also using the [Lync 2010 Client Developer SDK](http://www.microsoft.com/en-us/download/details.aspx?id=18898). 18 | 19 | - [Scott Hanselman](http://hanselman.com) 20 | -------------------------------------------------------------------------------- /Registry Key Changes/32bit-UISuppression-OFF.reg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shanselman/LyncAutoAnswer/6c9ac2ba54e3bba0518c0946c47e9eeb62d02bf9/Registry Key Changes/32bit-UISuppression-OFF.reg -------------------------------------------------------------------------------- /Registry Key Changes/32bit-UISuppression-ON.reg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shanselman/LyncAutoAnswer/6c9ac2ba54e3bba0518c0946c47e9eeb62d02bf9/Registry Key Changes/32bit-UISuppression-ON.reg -------------------------------------------------------------------------------- /Registry Key Changes/64bit-UISuppression-OFF.reg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shanselman/LyncAutoAnswer/6c9ac2ba54e3bba0518c0946c47e9eeb62d02bf9/Registry Key Changes/64bit-UISuppression-OFF.reg -------------------------------------------------------------------------------- /Registry Key Changes/64bit-UISuppression-ON.reg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shanselman/LyncAutoAnswer/6c9ac2ba54e3bba0518c0946c47e9eeb62d02bf9/Registry Key Changes/64bit-UISuppression-ON.reg -------------------------------------------------------------------------------- /SuperSimpleLyncKiosk.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2010 4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SuperSimpleLyncKiosk-Not UI Suppressed", "Not UI Suppressed\SuperSimpleLyncKiosk-Not UI Suppressed.csproj", "{7EE33536-A206-4C4A-BD79-DEFFCE2EC71B}" 5 | EndProject 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SuperSimpleLyncKiosk - UI Suppressed", "UI Suppressed\SuperSimpleLyncKiosk - UI Suppressed.csproj", "{D19814DB-FAD0-43B0-89DB-BA3AA88239B1}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {7EE33536-A206-4C4A-BD79-DEFFCE2EC71B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {7EE33536-A206-4C4A-BD79-DEFFCE2EC71B}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {7EE33536-A206-4C4A-BD79-DEFFCE2EC71B}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {7EE33536-A206-4C4A-BD79-DEFFCE2EC71B}.Release|Any CPU.Build.0 = Release|Any CPU 18 | {D19814DB-FAD0-43B0-89DB-BA3AA88239B1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 19 | {D19814DB-FAD0-43B0-89DB-BA3AA88239B1}.Debug|Any CPU.Build.0 = Debug|Any CPU 20 | {D19814DB-FAD0-43B0-89DB-BA3AA88239B1}.Release|Any CPU.ActiveCfg = Release|Any CPU 21 | {D19814DB-FAD0-43B0-89DB-BA3AA88239B1}.Release|Any CPU.Build.0 = Release|Any CPU 22 | EndGlobalSection 23 | GlobalSection(SolutionProperties) = preSolution 24 | HideSolutionNode = FALSE 25 | EndGlobalSection 26 | EndGlobal 27 | -------------------------------------------------------------------------------- /UI Suppressed/App.xaml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /UI Suppressed/App.xaml.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2012 Modality Systems - All Rights Reserved 2 | * You may use, distribute and modify this code under the 3 | * terms of the Microsoft Public License, a copy of which 4 | * can be seen at: http://www.microsoft.com/en-us/openness/licenses.aspx 5 | * 6 | * http://www.LyncAutoAnswer.com 7 | */ 8 | 9 | using System; 10 | using System.Collections.Generic; 11 | using System.Configuration; 12 | using System.Data; 13 | using System.Windows; 14 | using System.Diagnostics; 15 | 16 | namespace SuperSimpleLyncKiosk 17 | { 18 | /// 19 | /// Interaction logic for App.xaml 20 | /// 21 | public partial class App : Application 22 | { 23 | protected override void OnStartup(StartupEventArgs e) 24 | { 25 | // Get Reference to the current Process 26 | Process me = Process.GetCurrentProcess(); 27 | // Check how many total processes have the same name as the current one 28 | if (Process.GetProcessesByName(me.ProcessName).Length > 1) 29 | { 30 | Application.Current.Shutdown(); 31 | return; 32 | } 33 | 34 | base.OnStartup(e); 35 | } 36 | 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /UI Suppressed/Converters/LyncPresenceColourConverter.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2012 Modality Systems - All Rights Reserved 2 | * You may use, distribute and modify this code under the 3 | * terms of the Microsoft Public License, a copy of which 4 | * can be seen at: http://www.microsoft.com/en-us/openness/licenses.aspx 5 | * 6 | * http://www.LyncAutoAnswer.com 7 | */ 8 | 9 | using System; 10 | using System.Collections.Generic; 11 | using System.Linq; 12 | using System.Text; 13 | using System.Windows.Data; 14 | using System.Windows.Media; 15 | 16 | namespace SuperSimpleLyncKiosk.Converters 17 | { 18 | class LyncPresenceColourConverter : IValueConverter 19 | { 20 | 21 | public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) 22 | { 23 | if (value == null) 24 | return Brushes.Gray; 25 | 26 | if (value is string) 27 | { 28 | switch ((string)value) 29 | { 30 | case "Free": 31 | return Brushes.ForestGreen; 32 | case "FreeIdle": 33 | return Brushes.Goldenrod; 34 | case "Busy": 35 | return Brushes.Firebrick; 36 | case "BusyIdle": 37 | return Brushes.Firebrick; 38 | case "DoNotDisturb": 39 | return Brushes.Maroon; 40 | case "TemporarilyAway": 41 | return Brushes.Goldenrod; 42 | case "Away": 43 | return Brushes.Goldenrod; 44 | case "Offline": 45 | return Brushes.Gray; 46 | default: 47 | return Brushes.Gray; 48 | } 49 | } 50 | throw new NotImplementedException(); 51 | } 52 | 53 | public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) 54 | { 55 | if (targetType == typeof(string)) 56 | { 57 | return (string)value; 58 | } 59 | throw new NotImplementedException(); 60 | } 61 | 62 | 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /UI Suppressed/Converters/LyncPresenceTextConverter.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2012 Modality Systems - All Rights Reserved 2 | * You may use, distribute and modify this code under the 3 | * terms of the Microsoft Public License, a copy of which 4 | * can be seen at: http://www.microsoft.com/en-us/openness/licenses.aspx 5 | * 6 | * http://www.LyncAutoAnswer.com 7 | */ 8 | 9 | using System; 10 | using System.Collections.Generic; 11 | using System.Linq; 12 | using System.Text; 13 | using System.Windows.Data; 14 | 15 | namespace SuperSimpleLyncKiosk.Converters 16 | { 17 | class LyncPresenceTextConverter : IValueConverter 18 | { 19 | public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) 20 | { 21 | if (value == null) 22 | return "Unknown"; 23 | 24 | if (value is string) 25 | { 26 | switch ((string)value) 27 | { 28 | case "Free": 29 | return "Available"; 30 | case "FreeIdle": 31 | return "Inactive"; 32 | case "Busy": 33 | return "Busy"; 34 | case "BusyIdle": 35 | return "Busy"; 36 | case "DoNotDisturb": 37 | return "Do Not Disturb"; 38 | case "TemporarilyAway": 39 | return "Be Right Back"; 40 | case "Away": 41 | return "Away"; 42 | case "Offline": 43 | return "Offline"; 44 | default: 45 | return "Unknown"; 46 | } 47 | } 48 | throw new NotImplementedException(); 49 | } 50 | 51 | public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) 52 | { 53 | if (targetType == typeof(string)) 54 | { 55 | return (string)value; 56 | } 57 | throw new NotImplementedException(); 58 | } 59 | 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /UI Suppressed/Extensions/ControlExtension.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2012 Modality Systems - All Rights Reserved 2 | * You may use, distribute and modify this code under the 3 | * terms of the Microsoft Public License, a copy of which 4 | * can be seen at: http://www.microsoft.com/en-us/openness/licenses.aspx 5 | * 6 | * http://www.LyncAutoAnswer.com 7 | */ 8 | 9 | using System; 10 | using System.Windows; 11 | 12 | namespace SuperSimpleLyncKiosk.Extensions 13 | { 14 | 15 | public class ControlExtensions 16 | { 17 | #region Dependency Properties 18 | 19 | public static readonly DependencyProperty CurrentVisualStateProperty = DependencyProperty.RegisterAttached("CurrentVisualState", typeof(String), typeof(ControlExtensions), new PropertyMetadata(OnCurrentVisualStatePropertyChanged)); 20 | 21 | #endregion 22 | 23 | #region Public Methods 24 | 25 | public static string GetCurrentVisualState(DependencyObject obj) 26 | { 27 | return (string)obj.GetValue(CurrentVisualStateProperty); 28 | } 29 | 30 | public static void SetCurrentVisualState(DependencyObject obj, string value) 31 | { 32 | obj.SetValue(CurrentVisualStateProperty, value); 33 | } 34 | 35 | #endregion 36 | 37 | #region Event Handlers 38 | 39 | private static void OnCurrentVisualStatePropertyChanged(object sender, DependencyPropertyChangedEventArgs args) 40 | { 41 | var newState = (string)args.NewValue; 42 | if (string.IsNullOrWhiteSpace(newState)) return; // Ignore null or empty state settings 43 | 44 | FrameworkElement element = sender as FrameworkElement; 45 | if (element == null) throw new ArgumentException("CurrentVisualState is only supported on the FrameworkElement type"); 46 | 47 | if (!VisualStateManager.GoToState(element, newState, true)) 48 | if (!VisualStateManager.GoToElementState(element, newState, true)) 49 | throw new ArgumentException(string.Format("The state '{0}' could not be found on the element '{1}'", newState, element)); 50 | } 51 | 52 | #endregion 53 | } 54 | } 55 | 56 | -------------------------------------------------------------------------------- /UI Suppressed/Images/contact.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shanselman/LyncAutoAnswer/6c9ac2ba54e3bba0518c0946c47e9eeb62d02bf9/UI Suppressed/Images/contact.png -------------------------------------------------------------------------------- /UI Suppressed/Images/hangup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shanselman/LyncAutoAnswer/6c9ac2ba54e3bba0518c0946c47e9eeb62d02bf9/UI Suppressed/Images/hangup.png -------------------------------------------------------------------------------- /UI Suppressed/Images/phone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shanselman/LyncAutoAnswer/6c9ac2ba54e3bba0518c0946c47e9eeb62d02bf9/UI Suppressed/Images/phone.png -------------------------------------------------------------------------------- /UI Suppressed/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Resources; 3 | using System.Runtime.CompilerServices; 4 | using System.Runtime.InteropServices; 5 | using System.Windows; 6 | 7 | // General Information about an assembly is controlled through the following 8 | // set of attributes. Change these attribute values to modify the information 9 | // associated with an assembly. 10 | [assembly: AssemblyTitle("SuperSimpleLyncKiosk-UISuppressed")] 11 | [assembly: AssemblyDescription("")] 12 | [assembly: AssemblyConfiguration("")] 13 | [assembly: AssemblyCompany("")] 14 | [assembly: AssemblyProduct("SuperSimpleLyncKioskUISuppressed")] 15 | [assembly: AssemblyCopyright("Copyright © 2012 Modality Systems")] 16 | [assembly: AssemblyTrademark("")] 17 | [assembly: AssemblyCulture("")] 18 | 19 | // Setting ComVisible to false makes the types in this assembly not visible 20 | // to COM components. If you need to access a type in this assembly from 21 | // COM, set the ComVisible attribute to true on that type. 22 | [assembly: ComVisible(false)] 23 | 24 | //In order to begin building localizable applications, set 25 | //CultureYouAreCodingWith in your .csproj file 26 | //inside a . For example, if you are using US english 27 | //in your source files, set the to en-US. Then uncomment 28 | //the NeutralResourceLanguage attribute below. Update the "en-US" in 29 | //the line below to match the UICulture setting in the project file. 30 | 31 | //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] 32 | 33 | 34 | [assembly: ThemeInfo( 35 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located 36 | //(used if a resource is not found in the page, 37 | // or application resource dictionaries) 38 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located 39 | //(used if a resource is not found in the page, 40 | // app, or any theme specific resource dictionaries) 41 | )] 42 | 43 | 44 | // Version information for an assembly consists of the following four values: 45 | // 46 | // Major Version 47 | // Minor Version 48 | // Build Number 49 | // Revision 50 | // 51 | // You can specify all the values or you can default the Build and Revision Numbers 52 | // by using the '*' as shown below: 53 | // [assembly: AssemblyVersion("1.0.*")] 54 | [assembly: AssemblyVersion("1.0.0.0")] 55 | [assembly: AssemblyFileVersion("1.0.0.0")] 56 | -------------------------------------------------------------------------------- /UI Suppressed/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.17626 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace SuperSimpleLyncKiosk.Properties { 12 | using System; 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources { 26 | 27 | private static global::System.Resources.ResourceManager resourceMan; 28 | 29 | private static global::System.Globalization.CultureInfo resourceCulture; 30 | 31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 32 | internal Resources() { 33 | } 34 | 35 | /// 36 | /// Returns the cached ResourceManager instance used by this class. 37 | /// 38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 39 | internal static global::System.Resources.ResourceManager ResourceManager { 40 | get { 41 | if (object.ReferenceEquals(resourceMan, null)) { 42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("SuperSimpleLyncKiosk.Properties.Resources", typeof(Resources).Assembly); 43 | resourceMan = temp; 44 | } 45 | return resourceMan; 46 | } 47 | } 48 | 49 | /// 50 | /// Overrides the current thread's CurrentUICulture property for all 51 | /// resource lookups using this strongly typed resource class. 52 | /// 53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 54 | internal static global::System.Globalization.CultureInfo Culture { 55 | get { 56 | return resourceCulture; 57 | } 58 | set { 59 | resourceCulture = value; 60 | } 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /UI Suppressed/Properties/Resources.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | text/microsoft-resx 107 | 108 | 109 | 2.0 110 | 111 | 112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 113 | 114 | 115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | -------------------------------------------------------------------------------- /UI Suppressed/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.269 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace SuperSimpleLyncKiosk.Properties { 12 | 13 | 14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")] 16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { 17 | 18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 19 | 20 | public static Settings Default { 21 | get { 22 | return defaultInstance; 23 | } 24 | } 25 | 26 | [global::System.Configuration.UserScopedSettingAttribute()] 27 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 28 | [global::System.Configuration.DefaultSettingValueAttribute("True")] 29 | public bool autoAnswer { 30 | get { 31 | return ((bool)(this["autoAnswer"])); 32 | } 33 | set { 34 | this["autoAnswer"] = value; 35 | } 36 | } 37 | 38 | [global::System.Configuration.UserScopedSettingAttribute()] 39 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 40 | [global::System.Configuration.DefaultSettingValueAttribute("sip:scottha@microsoft.com")] 41 | public string sipEmailAddress { 42 | get { 43 | return ((string)(this["sipEmailAddress"])); 44 | } 45 | set { 46 | this["sipEmailAddress"] = value; 47 | } 48 | } 49 | 50 | [global::System.Configuration.UserScopedSettingAttribute()] 51 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 52 | [global::System.Configuration.DefaultSettingValueAttribute("domain\\user")] 53 | public string LyncAccountDomainUser { 54 | get { 55 | return ((string)(this["LyncAccountDomainUser"])); 56 | } 57 | set { 58 | this["LyncAccountDomainUser"] = value; 59 | } 60 | } 61 | 62 | [global::System.Configuration.UserScopedSettingAttribute()] 63 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 64 | [global::System.Configuration.DefaultSettingValueAttribute("user@domain.com")] 65 | public string LyncAccountEmail { 66 | get { 67 | return ((string)(this["LyncAccountEmail"])); 68 | } 69 | set { 70 | this["LyncAccountEmail"] = value; 71 | } 72 | } 73 | 74 | [global::System.Configuration.UserScopedSettingAttribute()] 75 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 76 | [global::System.Configuration.DefaultSettingValueAttribute("P@ssword")] 77 | public string LyncAccountPassword { 78 | get { 79 | return ((string)(this["LyncAccountPassword"])); 80 | } 81 | set { 82 | this["LyncAccountPassword"] = value; 83 | } 84 | } 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /UI Suppressed/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | True 7 | 8 | 9 | sip:scottha@microsoft.com 10 | 11 | 12 | domain\user 13 | 14 | 15 | user@domain.com 16 | 17 | 18 | P@ssword 19 | 20 | 21 | -------------------------------------------------------------------------------- /UI Suppressed/ReadMe-UI.txt: -------------------------------------------------------------------------------- 1 | Lync 2012 Super Simple Auto Answer Video Kiosk with Full Screen 2 | 3 | UI Suppression Edition 4 | --------------------------------------------------------------- 5 | 6 | What it does 7 | ------------ 8 | Monitors the presence of a user (not the signed in user). Auto-answers and full-screens incoming video calls made to the signed-in user. 9 | 10 | How to use it 11 | ------------- 12 | 1. Lync 2010 should be installed, but not running. 13 | 2. UISupressionMode should be ON (more information at LyncAutoAnswer.com) 14 | 3. Edit the app.config file: 15 | - change the value of sipEmailAddress to be the address you wish to monitor presence for. 16 | - change the LyncAccountDomainUser, LyncAccountEmail, LyncAccountPassword values to reflect the user you wish to sign in as. 17 | 18 | ** This is a sample project. You should follow security best practice if you wish to use this in production. Storing user authentication information ** 19 | ** in plaintext is a security risk. Fork the project and implement your own security requirements. ** 20 | 21 | More Information 22 | ---------------- 23 | The project repository: https://github.com/shanselman/LyncAutoAnswer 24 | The project page: http://LyncAutoAnswer.com (full description, blog post references, author information etc.) -------------------------------------------------------------------------------- /UI Suppressed/SuperSimpleLyncKiosk - UI Suppressed.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Debug 5 | AnyCPU 6 | 8.0.30703 7 | 2.0 8 | {D19814DB-FAD0-43B0-89DB-BA3AA88239B1} 9 | WinExe 10 | Properties 11 | SuperSimpleLyncKiosk 12 | SuperSimpleLyncKioskUISuppressed 13 | v4.0 14 | Client 15 | 512 16 | {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 17 | 4 18 | false 19 | publish\ 20 | true 21 | Disk 22 | false 23 | Foreground 24 | 7 25 | Days 26 | false 27 | false 28 | true 29 | 1 30 | 1.0.0.%2a 31 | false 32 | true 33 | true 34 | 35 | 36 | true 37 | full 38 | false 39 | bin\Debug\ 40 | DEBUG;TRACE 41 | prompt 42 | 4 43 | 44 | x86 45 | 46 | 47 | pdbonly 48 | true 49 | bin\Release\ 50 | TRACE 51 | prompt 52 | 4 53 | 54 | x86 55 | 56 | 57 | 58 | 59 | 60 | 61 | SuperSimpleLyncKiosk.ico 62 | 63 | 64 | 99A0964FA3812F7724C35C5079B46A95CAC06E02 65 | 66 | 67 | SuperSimpleLyncKiosk - UI Suppressed_TemporaryKey.pfx 68 | 69 | 70 | false 71 | 72 | 73 | false 74 | 75 | 76 | LocalIntranet 77 | 78 | 79 | 80 | 81 | lib\LyncUISupressionWrapper.dll 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 4.0 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | MSBuild:Compile 104 | Designer 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | Call.xaml 116 | 117 | 118 | MainView.xaml 119 | 120 | 121 | NoCall.xaml 122 | 123 | 124 | SignInFailed.xaml 125 | 126 | 127 | SigningIn.xaml 128 | 129 | 130 | App.xaml 131 | Code 132 | 133 | 134 | Designer 135 | MSBuild:Compile 136 | 137 | 138 | Designer 139 | MSBuild:Compile 140 | 141 | 142 | MSBuild:Compile 143 | Designer 144 | 145 | 146 | MSBuild:Compile 147 | Designer 148 | 149 | 150 | MSBuild:Compile 151 | Designer 152 | 153 | 154 | 155 | 156 | Code 157 | 158 | 159 | True 160 | True 161 | Resources.resx 162 | 163 | 164 | True 165 | Settings.settings 166 | True 167 | 168 | 169 | ResXFileCodeGenerator 170 | Resources.Designer.cs 171 | 172 | 173 | Designer 174 | 175 | 176 | SettingsSingleFileGenerator 177 | Settings.Designer.cs 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | False 187 | Microsoft .NET Framework 4 Client Profile %28x86 and x64%29 188 | true 189 | 190 | 191 | False 192 | .NET Framework 3.5 SP1 Client Profile 193 | false 194 | 195 | 196 | False 197 | .NET Framework 3.5 SP1 198 | false 199 | 200 | 201 | False 202 | Windows Installer 3.1 203 | true 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 223 | -------------------------------------------------------------------------------- /UI Suppressed/SuperSimpleLyncKiosk - UI Suppressed.csproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | publish\|C:\Users\tom.morgan\Desktop\UISuppressed\ 5 | 6 | 7 | 8 | 9 | 10 | en-US 11 | false 12 | 13 | -------------------------------------------------------------------------------- /UI Suppressed/SuperSimpleLyncKiosk.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shanselman/LyncAutoAnswer/6c9ac2ba54e3bba0518c0946c47e9eeb62d02bf9/UI Suppressed/SuperSimpleLyncKiosk.ico -------------------------------------------------------------------------------- /UI Suppressed/ViewModels/Command.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2012 Modality Systems - All Rights Reserved 2 | * You may use, distribute and modify this code under the 3 | * terms of the Microsoft Public License, a copy of which 4 | * can be seen at: http://www.microsoft.com/en-us/openness/licenses.aspx 5 | * 6 | * http://www.LyncAutoAnswer.com 7 | */ 8 | 9 | using System; 10 | using System.Windows.Input; 11 | 12 | namespace SuperSimpleLyncKiosk.ViewModels 13 | { 14 | public class Command : ICommand 15 | { 16 | #region Fields 17 | 18 | private EventHandler _canExecuteChanged; 19 | 20 | #endregion 21 | 22 | #region Properties 23 | 24 | public Func CanExecute { get; set; } 25 | 26 | public Action Execute { get; set; } 27 | 28 | #endregion 29 | 30 | #region Constructors 31 | 32 | public Command() 33 | { 34 | } 35 | 36 | public Command(Action execute) 37 | : this(execute, null) 38 | { 39 | } 40 | 41 | public Command(Action execute, Func canExecute) 42 | { 43 | Execute = execute; 44 | CanExecute = canExecute; 45 | } 46 | 47 | #endregion 48 | 49 | #region Methods 50 | 51 | public void NotifyCanExecuteChanged() 52 | { 53 | if (_canExecuteChanged != null) 54 | _canExecuteChanged(this, new EventArgs()); 55 | } 56 | 57 | #endregion 58 | 59 | #region ICommand Members 60 | 61 | bool ICommand.CanExecute(object parameter) 62 | { 63 | return CanExecute == null || CanExecute(parameter); 64 | } 65 | 66 | event EventHandler ICommand.CanExecuteChanged 67 | { 68 | add { _canExecuteChanged += value; } 69 | remove { _canExecuteChanged -= value; } 70 | } 71 | 72 | void ICommand.Execute(object parameter) 73 | { 74 | if (Execute != null && (CanExecute == null || CanExecute(parameter))) 75 | { 76 | Execute(parameter); 77 | } 78 | } 79 | 80 | #endregion 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /UI Suppressed/ViewModels/IncomingCallViewModel.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2012 Modality Systems - All Rights Reserved 2 | * You may use, distribute and modify this code under the 3 | * terms of the Microsoft Public License, a copy of which 4 | * can be seen at: http://www.microsoft.com/en-us/openness/licenses.aspx 5 | * 6 | * http://www.LyncAutoAnswer.com 7 | */ 8 | 9 | using System.Windows.Input; 10 | using Microsoft.Lync.Model; 11 | using Microsoft.Lync.Model.Conversation; 12 | 13 | namespace SuperSimpleLyncKiosk.ViewModels 14 | { 15 | public class IncomingCallViewModel 16 | { 17 | private Command _endCallCommand; 18 | private LyncClient _lync; 19 | private Conversation _conversation; 20 | 21 | public IncomingCallViewModel() 22 | { 23 | _lync = LyncClient.GetClient(); 24 | _lync.ConversationManager.ConversationAdded += ConversationManager_ConversationAdded; 25 | } 26 | 27 | void ConversationManager_ConversationAdded(object sender, Microsoft.Lync.Model.Conversation.ConversationManagerEventArgs e) 28 | { 29 | _conversation = e.Conversation; 30 | } 31 | 32 | public ICommand EndCallCommand 33 | { 34 | get 35 | { 36 | if (this._endCallCommand == null) 37 | this._endCallCommand = new Command { Execute = ExecuteEndCall }; 38 | return this._endCallCommand; 39 | } 40 | } 41 | 42 | private void ExecuteEndCall(object param) 43 | { 44 | if (_conversation == null) 45 | return; 46 | 47 | _conversation.End(); 48 | 49 | } 50 | 51 | 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /UI Suppressed/ViewModels/MainViewModel.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2012 Modality Systems - All Rights Reserved 2 | * You may use, distribute and modify this code under the 3 | * terms of the Microsoft Public License, a copy of which 4 | * can be seen at: http://www.microsoft.com/en-us/openness/licenses.aspx 5 | * 6 | * http://www.LyncAutoAnswer.com 7 | */ 8 | 9 | using System; 10 | using LyncUISupressionWrapper; 11 | 12 | namespace SuperSimpleLyncKiosk.ViewModels 13 | { 14 | class MainViewModel : ViewModelBase 15 | { 16 | LyncUISupressionWrapper.ILyncModel _model = null; 17 | 18 | private string _currentVisualState; 19 | 20 | public string CurrentVisualState 21 | { 22 | get { return _currentVisualState; } 23 | private set 24 | { 25 | _currentVisualState = value; 26 | NotifyPropertyChanged("CurrentVisualState"); 27 | } 28 | } 29 | 30 | public MainViewModel() 31 | { 32 | _model = LyncModel.Instance; 33 | _model.StateChanged += new EventHandler(_model_StateChanged); 34 | 35 | _model.SignIn(Properties.Settings.Default.LyncAccountEmail, Properties.Settings.Default.LyncAccountDomainUser, Properties.Settings.Default.LyncAccountPassword); 36 | } 37 | 38 | public void ShutDownLync() 39 | { 40 | _model.Shutdown(); 41 | } 42 | 43 | private void _model_StateChanged(object sender, EventArgs e) 44 | { 45 | CurrentVisualState = _model.State.ToString(); 46 | } 47 | 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /UI Suppressed/ViewModels/NoCallViewModel.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2012 Modality Systems - All Rights Reserved 2 | * You may use, distribute and modify this code under the 3 | * terms of the Microsoft Public License, a copy of which 4 | * can be seen at: http://www.microsoft.com/en-us/openness/licenses.aspx 5 | * 6 | * http://www.LyncAutoAnswer.com 7 | */ 8 | 9 | using Microsoft.Lync.Model; 10 | using System.Collections.Generic; 11 | using System.Windows.Input; 12 | using System.Windows.Media.Imaging; 13 | 14 | namespace SuperSimpleLyncKiosk.ViewModels 15 | { 16 | class NoCallViewModel : ViewModelBase 17 | { 18 | #region Fields 19 | 20 | 21 | private bool subscribingToInformationUpdates = false; 22 | private string SipUriOfRealPerson = Properties.Settings.Default.sipEmailAddress; 23 | private LyncUISupressionWrapper.ILyncModel model; 24 | private Command _placeCallCommand; 25 | 26 | #endregion 27 | 28 | #region Properties 29 | 30 | private string _presence; 31 | public string Presence 32 | { 33 | get 34 | { 35 | return _presence; 36 | } 37 | set 38 | { 39 | _presence = value; 40 | NotifyPropertyChanged("Presence"); 41 | } 42 | } 43 | 44 | private string _displayName; 45 | public string DisplayName 46 | { 47 | get 48 | { 49 | return _displayName; 50 | } 51 | set 52 | { 53 | _displayName = value; 54 | NotifyPropertyChanged("DisplayName"); 55 | } 56 | } 57 | 58 | private string _activity; 59 | public string Activity 60 | { 61 | get 62 | { 63 | return _activity; 64 | } 65 | set 66 | { 67 | _activity = value; 68 | NotifyPropertyChanged("Activity"); 69 | } 70 | } 71 | 72 | 73 | private BitmapImage _photo; 74 | public BitmapImage Photo 75 | { 76 | get 77 | { 78 | return _photo; 79 | } 80 | set 81 | { 82 | _photo = value; 83 | NotifyPropertyChanged("Photo"); 84 | } 85 | } 86 | 87 | #endregion 88 | 89 | #region Commands 90 | 91 | public ICommand PlaceCallCommand 92 | { 93 | get 94 | { 95 | if (this._placeCallCommand == null) 96 | this._placeCallCommand = new Command { Execute = ExecutePlaceCall }; 97 | return this._placeCallCommand; 98 | } 99 | } 100 | 101 | #endregion 102 | 103 | #region Constructor 104 | 105 | public NoCallViewModel() 106 | { 107 | model = LyncUISupressionWrapper.LyncModel.Instance; 108 | model.StateChanged += model_StateChanged; 109 | model.PresenceChanged += model_PresenceChanged; 110 | model.ActivityChanged += model_ActivityChanged; 111 | model.DisplayNameChanged += model_DisplayNameChanged; 112 | model.PhotoChanged += model_PhotoChanged; 113 | 114 | } 115 | 116 | void model_PhotoChanged(object sender, LyncUISupressionWrapper.PhotoChangedEventArgs e) 117 | { 118 | Photo = e.Photo; 119 | } 120 | 121 | void model_DisplayNameChanged(object sender, LyncUISupressionWrapper.StringValueInformationEventArgs e) 122 | { 123 | DisplayName = e.Value; 124 | } 125 | 126 | void model_ActivityChanged(object sender, LyncUISupressionWrapper.StringValueInformationEventArgs e) 127 | { 128 | Activity = e.Value; 129 | } 130 | 131 | #endregion 132 | 133 | void ExecutePlaceCall(object param) 134 | { 135 | model.StartCall(SipUriOfRealPerson); 136 | } 137 | 138 | void model_PresenceChanged(object sender, LyncUISupressionWrapper.PresenceInformationEventArgs e) 139 | { 140 | Presence = e.Presence.ToString(); 141 | } 142 | 143 | void model_StateChanged(object sender, LyncUISupressionWrapper.StateChangedEventArgs e) 144 | { 145 | if (e.State == LyncUISupressionWrapper.ApplicationState.NoCall && !subscribingToInformationUpdates) 146 | { 147 | model.SubscribeForInformationUpdates(SipUriOfRealPerson); 148 | subscribingToInformationUpdates = true; 149 | 150 | 151 | } 152 | } 153 | 154 | 155 | 156 | 157 | } 158 | } 159 | -------------------------------------------------------------------------------- /UI Suppressed/ViewModels/ViewModelBase.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2012 Modality Systems - All Rights Reserved 2 | * You may use, distribute and modify this code under the 3 | * terms of the Microsoft Public License, a copy of which 4 | * can be seen at: http://www.microsoft.com/en-us/openness/licenses.aspx 5 | * 6 | * http://www.LyncAutoAnswer.com 7 | */ 8 | 9 | using System.ComponentModel; 10 | 11 | namespace SuperSimpleLyncKiosk.ViewModels 12 | { 13 | public abstract class ViewModelBase : INotifyPropertyChanged 14 | { 15 | public event PropertyChangedEventHandler PropertyChanged; 16 | private void OnPropertyChanged(string propertyName) 17 | { 18 | var handler = PropertyChanged; 19 | if (handler != null) 20 | { 21 | handler(this, new PropertyChangedEventArgs(propertyName)); 22 | } 23 | } 24 | 25 | protected void NotifyPropertyChanged(string propertyName) 26 | { 27 | OnPropertyChanged(propertyName); 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /UI Suppressed/Views/Call.xaml: -------------------------------------------------------------------------------- 1 |  10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 37 | 38 | 39 | 40 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /UI Suppressed/Views/Call.xaml.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2012 Modality Systems - All Rights Reserved 2 | * You may use, distribute and modify this code under the 3 | * terms of the Microsoft Public License, a copy of which 4 | * can be seen at: http://www.microsoft.com/en-us/openness/licenses.aspx 5 | * 6 | * http://www.LyncAutoAnswer.com 7 | */ 8 | 9 | using System.Windows.Controls; 10 | using SuperSimpleLyncKiosk.ViewModels; 11 | 12 | namespace SuperSimpleLyncKiosk 13 | { 14 | /// 15 | /// Interaction logic for Call.xaml 16 | /// 17 | public partial class Call : UserControl 18 | { 19 | public Call() 20 | { 21 | InitializeComponent(); 22 | DataContext = new IncomingCallViewModel(); 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /UI Suppressed/Views/MainView.xaml: -------------------------------------------------------------------------------- 1 |  7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | -------------------------------------------------------------------------------- /UI Suppressed/Views/MainView.xaml.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2012 Modality Systems - All Rights Reserved 2 | * You may use, distribute and modify this code under the 3 | * terms of the Microsoft Public License, a copy of which 4 | * can be seen at: http://www.microsoft.com/en-us/openness/licenses.aspx 5 | * 6 | * http://www.LyncAutoAnswer.com 7 | */ 8 | 9 | using System; 10 | using System.Collections.Generic; 11 | using System.Linq; 12 | using System.Text; 13 | using System.Windows; 14 | using System.Windows.Controls; 15 | using System.Windows.Data; 16 | using System.Windows.Documents; 17 | using System.Windows.Input; 18 | using System.Windows.Media; 19 | using System.Windows.Media.Imaging; 20 | using System.Windows.Shapes; 21 | using SuperSimpleLyncKiosk.ViewModels; 22 | 23 | namespace SuperSimpleLyncKiosk.Views 24 | { 25 | /// 26 | /// Interaction logic for MainView.xaml 27 | /// 28 | public partial class MainView : Window 29 | { 30 | public MainView() 31 | { 32 | InitializeComponent(); 33 | 34 | ResizeMode = ResizeMode.CanResize; 35 | WindowState = WindowState.Maximized; 36 | } 37 | 38 | private void Window_Loaded(object sender, RoutedEventArgs e) 39 | { 40 | try 41 | { 42 | DataContext = new MainViewModel(); 43 | } 44 | catch (ApplicationException ex) 45 | { 46 | MessageBox.Show(ex.ToString(), "FATAL ERROR"); 47 | Application.Current.Shutdown(1); 48 | } 49 | } 50 | 51 | private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e) 52 | { 53 | var vm = DataContext as MainViewModel; 54 | vm.ShutDownLync(); 55 | 56 | } 57 | } 58 | } 59 | 60 | 61 | -------------------------------------------------------------------------------- /UI Suppressed/Views/NoCall.xaml: -------------------------------------------------------------------------------- 1 |  9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 103 | 104 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | -------------------------------------------------------------------------------- /UI Suppressed/Views/NoCall.xaml.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2012 Modality Systems - All Rights Reserved 2 | * You may use, distribute and modify this code under the 3 | * terms of the Microsoft Public License, a copy of which 4 | * can be seen at: http://www.microsoft.com/en-us/openness/licenses.aspx 5 | * 6 | * http://www.LyncAutoAnswer.com 7 | */ 8 | 9 | using System.Windows.Controls; 10 | using SuperSimpleLyncKiosk.ViewModels; 11 | 12 | namespace SuperSimpleLyncKiosk 13 | { 14 | public partial class NoCall : UserControl 15 | { 16 | public NoCall() 17 | { 18 | InitializeComponent(); 19 | DataContext = new NoCallViewModel(); 20 | } 21 | 22 | private void Grid_MouseLeave(object sender, System.Windows.Input.MouseEventArgs e) 23 | { 24 | 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /UI Suppressed/Views/SignInFailed.xaml: -------------------------------------------------------------------------------- 1 |  8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /UI Suppressed/Views/SignInFailed.xaml.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2012 Modality Systems - All Rights Reserved 2 | * You may use, distribute and modify this code under the 3 | * terms of the Microsoft Public License, a copy of which 4 | * can be seen at: http://www.microsoft.com/en-us/openness/licenses.aspx 5 | * 6 | * http://www.LyncAutoAnswer.com 7 | */ 8 | 9 | using System.Windows.Controls; 10 | 11 | namespace SuperSimpleLyncKiosk 12 | { 13 | public partial class SignInFailed : UserControl 14 | { 15 | public SignInFailed() 16 | { 17 | InitializeComponent(); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /UI Suppressed/Views/SigningIn.xaml: -------------------------------------------------------------------------------- 1 |  8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /UI Suppressed/Views/SigningIn.xaml.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2012 Modality Systems - All Rights Reserved 2 | * You may use, distribute and modify this code under the 3 | * terms of the Microsoft Public License, a copy of which 4 | * can be seen at: http://www.microsoft.com/en-us/openness/licenses.aspx 5 | * 6 | * http://www.LyncAutoAnswer.com 7 | */ 8 | 9 | using System.Windows.Controls; 10 | 11 | namespace SuperSimpleLyncKiosk 12 | { 13 | public partial class SigningIn : UserControl 14 | { 15 | public SigningIn() 16 | { 17 | InitializeComponent(); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /UI Suppressed/app.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 |
6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | sip:scottha@microsoft.com 14 | 15 | 16 | domain\user 17 | 18 | 19 | user@domain.com 20 | 21 | 22 | P@ssword 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /UI Suppressed/lib/LyncUISupressionWrapper.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shanselman/LyncAutoAnswer/6c9ac2ba54e3bba0518c0946c47e9eeb62d02bf9/UI Suppressed/lib/LyncUISupressionWrapper.dll --------------------------------------------------------------------------------