Skip to content

Commit 34bbee9

Browse files
committed
SeriousBusinessCats
making serious business
1 parent c0cd3fd commit 34bbee9

38 files changed

+9327
-2
lines changed

App.xaml

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<Application x:Class="BusinessCats.App"
2+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4+
StartupUri="MainWindow.xaml">
5+
<Application.Resources>
6+
<ResourceDictionary>
7+
<ResourceDictionary.MergedDictionaries>
8+
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.xaml" />
9+
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Fonts.xaml" />
10+
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Colors.xaml" />
11+
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/Blue.xaml" />
12+
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/BaseLight.xaml" />
13+
<ResourceDictionary Source="/Resources/Icons.xaml" />
14+
</ResourceDictionary.MergedDictionaries>
15+
</ResourceDictionary>
16+
</Application.Resources>
17+
</Application>

App.xaml.cs

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Configuration;
4+
using System.Data;
5+
using System.Linq;
6+
using System.Windows;
7+
8+
using MahApps.Metro;
9+
10+
namespace BusinessCats
11+
{
12+
/// <summary>
13+
/// Interaction logic for App.xaml
14+
/// </summary>
15+
public partial class App : Application
16+
{
17+
protected override void OnStartup(StartupEventArgs e)
18+
{
19+
var themeName = BusinessCats.Properties.Settings.Default.ThemeName;
20+
21+
var appTheme = ThemeManager.GetAppTheme(themeName);
22+
if (appTheme != null)
23+
{
24+
ThemeManager.ChangeAppStyle(Application.Current,
25+
ThemeManager.GetAccent("Blue"),
26+
appTheme);
27+
}
28+
29+
base.OnStartup(e);
30+
}
31+
}
32+
}

BusinessCats.csproj

+196
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,196 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
5+
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
6+
<ProductVersion>8.0.30703</ProductVersion>
7+
<SchemaVersion>2.0</SchemaVersion>
8+
<ProjectGuid>{A43EF9D1-58EC-4361-8BF2-D6122F36A956}</ProjectGuid>
9+
<OutputType>WinExe</OutputType>
10+
<AppDesignerFolder>Properties</AppDesignerFolder>
11+
<RootNamespace>BusinessCats</RootNamespace>
12+
<AssemblyName>BusinessCats</AssemblyName>
13+
<TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
14+
<TargetFrameworkProfile>
15+
</TargetFrameworkProfile>
16+
<FileAlignment>512</FileAlignment>
17+
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
18+
<WarningLevel>4</WarningLevel>
19+
<PublishUrl>publish\</PublishUrl>
20+
<Install>true</Install>
21+
<InstallFrom>Disk</InstallFrom>
22+
<UpdateEnabled>false</UpdateEnabled>
23+
<UpdateMode>Foreground</UpdateMode>
24+
<UpdateInterval>7</UpdateInterval>
25+
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
26+
<UpdatePeriodically>false</UpdatePeriodically>
27+
<UpdateRequired>false</UpdateRequired>
28+
<MapFileExtensions>true</MapFileExtensions>
29+
<ApplicationRevision>0</ApplicationRevision>
30+
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
31+
<IsWebBootstrapper>false</IsWebBootstrapper>
32+
<UseApplicationTrust>false</UseApplicationTrust>
33+
<BootstrapperEnabled>true</BootstrapperEnabled>
34+
</PropertyGroup>
35+
<PropertyGroup>
36+
<ApplicationIcon>Resources\BusinessCats.ico</ApplicationIcon>
37+
</PropertyGroup>
38+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
39+
<DebugSymbols>true</DebugSymbols>
40+
<OutputPath>bin\Debug\</OutputPath>
41+
<DefineConstants>DEBUG;TRACE</DefineConstants>
42+
<DebugType>full</DebugType>
43+
<PlatformTarget>AnyCPU</PlatformTarget>
44+
<ErrorReport>prompt</ErrorReport>
45+
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
46+
</PropertyGroup>
47+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
48+
<OutputPath>bin\Release\</OutputPath>
49+
<DefineConstants>TRACE</DefineConstants>
50+
<Optimize>true</Optimize>
51+
<DebugType>pdbonly</DebugType>
52+
<PlatformTarget>AnyCPU</PlatformTarget>
53+
<ErrorReport>prompt</ErrorReport>
54+
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
55+
</PropertyGroup>
56+
<ItemGroup>
57+
<Reference Include="MahApps.Metro, Version=1.2.4.0, Culture=neutral, PublicKeyToken=f4fb5a3c4d1e5b4f, processorArchitecture=MSIL">
58+
<HintPath>packages\MahApps.Metro.1.2.4.0\lib\net45\MahApps.Metro.dll</HintPath>
59+
<Private>True</Private>
60+
</Reference>
61+
<Reference Include="Microsoft.Lync.Model">
62+
<HintPath>..\..\..\..\..\..\..\..\Target\x64\debug\lync\x-none\desktop\Microsoft.Lync.Model.dll</HintPath>
63+
</Reference>
64+
<Reference Include="System" />
65+
<Reference Include="System.configuration" />
66+
<Reference Include="System.Data" />
67+
<Reference Include="System.Drawing" />
68+
<Reference Include="System.Web" />
69+
<Reference Include="System.Windows.Forms" />
70+
<Reference Include="System.Windows.Interactivity, Version=4.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
71+
<HintPath>packages\MahApps.Metro.1.2.4.0\lib\net45\System.Windows.Interactivity.dll</HintPath>
72+
<Private>True</Private>
73+
</Reference>
74+
<Reference Include="System.Xml" />
75+
<Reference Include="Microsoft.CSharp" />
76+
<Reference Include="System.Core" />
77+
<Reference Include="System.Xml.Linq" />
78+
<Reference Include="System.Data.DataSetExtensions" />
79+
<Reference Include="System.Xaml">
80+
<RequiredTargetFramework>4.0</RequiredTargetFramework>
81+
</Reference>
82+
<Reference Include="WindowsBase" />
83+
<Reference Include="PresentationCore" />
84+
<Reference Include="PresentationFramework" />
85+
<Reference Include="WindowsFormsIntegration" />
86+
</ItemGroup>
87+
<ItemGroup>
88+
<ApplicationDefinition Include="App.xaml">
89+
<Generator>MSBuild:Compile</Generator>
90+
<SubType>Designer</SubType>
91+
</ApplicationDefinition>
92+
<Compile Include="Util\Ascii64.cs" />
93+
<Compile Include="Util\Ascii85.cs" />
94+
<Compile Include="Util\CommandCat.cs" />
95+
<Compile Include="Util\FlashWindow.cs" />
96+
<Compile Include="Util\GrayscaleQuantizer.cs" />
97+
<Compile Include="LyncConversation.cs" />
98+
<Compile Include="LyncParticipant.cs" />
99+
<Compile Include="Util\PaletteQuantizer.cs" />
100+
<Compile Include="Util\Quantizer.cs" />
101+
<Compile Include="Util\RollTheDice.cs" />
102+
<Compile Include="SeriousBusinessCat.cs" />
103+
<Compile Include="SnippingCat.cs">
104+
<SubType>Form</SubType>
105+
</Compile>
106+
<Compile Include="Util\Util.cs" />
107+
<Compile Include="WellKnownCats.cs" />
108+
<Compile Include="WhisperCat.cs" />
109+
<Compile Include="WhisperWindow.xaml.cs">
110+
<DependentUpon>WhisperWindow.xaml</DependentUpon>
111+
</Compile>
112+
<Page Include="MainWindow.xaml">
113+
<Generator>MSBuild:Compile</Generator>
114+
<SubType>Designer</SubType>
115+
</Page>
116+
<Compile Include="App.xaml.cs">
117+
<DependentUpon>App.xaml</DependentUpon>
118+
<SubType>Code</SubType>
119+
</Compile>
120+
<Compile Include="MainWindow.xaml.cs">
121+
<DependentUpon>MainWindow.xaml</DependentUpon>
122+
<SubType>Code</SubType>
123+
</Compile>
124+
<Page Include="Resources\Icons.xaml">
125+
<Generator>MSBuild:Compile</Generator>
126+
<SubType>Designer</SubType>
127+
</Page>
128+
<Page Include="WhisperWindow.xaml">
129+
<SubType>Designer</SubType>
130+
<Generator>MSBuild:Compile</Generator>
131+
</Page>
132+
</ItemGroup>
133+
<ItemGroup>
134+
<Compile Include="Util\OctreeQuantizer.cs" />
135+
<Compile Include="Properties\AssemblyInfo.cs">
136+
<SubType>Code</SubType>
137+
</Compile>
138+
<Compile Include="Properties\Resources.Designer.cs">
139+
<AutoGen>True</AutoGen>
140+
<DesignTime>True</DesignTime>
141+
<DependentUpon>Resources.resx</DependentUpon>
142+
</Compile>
143+
<Compile Include="Properties\Settings.Designer.cs">
144+
<AutoGen>True</AutoGen>
145+
<DependentUpon>Settings.settings</DependentUpon>
146+
<DesignTimeSharedInput>True</DesignTimeSharedInput>
147+
</Compile>
148+
<EmbeddedResource Include="Properties\Resources.resx">
149+
<Generator>ResXFileCodeGenerator</Generator>
150+
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
151+
</EmbeddedResource>
152+
<None Include="app.config" />
153+
<None Include="LICENSE" />
154+
<None Include="packages.config" />
155+
<None Include="Properties\Settings.settings">
156+
<Generator>SettingsSingleFileGenerator</Generator>
157+
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
158+
</None>
159+
<AppDesigner Include="Properties\" />
160+
<None Include="README.md" />
161+
<Resource Include="Resources\Entypo.ttf" />
162+
</ItemGroup>
163+
<ItemGroup>
164+
<Resource Include="Resources\BusinessCats.ico" />
165+
</ItemGroup>
166+
<ItemGroup>
167+
<Resource Include="Resources\WindowsIcons-license.txt" />
168+
</ItemGroup>
169+
<ItemGroup>
170+
<Resource Include="Resources\Entypo-license.txt" />
171+
</ItemGroup>
172+
<ItemGroup>
173+
<BootstrapperPackage Include=".NETFramework,Version=v4.5.1">
174+
<Visible>False</Visible>
175+
<ProductName>Microsoft .NET Framework 4.5.1 %28x86 and x64%29</ProductName>
176+
<Install>true</Install>
177+
</BootstrapperPackage>
178+
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
179+
<Visible>False</Visible>
180+
<ProductName>.NET Framework 3.5 SP1</ProductName>
181+
<Install>false</Install>
182+
</BootstrapperPackage>
183+
</ItemGroup>
184+
<ItemGroup>
185+
<Resource Include="Resources\partycats.ico" />
186+
</ItemGroup>
187+
<ItemGroup />
188+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
189+
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
190+
Other similar extension points exist, see Microsoft.Common.targets.
191+
<Target Name="BeforeBuild">
192+
</Target>
193+
<Target Name="AfterBuild">
194+
</Target>
195+
-->
196+
</Project>

BusinessCats.sln

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio 14
4+
VisualStudioVersion = 14.0.23107.0
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BusinessCats", "BusinessCats.csproj", "{A43EF9D1-58EC-4361-8BF2-D6122F36A956}"
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+
{A43EF9D1-58EC-4361-8BF2-D6122F36A956}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{A43EF9D1-58EC-4361-8BF2-D6122F36A956}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{A43EF9D1-58EC-4361-8BF2-D6122F36A956}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{A43EF9D1-58EC-4361-8BF2-D6122F36A956}.Release|Any CPU.Build.0 = Release|Any CPU
18+
EndGlobalSection
19+
GlobalSection(SolutionProperties) = preSolution
20+
HideSolutionNode = FALSE
21+
EndGlobalSection
22+
EndGlobal

LyncConversation.cs

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
using Microsoft.Lync.Model;
2+
using Microsoft.Lync.Model.Conversation;
3+
using System;
4+
using System.Collections.Generic;
5+
using System.Linq;
6+
using System.Text;
7+
using System.Threading.Tasks;
8+
9+
namespace BusinessCats
10+
{
11+
public class LyncConversation
12+
{
13+
public void UpdateDesc()
14+
{
15+
string people = "";
16+
foreach (var participant in conversation.Participants)
17+
{
18+
if (participant.IsSelf)
19+
{
20+
continue;
21+
}
22+
23+
var name = participant.Contact.GetContactInformation(ContactInformationType.DisplayName);
24+
people += name.ToString() + "; ";
25+
}
26+
27+
people = people.TrimEnd(';', ' ');
28+
desc = people;
29+
}
30+
31+
public string desc;
32+
public Conversation conversation;
33+
public Dictionary<Participant, LyncParticipant> participants;
34+
35+
public LyncParticipant FindParticipant(Participant participant)
36+
{
37+
if (participants.ContainsKey(participant))
38+
{
39+
return participants[participant];
40+
}
41+
42+
return null;
43+
}
44+
45+
public override string ToString()
46+
{
47+
return desc;
48+
}
49+
}
50+
}

LyncParticipant.cs

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
using Microsoft.Lync.Model.Conversation;
2+
using System;
3+
using System.Collections.Generic;
4+
using System.Linq;
5+
using System.Security.Cryptography;
6+
using System.Text;
7+
using System.Threading.Tasks;
8+
9+
namespace BusinessCats
10+
{
11+
public class LyncParticipant
12+
{
13+
public Participant participant;
14+
public InstantMessageModality modality;
15+
public ECDiffieHellmanCng dh;
16+
public byte[] derivedKey;
17+
18+
public byte[] GetPublicKey()
19+
{
20+
if (dh == null)
21+
{
22+
dh = new ECDiffieHellmanCng() { KeyDerivationFunction = ECDiffieHellmanKeyDerivationFunction.Hash, HashAlgorithm = CngAlgorithm.Sha256 };
23+
}
24+
25+
return dh.PublicKey.ToByteArray();
26+
}
27+
28+
public void DeriveKey(byte[] keyBlob)
29+
{
30+
var otherKey = CngKey.Import(keyBlob, CngKeyBlobFormat.EccPublicBlob);
31+
derivedKey = dh.DeriveKeyMaterial(otherKey);
32+
}
33+
}
34+
}

0 commit comments

Comments
 (0)