Skip to content
Browse files

Refactored projects

  • Loading branch information...
1 parent 4b3594f commit efc458a34b54eb324d89bb6f9a82d4be9cbcd94f Steven Houben committed Aug 25, 2012
Showing with 3,292 additions and 1,647 deletions.
  1. +0 −8 NooSphere/ActivityBar/ActivityUI.csproj
  2. +5 −7 NooSphere/ActivityBar/Xaml/ActivityBar.xaml.cs
  3. +2 −2 NooSphere/ActivityBar/Xaml/Login/LoginWindow.xaml.cs
  4. +3 −1 NooSphere/ActivityBar/Xaml/PopUp/ManagerWindow.xaml.cs
  5. +185 −186 NooSphere/ActivityDesk/ActivityDesk.csproj
  6. +3 −4 NooSphere/ActivityDesk/Desk.xaml.cs
  7. +191 −199 NooSphere/ActivityTablet/ActivityTablet.csproj
  8. +1 −4 NooSphere/ActivityTablet/Xaml/Tablet.xaml.cs
  9. +2 −3 NooSphere/NooSphere.ActivitySystem/Base/Client/ActivityClient.cs
  10. 0 NooSphere/NooSphere.ActivitySystem/{Contracts → Base}/Client/IActivityNetEvent.cs
  11. +2 −2 NooSphere/NooSphere.ActivitySystem/{Contracts → Base}/Client/IComNetEvent.cs
  12. +1 −1 NooSphere/NooSphere.ActivitySystem/{Contracts → Base}/Client/IDeviceNetEvent.cs
  13. +1 −1 NooSphere/NooSphere.ActivitySystem/{Contracts → Base}/Client/IFileNetEvent.cs
  14. +3 −1 NooSphere/NooSphere.ActivitySystem/{Contracts → Base}/Client/INetEventHandler.cs
  15. +1 −1 NooSphere/NooSphere.ActivitySystem/{Contracts → Base}/Client/IUserNetEvent.cs
  16. +368 −368 NooSphere/NooSphere.ActivitySystem/Base/Client/NetEventHandler.cs
  17. +2 −2 NooSphere/NooSphere.ActivitySystem/Base/ComEventArgs.cs
  18. +1 −1 NooSphere/NooSphere.ActivitySystem/{Contracts → Base}/EventType.cs
  19. +1 −0 NooSphere/NooSphere.ActivitySystem/Base/EventTypeConverter.cs
  20. +0 −7 NooSphere/NooSphere.ActivitySystem/Base/Heartbeat.cs
  21. +1 −1 NooSphere/NooSphere.ActivitySystem/{Contracts → Base}/IServiceBase.cs
  22. +5 −5 NooSphere/NooSphere.ActivitySystem/Base/{Client/Configuration.cs → Message.cs}
  23. +2 −3 NooSphere/NooSphere.ActivitySystem/Base/Service/ActivityCloudConnector.cs
  24. +4 −6 NooSphere/NooSphere.ActivitySystem/Base/Service/ActivityManager.cs
  25. +2 −1 NooSphere/NooSphere.ActivitySystem/{Contracts → Base}/Service/IActivityManager.cs
  26. +1 −2 NooSphere/NooSphere.ActivitySystem/{Contracts → Base}/Service/IFileServer.cs
  27. +2 −2 NooSphere/NooSphere.ActivitySystem/{Contracts → Base}/Service/IMessenger.cs
  28. +100 −0 NooSphere/NooSphere.ActivitySystem/Context/ContextMonitor.cs
  29. +9 −6 ...re/{NooSphere.Core/ActivityModel/Workflow.cs → NooSphere.ActivitySystem/Context/DataEventArgs.cs}
  30. +30 −0 NooSphere/NooSphere.ActivitySystem/Context/IContextService.cs
  31. +185 −0 NooSphere/NooSphere.ActivitySystem/Context/IO/PointerNode.cs
  32. +191 −0 NooSphere/NooSphere.ActivitySystem/Context/Multicast/MulticastSocket.cs
  33. +57 −0 NooSphere/NooSphere.ActivitySystem/Context/Multicast/MulticastSocketListener.cs
  34. +36 −0 NooSphere/NooSphere.ActivitySystem/Context/Multicast/StateObject.cs
  35. +27 −0 NooSphere/NooSphere.ActivitySystem/Context/Multicast/UdpPerformanceTest.cs
  36. +1 −2 NooSphere/NooSphere.ActivitySystem/Discovery/BroadcastService.cs
  37. +237 −239 NooSphere/NooSphere.ActivitySystem/Discovery/DiscoveryManager.cs
  38. +2 −2 NooSphere/NooSphere.ActivitySystem/{Contracts → }/Discovery/IDiscovery.cs
  39. +1 −1 NooSphere/NooSphere.ActivitySystem/FileServer/FileStore.cs
  40. +14 −2 NooSphere/NooSphere.ActivitySystem/FileServer/IFileStore.cs
  41. +22 −0 NooSphere/NooSphere.ActivitySystem/Helpers/Log.cs
  42. +208 −0 NooSphere/NooSphere.ActivitySystem/Helpers/Mime.cs
  43. +125 −0 NooSphere/NooSphere.ActivitySystem/Helpers/Net.cs
  44. +190 −0 NooSphere/NooSphere.ActivitySystem/Helpers/Rest.cs
  45. +44 −0 NooSphere/NooSphere.ActivitySystem/Helpers/XML.cs
  46. +198 −199 NooSphere/NooSphere.ActivitySystem/Host/GenericHost.cs
  47. +153 −145 NooSphere/NooSphere.ActivitySystem/NooSphere.ActivitySystem.csproj
  48. +7 −2 NooSphere/NooSphere.ActivitySystem/PubSub/Registry.cs
  49. +23 −30 NooSphere/NooSphere.ActivitySystem/PubSub/RestPublisher.cs
  50. +30 −29 NooSphere/NooSphere.ActivitySystem/PubSub/RestSubscriber.cs
  51. +1 −1 NooSphere/NooSphere.Core/ActivityModel/Action.cs
  52. +1 −3 NooSphere/NooSphere.Core/ActivityModel/Activity.cs
  53. +1 −2 NooSphere/NooSphere.Core/ActivityModel/Resource.cs
  54. +0 −19 NooSphere/NooSphere.Core/ActivityModel/Service.cs
  55. +1 −1 NooSphere/NooSphere.Core/ActivityModel/User.cs
  56. +2 −2 NooSphere/NooSphere.Core/Devices/Device.cs
  57. +2 −8 NooSphere/NooSphere.Core/NooSphere.Core.csproj
  58. +0 −92 NooSphere/NooSphere.Core/Parser/Parser.cs
  59. +3 −3 NooSphere/NooSphere.Core/Primitives/{Base.cs → Noo.cs}
  60. +148 −0 NooSphere/NooSphere.Discovery/Discovery/BroadcastService.cs
  61. +8 −12 ...e/ActivityModel/Credentials.cs → NooSphere.Discovery/Discovery/DiscoveryAddressAddedEventArgs.cs}
  62. +31 −0 NooSphere/NooSphere.Discovery/Discovery/DiscoveryEventArgs.cs
  63. +240 −0 NooSphere/NooSphere.Discovery/Discovery/DiscoveryManager.cs
  64. +4 −3 NooSphere/{NooSphere.Core/ActivityModel/Role.cs → NooSphere.Discovery/Discovery/DiscoveryType.cs}
  65. +9 −2 ...here/{NooSphere.Core/ActivityModel/Collaborator.cs → NooSphere.Discovery/Discovery/IDiscovery.cs}
  66. +30 −0 NooSphere/NooSphere.Discovery/Discovery/ServiceInfo.cs
  67. +90 −0 NooSphere/NooSphere.Discovery/NooSphere.Discovery.csproj
  68. +36 −0 NooSphere/NooSphere.Discovery/Properties/AssemblyInfo.cs
  69. +6 −0 NooSphere/NooSphere.Discovery/packages.config
  70. +0 −24 NooSphere/NooSphere.sln
View
8 NooSphere/ActivityBar/ActivityUI.csproj
@@ -183,18 +183,10 @@
<Project>{5CD6DD93-3EA1-425F-89D7-A80FD23BBC71}</Project>
<Name>NooSphere.ActivitySystem</Name>
</ProjectReference>
- <ProjectReference Include="..\NooSphere.Context\NooSphere.Context.csproj">
- <Project>{579056D5-469B-4BAA-8F2B-E522A3E76C8E}</Project>
- <Name>NooSphere.Context</Name>
- </ProjectReference>
<ProjectReference Include="..\NooSphere.Core\NooSphere.Core.csproj">
<Project>{03C072A4-5960-4A5D-B0CC-98EBD854E970}</Project>
<Name>NooSphere.Core</Name>
</ProjectReference>
- <ProjectReference Include="..\NooSphere.Helpers\NooSphere.Helpers.csproj">
- <Project>{6424191D-5C04-43E6-B610-FD4B41E8A340}</Project>
- <Name>NooSphere.Helpers</Name>
- </ProjectReference>
<ProjectReference Include="..\NooSphere.Platform.Windows\NooSphere.Platform.Windows.csproj">
<Project>{B3333919-EE66-441A-8AB3-6E6601A8A0B1}</Project>
<Name>NooSphere.Platform.Windows</Name>
View
12 NooSphere/ActivityBar/Xaml/ActivityBar.xaml.cs
@@ -21,16 +21,13 @@
using System.Windows.Media;
using System.Collections.ObjectModel;
using System.Windows.Threading;
-using System.Threading;
using System.Runtime.InteropServices;
using System.Windows.Interop;
using NooSphere.ActivitySystem.Base;
using NooSphere.ActivitySystem.Base.Client;
using NooSphere.ActivitySystem.Base.Service;
-using NooSphere.ActivitySystem.Contracts.Service;
using NooSphere.ActivitySystem.Discovery;
using NooSphere.ActivitySystem.Host;
-using NooSphere.Context.IO;
using NooSphere.Core.ActivityModel;
using NooSphere.Core.Devices;
using NooSphere.Platform.Windows.Glass;
@@ -85,6 +82,8 @@ public partial class ActivityBar
/// </summary>
public ActivityBar()
{
+
+
InitializeComponent();
_activityWindow = new ActivityWindow(this);
_popUpWindows.Add(_activityWindow);
@@ -117,7 +116,7 @@ public void AddEmptyActivity()
/// Sends a message to the activity manager
/// </summary>
/// <param name="message">Message that needs to be send to the activity manager</param>
- public void SendMessage(string message)
+ public void SendMessage(Message message)
{
_client.SendMessage(message);
txtInput.Text = "";
@@ -210,7 +209,7 @@ public void StartActivityManager()
_host = new GenericHost(7891);
_host.HostLaunched += HostHostLaunched;
_host.Open(new ActivityManager(_owner, "c:/files/"), typeof (IActivityManager), _device.Name);
- _host.StartBroadcast(Settings.Default.DISCOVERY_TYPE, _device.Name, _device.Code.ToString(), _device.Location);
+ _host.StartBroadcast(Settings.Default.DISCOVERY_TYPE, _device.Name, _device.TagValue.ToString(), _device.Location);
});
}
@@ -603,7 +602,7 @@ private void ChkBroadcastClick(object sender, RoutedEventArgs e)
}
private void BtnSendClick(object sender, RoutedEventArgs e)
{
- SendMessage(txtInput.Text);
+
}
private void LoginLoggedIn(object sender, EventArgs e)
{
@@ -807,7 +806,6 @@ private void BDragEnter(object sender, DragEventArgs e)
e.Effects = DragDropEffects.Copy;
}
-
}
private void BDrop(object sender, DragEventArgs e)
View
4 NooSphere/ActivityBar/Xaml/Login/LoginWindow.xaml.cs
@@ -24,10 +24,10 @@
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
+using NooSphere.ActivitySystem.Helpers;
using NooSphere.Core.Devices;
using NooSphere.Core.ActivityModel;
using ActivityUI.Properties;
-using NooSphere.Helpers;
using Newtonsoft.Json;
using System.Runtime.InteropServices;
using System.Windows.Interop;
@@ -116,7 +116,7 @@ private void LogIn()
this.Device = new Device();
this.Device.Name = txtDevicename.Text;
this.Device.DeviceType = (DeviceType)cbType.SelectedValue;
- Device.Code = (int)cbTag.SelectedValue;
+ Device.TagValue = (int)cbTag.SelectedValue;
if (rbClient.IsChecked == true)
this.Mode = StartUpMode.Client;
View
4 NooSphere/ActivityBar/Xaml/PopUp/ManagerWindow.xaml.cs
@@ -20,6 +20,7 @@
using System.Windows.Threading;
using ActivityUI.Properties;
using ActivityUI.Xaml;
+using NooSphere.ActivitySystem.Base;
using NooSphere.ActivitySystem.Discovery;
using NooSphere.Platform.Windows.Interopt;
@@ -107,7 +108,8 @@ private void btnRefresh_Click(object sender, RoutedEventArgs e)
private void btnSend_Click(object sender, RoutedEventArgs e)
{
- taskbar.SendMessage(txtInput.Text);
+ var msg = new Message() { From = "steven", To = "all", Header = "Controller.RoleChanged", Content = txtInput.Text };
+ taskbar.SendMessage(msg);
}
private void txtAddFriend_Click(object sender, RoutedEventArgs e)
View
371 NooSphere/ActivityDesk/ActivityDesk.csproj
@@ -1,187 +1,186 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
- <PropertyGroup>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ProjectGuid>{94919648-ACAC-4E13-817C-5F41B9123C77}</ProjectGuid>
- <ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
- <RootNamespace>ActivityDesk</RootNamespace>
- <AssemblyName>ActivityDesk</AssemblyName>
- <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
- <WarningLevel>4</WarningLevel>
- <OutputType>winexe</OutputType>
- <IsWebBootstrapper>false</IsWebBootstrapper>
- <RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent>
- <PublishUrl>Publish\</PublishUrl>
- <Install>true</Install>
- <InstallFrom>Web</InstallFrom>
- <UpdateEnabled>true</UpdateEnabled>
- <UpdateMode>Foreground</UpdateMode>
- <UpdateInterval>7</UpdateInterval>
- <UpdateIntervalUnits>Days</UpdateIntervalUnits>
- <UpdatePeriodically>false</UpdatePeriodically>
- <UpdateRequired>false</UpdateRequired>
- <MapFileExtensions>false</MapFileExtensions>
- <ApplicationRevision>0</ApplicationRevision>
- <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
- <UseApplicationTrust>false</UseApplicationTrust>
- <BootstrapperEnabled>true</BootstrapperEnabled>
- <SccProjectName>Svn</SccProjectName>
- <SccLocalPath>Svn</SccLocalPath>
- <SccAuxPath>Svn</SccAuxPath>
- <SccProvider>SubversionScc</SccProvider>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
- <DebugSymbols>true</DebugSymbols>
- <DebugType>full</DebugType>
- <Optimize>false</Optimize>
- <OutputPath>.\bin\Debug\</OutputPath>
- <DefineConstants>DEBUG;TRACE</DefineConstants>
- <RunCodeAnalysis>true</RunCodeAnalysis>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
- <DebugSymbols>false</DebugSymbols>
- <Optimize>true</Optimize>
- <OutputPath>.\bin\Release\</OutputPath>
- <DefineConstants>TRACE</DefineConstants>
- </PropertyGroup>
- <PropertyGroup>
- <ApplicationIcon>
- </ApplicationIcon>
- </PropertyGroup>
- <ItemGroup>
- <Reference Include="Microsoft.Surface.Core, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
- <Reference Include="Microsoft.Surface.Presentation.Generic, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
- <Reference Include="System" />
- <Reference Include="System.Core">
- <RequiredTargetFramework>3.5</RequiredTargetFramework>
- </Reference>
- <Reference Include="System.Data" />
- <Reference Include="System.Drawing" />
- <Reference Include="System.Windows.Forms" />
- <Reference Include="System.Xaml" />
- <Reference Include="System.Xml" />
- <Reference Include="WindowsBase" />
- <Reference Include="PresentationCore" />
- <Reference Include="PresentationFramework" />
- <Reference Include="Microsoft.Surface" />
- <Reference Include="Microsoft.Surface.Presentation" />
- </ItemGroup>
- <ItemGroup>
- <ApplicationDefinition Include="App.xaml">
- <Generator>MSBuild:Compile</Generator>
- <SubType>Designer</SubType>
- </ApplicationDefinition>
- <Compile Include="App.xaml.cs">
- <DependentUpon>App.xaml</DependentUpon>
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="DeskState.cs" />
- <Compile Include="Helper\Pdf\PDFConverter.cs" />
- <Compile Include="Visualizer\Definitions\SmartPhoneDefinition.cs" />
- <Compile Include="Visualizer\Definitions\TabletDefinition.cs" />
- <Compile Include="Visualizer\Visualizations\SmartPhone.xaml.cs">
- <DependentUpon>SmartPhone.xaml</DependentUpon>
- </Compile>
- <Compile Include="Visualizer\Visualizations\VisualizationTablet.xaml.cs">
- <DependentUpon>VisualizationTablet.xaml</DependentUpon>
- </Compile>
- </ItemGroup>
- <ItemGroup>
- <Compile Include="Visualizer\Visualizations\BaseVisualization.cs" />
- <Compile Include="Visualizer\Visualizations\VisualizationSmartPhone.xaml.cs">
- <DependentUpon>VisualizationSmartPhone.xaml</DependentUpon>
- </Compile>
- <Compile Include="Helper\GuiHelpers.cs" />
- <Compile Include="Windowing\TableWindow.xaml.cs">
- <DependentUpon>TableWindow.xaml</DependentUpon>
- </Compile>
- <Compile Include="Properties\AssemblyInfo.cs" />
- <Compile Include="Helper\GlobalSuppressions.cs" />
- <Compile Include="Desk.xaml.cs">
- <DependentUpon>Desk.xaml</DependentUpon>
- </Compile>
- <Compile Include="Visualizer\AncestryChain.cs" />
- <Compile Include="Visualizer\TagVisualizationEnterLeaveEventArgs.cs" />
- <Compile Include="Visualizer\TagVisualizerEvents.cs" />
- <Compile Include="Visualizer\TagVisualizerSynchronizationMode.cs" />
- <AppDesigner Include="Properties\" />
- </ItemGroup>
- <ItemGroup>
- <Page Include="Visualizer\Visualizations\SmartPhone.xaml">
- <SubType>Designer</SubType>
- <Generator>MSBuild:Compile</Generator>
- </Page>
- <Page Include="Visualizer\Visualizations\VisualizationSmartPhone.xaml">
- <Generator>MSBuild:Compile</Generator>
- <SubType>Designer</SubType>
- </Page>
- <Page Include="Desk.xaml">
- <Generator>MSBuild:Compile</Generator>
- <SubType>Designer</SubType>
- </Page>
- <Page Include="Windowing\TableWindow.xaml">
- <Generator>MSBuild:Compile</Generator>
- <SubType>Designer</SubType>
- </Page>
- <Page Include="Visualizer\Visualizations\StyleDictionary.xaml">
- <Generator>MSBuild:Compile</Generator>
- <SubType>Designer</SubType>
- </Page>
- <Page Include="Visualizer\Visualizations\VisualizationTablet.xaml">
- <Generator>MSBuild:Compile</Generator>
- <SubType>Designer</SubType>
- </Page>
- </ItemGroup>
- <ItemGroup>
- <Resource Include="Images\document.PNG" />
- </ItemGroup>
- <ItemGroup>
- <WCFMetadata Include="Service References\" />
- </ItemGroup>
- <ItemGroup>
- <BootstrapperPackage Include=".NETFramework,Version=v4.0">
- <Visible>False</Visible>
- <ProductName>Microsoft .NET Framework 4 %28x86 and x64%29</ProductName>
- <Install>true</Install>
- </BootstrapperPackage>
- <BootstrapperPackage Include="Microsoft.Net.Client.3.5">
- <Visible>False</Visible>
- <ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
- <Install>false</Install>
- </BootstrapperPackage>
- <BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
- <Visible>False</Visible>
- <ProductName>.NET Framework 3.5 SP1</ProductName>
- <Install>false</Install>
- </BootstrapperPackage>
- <BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
- <Visible>False</Visible>
- <ProductName>Windows Installer 3.1</ProductName>
- <Install>true</Install>
- </BootstrapperPackage>
- </ItemGroup>
- <ItemGroup>
- <ProjectReference Include="..\NooSphere.ActivitySystem\NooSphere.ActivitySystem.csproj">
- <Project>{5CD6DD93-3EA1-425F-89D7-A80FD23BBC71}</Project>
- <Name>NooSphere.ActivitySystem</Name>
- </ProjectReference>
- <ProjectReference Include="..\NooSphere.Core\NooSphere.Core.csproj">
- <Project>{03C072A4-5960-4A5D-B0CC-98EBD854E970}</Project>
- <Name>NooSphere.Core</Name>
- </ProjectReference>
- <ProjectReference Include="..\NooSphere.Helpers\NooSphere.Helpers.csproj">
- <Project>{6424191D-5C04-43E6-B610-FD4B41E8A340}</Project>
- <Name>NooSphere.Helpers</Name>
- </ProjectReference>
- </ItemGroup>
- <ItemGroup>
- <Resource Include="Images\blue.jpg" />
- </ItemGroup>
- <ItemGroup>
- <Resource Include="Images\green.jpg" />
- <Resource Include="Images\red.jpg" />
- <Resource Include="Images\yellow.jpg" />
- </ItemGroup>
- <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProjectGuid>{94919648-ACAC-4E13-817C-5F41B9123C77}</ProjectGuid>
+ <ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+ <RootNamespace>ActivityDesk</RootNamespace>
+ <AssemblyName>ActivityDesk</AssemblyName>
+ <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+ <WarningLevel>4</WarningLevel>
+ <OutputType>winexe</OutputType>
+ <IsWebBootstrapper>false</IsWebBootstrapper>
+ <RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent>
+ <PublishUrl>Publish\</PublishUrl>
+ <Install>true</Install>
+ <InstallFrom>Web</InstallFrom>
+ <UpdateEnabled>true</UpdateEnabled>
+ <UpdateMode>Foreground</UpdateMode>
+ <UpdateInterval>7</UpdateInterval>
+ <UpdateIntervalUnits>Days</UpdateIntervalUnits>
+ <UpdatePeriodically>false</UpdatePeriodically>
+ <UpdateRequired>false</UpdateRequired>
+ <MapFileExtensions>false</MapFileExtensions>
+ <ApplicationRevision>0</ApplicationRevision>
+ <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
+ <UseApplicationTrust>false</UseApplicationTrust>
+ <BootstrapperEnabled>true</BootstrapperEnabled>
+ <SccProjectName>Svn</SccProjectName>
+ <SccLocalPath>Svn</SccLocalPath>
+ <SccAuxPath>Svn</SccAuxPath>
+ <SccProvider>SubversionScc</SccProvider>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>.\bin\Debug\</OutputPath>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <RunCodeAnalysis>true</RunCodeAnalysis>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugSymbols>false</DebugSymbols>
+ <Optimize>true</Optimize>
+ <OutputPath>.\bin\Release\</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ </PropertyGroup>
+ <PropertyGroup>
+ <ApplicationIcon>
+ </ApplicationIcon>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="ImageMagickNET">
+ <HintPath>..\..\..\..\..\Desktop\ImageMagickNET.dll</HintPath>
+ </Reference>
+ <Reference Include="Microsoft.Surface.Core, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
+ <Reference Include="Microsoft.Surface.Presentation.Generic, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
+ <Reference Include="System" />
+ <Reference Include="System.Core">
+ <RequiredTargetFramework>3.5</RequiredTargetFramework>
+ </Reference>
+ <Reference Include="System.Data" />
+ <Reference Include="System.Drawing" />
+ <Reference Include="System.Windows.Forms" />
+ <Reference Include="System.Xaml" />
+ <Reference Include="System.Xml" />
+ <Reference Include="WindowsBase" />
+ <Reference Include="PresentationCore" />
+ <Reference Include="PresentationFramework" />
+ <Reference Include="Microsoft.Surface" />
+ <Reference Include="Microsoft.Surface.Presentation" />
+ </ItemGroup>
+ <ItemGroup>
+ <ApplicationDefinition Include="App.xaml">
+ <Generator>MSBuild:Compile</Generator>
+ <SubType>Designer</SubType>
+ </ApplicationDefinition>
+ <Compile Include="App.xaml.cs">
+ <DependentUpon>App.xaml</DependentUpon>
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="DeskState.cs" />
+ <Compile Include="Helper\Pdf\PDFConverter.cs" />
+ <Compile Include="Visualizer\Definitions\SmartPhoneDefinition.cs" />
+ <Compile Include="Visualizer\Definitions\TabletDefinition.cs" />
+ <Compile Include="Visualizer\Visualizations\SmartPhone.xaml.cs">
+ <DependentUpon>SmartPhone.xaml</DependentUpon>
+ </Compile>
+ <Compile Include="Visualizer\Visualizations\VisualizationTablet.xaml.cs">
+ <DependentUpon>VisualizationTablet.xaml</DependentUpon>
+ </Compile>
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="Visualizer\Visualizations\BaseVisualization.cs" />
+ <Compile Include="Visualizer\Visualizations\VisualizationSmartPhone.xaml.cs">
+ <DependentUpon>VisualizationSmartPhone.xaml</DependentUpon>
+ </Compile>
+ <Compile Include="Helper\GuiHelpers.cs" />
+ <Compile Include="Windowing\TableWindow.xaml.cs">
+ <DependentUpon>TableWindow.xaml</DependentUpon>
+ </Compile>
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ <Compile Include="Helper\GlobalSuppressions.cs" />
+ <Compile Include="Desk.xaml.cs">
+ <DependentUpon>Desk.xaml</DependentUpon>
+ </Compile>
+ <Compile Include="Visualizer\AncestryChain.cs" />
+ <Compile Include="Visualizer\TagVisualizationEnterLeaveEventArgs.cs" />
+ <Compile Include="Visualizer\TagVisualizerEvents.cs" />
+ <Compile Include="Visualizer\TagVisualizerSynchronizationMode.cs" />
+ <AppDesigner Include="Properties\" />
+ </ItemGroup>
+ <ItemGroup>
+ <Page Include="Visualizer\Visualizations\SmartPhone.xaml">
+ <SubType>Designer</SubType>
+ <Generator>MSBuild:Compile</Generator>
+ </Page>
+ <Page Include="Visualizer\Visualizations\VisualizationSmartPhone.xaml">
+ <Generator>MSBuild:Compile</Generator>
+ <SubType>Designer</SubType>
+ </Page>
+ <Page Include="Desk.xaml">
+ <Generator>MSBuild:Compile</Generator>
+ <SubType>Designer</SubType>
+ </Page>
+ <Page Include="Windowing\TableWindow.xaml">
+ <Generator>MSBuild:Compile</Generator>
+ <SubType>Designer</SubType>
+ </Page>
+ <Page Include="Visualizer\Visualizations\StyleDictionary.xaml">
+ <Generator>MSBuild:Compile</Generator>
+ <SubType>Designer</SubType>
+ </Page>
+ <Page Include="Visualizer\Visualizations\VisualizationTablet.xaml">
+ <Generator>MSBuild:Compile</Generator>
+ <SubType>Designer</SubType>
+ </Page>
+ </ItemGroup>
+ <ItemGroup>
+ <Resource Include="Images\document.PNG" />
+ </ItemGroup>
+ <ItemGroup>
+ <WCFMetadata Include="Service References\" />
+ </ItemGroup>
+ <ItemGroup>
+ <BootstrapperPackage Include=".NETFramework,Version=v4.0">
+ <Visible>False</Visible>
+ <ProductName>Microsoft .NET Framework 4 %28x86 and x64%29</ProductName>
+ <Install>true</Install>
+ </BootstrapperPackage>
+ <BootstrapperPackage Include="Microsoft.Net.Client.3.5">
+ <Visible>False</Visible>
+ <ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
+ <Install>false</Install>
+ </BootstrapperPackage>
+ <BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
+ <Visible>False</Visible>
+ <ProductName>.NET Framework 3.5 SP1</ProductName>
+ <Install>false</Install>
+ </BootstrapperPackage>
+ <BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
+ <Visible>False</Visible>
+ <ProductName>Windows Installer 3.1</ProductName>
+ <Install>true</Install>
+ </BootstrapperPackage>
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\NooSphere.ActivitySystem\NooSphere.ActivitySystem.csproj">
+ <Project>{5CD6DD93-3EA1-425F-89D7-A80FD23BBC71}</Project>
+ <Name>NooSphere.ActivitySystem</Name>
+ </ProjectReference>
+ <ProjectReference Include="..\NooSphere.Core\NooSphere.Core.csproj">
+ <Project>{03C072A4-5960-4A5D-B0CC-98EBD854E970}</Project>
+ <Name>NooSphere.Core</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <ItemGroup>
+ <Resource Include="Images\blue.jpg" />
+ </ItemGroup>
+ <ItemGroup>
+ <Resource Include="Images\green.jpg" />
+ <Resource Include="Images\red.jpg" />
+ <Resource Include="Images\yellow.jpg" />
+ </ItemGroup>
+ <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
</Project>
View
7 NooSphere/ActivityDesk/Desk.xaml.cs
@@ -24,10 +24,9 @@
using System.Collections.Generic;
using NooSphere.ActivitySystem.Base;
using NooSphere.ActivitySystem.Base.Service;
-using NooSphere.ActivitySystem.Contracts.Service;
+using NooSphere.ActivitySystem.Helpers;
using NooSphere.Core.ActivityModel;
using NooSphere.ActivitySystem.Host;
-using NooSphere.ActivitySystem.Contracts;
using NooSphere.ActivitySystem.Discovery;
using NooSphere.Core.Devices;
using System.Windows.Media.Imaging;
@@ -36,7 +35,6 @@
using NooSphere.ActivitySystem.Base.Client;
using System.Windows.Controls;
using ActivityDesk.Visualizer.Visualization;
-using NooSphere.Helpers;
namespace ActivityDesk
{
@@ -344,7 +342,8 @@ void client_DeviceAdded(object sender, DeviceEventArgs e)
void client_MessageReceived(object sender, ComEventArgs e)
{
- MessageBox.Show(e.Message);
+ MessageBox.Show(e.Message.Content);
+
}
void ClientActivityRemoved(object sender, ActivityRemovedEventArgs e)
View
390 NooSphere/ActivityTablet/ActivityTablet.csproj
@@ -1,200 +1,192 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <PropertyGroup>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ProductVersion>8.0.30703</ProductVersion>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{B6356A30-18D3-4B74-8608-B855B2C7BFD7}</ProjectGuid>
- <OutputType>WinExe</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>ActivityTablet</RootNamespace>
- <AssemblyName>ActivityTablet</AssemblyName>
- <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
- <TargetFrameworkProfile>
- </TargetFrameworkProfile>
- <FileAlignment>512</FileAlignment>
- <ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
- <WarningLevel>4</WarningLevel>
- <SccProjectName>Svn</SccProjectName>
- <SccLocalPath>Svn</SccLocalPath>
- <SccAuxPath>Svn</SccAuxPath>
- <SccProvider>SubversionScc</SccProvider>
- <IsWebBootstrapper>false</IsWebBootstrapper>
- <PublishUrl>publish\</PublishUrl>
- <Install>true</Install>
- <InstallFrom>Disk</InstallFrom>
- <UpdateEnabled>false</UpdateEnabled>
- <UpdateMode>Foreground</UpdateMode>
- <UpdateInterval>7</UpdateInterval>
- <UpdateIntervalUnits>Days</UpdateIntervalUnits>
- <UpdatePeriodically>false</UpdatePeriodically>
- <UpdateRequired>false</UpdateRequired>
- <MapFileExtensions>true</MapFileExtensions>
- <ApplicationRevision>0</ApplicationRevision>
- <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
- <UseApplicationTrust>false</UseApplicationTrust>
- <BootstrapperEnabled>true</BootstrapperEnabled>
- <Utf8Output>true</Utf8Output>
- <ExpressionBlendVersion>4.0.20525.0</ExpressionBlendVersion>
- <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
- <RestorePackages>true</RestorePackages>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
- <DebugSymbols>true</DebugSymbols>
- <DebugType>full</DebugType>
- <Optimize>false</Optimize>
- <OutputPath>bin\Debug\</OutputPath>
- <DefineConstants>DEBUG;TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- <PlatformTarget>x86</PlatformTarget>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
- <DebugType>pdbonly</DebugType>
- <Optimize>true</Optimize>
- <OutputPath>bin\Release\</OutputPath>
- <DefineConstants>TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- </PropertyGroup>
- <ItemGroup>
- <Reference Include="Microsoft.Surface, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
- <Reference Include="Microsoft.Surface.Core, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
- <Reference Include="Microsoft.Surface.Presentation, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
- <Reference Include="Newtonsoft.Json, Version=4.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
- <HintPath>..\packages\Newtonsoft.Json.4.5.7\lib\net40\Newtonsoft.Json.dll</HintPath>
- </Reference>
- <Reference Include="System" />
- <Reference Include="System.Configuration" />
- <Reference Include="System.Data" />
- <Reference Include="System.Drawing" />
- <Reference Include="System.ServiceModel" />
- <Reference Include="System.Windows.Forms" />
- <Reference Include="System.Xml" />
- <Reference Include="Microsoft.CSharp" />
- <Reference Include="System.Core" />
- <Reference Include="System.Xml.Linq" />
- <Reference Include="System.Data.DataSetExtensions" />
- <Reference Include="System.Xaml">
- <RequiredTargetFramework>4.0</RequiredTargetFramework>
- </Reference>
- <Reference Include="UIAutomationProvider" />
- <Reference Include="UIAutomationTypes" />
- <Reference Include="WindowsBase" />
- <Reference Include="PresentationCore" />
- <Reference Include="PresentationFramework" />
- </ItemGroup>
- <ItemGroup>
- <ApplicationDefinition Include="App.xaml">
- <Generator>MSBuild:Compile</Generator>
- <SubType>Designer</SubType>
- </ApplicationDefinition>
- <Page Include="Xaml\Tablet.xaml">
- <Generator>MSBuild:Compile</Generator>
- <SubType>Designer</SubType>
- </Page>
- <Compile Include="Xaml\ActivityButton.cs" />
- <Compile Include="App.xaml.cs">
- <DependentUpon>App.xaml</DependentUpon>
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="Proxy.cs" />
- <Compile Include="Xaml\Tablet.xaml.cs">
- <DependentUpon>Tablet.xaml</DependentUpon>
- <SubType>Code</SubType>
- </Compile>
- </ItemGroup>
- <ItemGroup>
- <Compile Include="Properties\AssemblyInfo.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="Properties\Resources.Designer.cs">
- <AutoGen>True</AutoGen>
- <DesignTime>True</DesignTime>
- <DependentUpon>Resources.resx</DependentUpon>
- </Compile>
- <Compile Include="Properties\Settings.Designer.cs">
- <AutoGen>True</AutoGen>
- <DependentUpon>Settings.settings</DependentUpon>
- <DesignTimeSharedInput>True</DesignTimeSharedInput>
- </Compile>
- <EmbeddedResource Include="Properties\Resources.resx">
- <Generator>ResXFileCodeGenerator</Generator>
- <LastGenOutput>Resources.Designer.cs</LastGenOutput>
- </EmbeddedResource>
- <None Include="app.config" />
- <None Include="back.png">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </None>
- <None Include="packages.config" />
- <None Include="Properties\Settings.settings">
- <Generator>SettingsSingleFileGenerator</Generator>
- <LastGenOutput>Settings.Designer.cs</LastGenOutput>
- </None>
- <AppDesigner Include="Properties\" />
- </ItemGroup>
- <ItemGroup>
- <Content Include="Resources\icon.png">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </Content>
- <Content Include="ActivityTablet.xml">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </Content>
- </ItemGroup>
- <ItemGroup>
- <BootstrapperPackage Include=".NETFramework,Version=v4.0,Profile=Client">
- <Visible>False</Visible>
- <ProductName>Microsoft .NET Framework 4 Client Profile %28x86 and x64%29</ProductName>
- <Install>true</Install>
- </BootstrapperPackage>
- <BootstrapperPackage Include="Microsoft.Net.Client.3.5">
- <Visible>False</Visible>
- <ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
- <Install>false</Install>
- </BootstrapperPackage>
- <BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
- <Visible>False</Visible>
- <ProductName>.NET Framework 3.5 SP1</ProductName>
- <Install>false</Install>
- </BootstrapperPackage>
- <BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
- <Visible>False</Visible>
- <ProductName>Windows Installer 3.1</ProductName>
- <Install>true</Install>
- </BootstrapperPackage>
- </ItemGroup>
- <ItemGroup>
- <Resource Include="Images\activity.PNG" />
- <Resource Include="activity1.PNG" />
- <Resource Include="activity_trans.png" />
- <Resource Include="logo.PNG" />
- </ItemGroup>
- <ItemGroup>
- <ProjectReference Include="..\NooSphere.ActivitySystem\NooSphere.ActivitySystem.csproj">
- <Project>{5CD6DD93-3EA1-425F-89D7-A80FD23BBC71}</Project>
- <Name>NooSphere.ActivitySystem</Name>
- </ProjectReference>
- <ProjectReference Include="..\NooSphere.Context\NooSphere.Context.csproj">
- <Project>{579056D5-469B-4BAA-8F2B-E522A3E76C8E}</Project>
- <Name>NooSphere.Context</Name>
- </ProjectReference>
- <ProjectReference Include="..\NooSphere.Core\NooSphere.Core.csproj">
- <Project>{03C072A4-5960-4A5D-B0CC-98EBD854E970}</Project>
- <Name>NooSphere.Core</Name>
- </ProjectReference>
- <ProjectReference Include="..\NooSphere.Helpers\NooSphere.Helpers.csproj">
- <Project>{6424191D-5C04-43E6-B610-FD4B41E8A340}</Project>
- <Name>NooSphere.Helpers</Name>
- </ProjectReference>
- </ItemGroup>
- <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
- <Import Project="$(SolutionDir)\.nuget\nuget.targets" />
- <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
- Other similar extension points exist, see Microsoft.Common.targets.
- <Target Name="BeforeBuild">
- </Target>
- <Target Name="AfterBuild">
- </Target>
- -->
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>8.0.30703</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{B6356A30-18D3-4B74-8608-B855B2C7BFD7}</ProjectGuid>
+ <OutputType>WinExe</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>ActivityTablet</RootNamespace>
+ <AssemblyName>ActivityTablet</AssemblyName>
+ <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+ <TargetFrameworkProfile>
+ </TargetFrameworkProfile>
+ <FileAlignment>512</FileAlignment>
+ <ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+ <WarningLevel>4</WarningLevel>
+ <SccProjectName>Svn</SccProjectName>
+ <SccLocalPath>Svn</SccLocalPath>
+ <SccAuxPath>Svn</SccAuxPath>
+ <SccProvider>SubversionScc</SccProvider>
+ <IsWebBootstrapper>false</IsWebBootstrapper>
+ <PublishUrl>publish\</PublishUrl>
+ <Install>true</Install>
+ <InstallFrom>Disk</InstallFrom>
+ <UpdateEnabled>false</UpdateEnabled>
+ <UpdateMode>Foreground</UpdateMode>
+ <UpdateInterval>7</UpdateInterval>
+ <UpdateIntervalUnits>Days</UpdateIntervalUnits>
+ <UpdatePeriodically>false</UpdatePeriodically>
+ <UpdateRequired>false</UpdateRequired>
+ <MapFileExtensions>true</MapFileExtensions>
+ <ApplicationRevision>0</ApplicationRevision>
+ <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
+ <UseApplicationTrust>false</UseApplicationTrust>
+ <BootstrapperEnabled>true</BootstrapperEnabled>
+ <Utf8Output>true</Utf8Output>
+ <ExpressionBlendVersion>4.0.20525.0</ExpressionBlendVersion>
+ <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
+ <RestorePackages>true</RestorePackages>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\Debug\</OutputPath>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <PlatformTarget>x86</PlatformTarget>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>bin\Release\</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="Microsoft.Surface, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
+ <Reference Include="Microsoft.Surface.Core, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
+ <Reference Include="Microsoft.Surface.Presentation, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
+ <Reference Include="Newtonsoft.Json, Version=4.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
+ <HintPath>..\packages\Newtonsoft.Json.4.5.7\lib\net40\Newtonsoft.Json.dll</HintPath>
+ </Reference>
+ <Reference Include="System" />
+ <Reference Include="System.Configuration" />
+ <Reference Include="System.Data" />
+ <Reference Include="System.Drawing" />
+ <Reference Include="System.ServiceModel" />
+ <Reference Include="System.Windows.Forms" />
+ <Reference Include="System.Xml" />
+ <Reference Include="Microsoft.CSharp" />
+ <Reference Include="System.Core" />
+ <Reference Include="System.Xml.Linq" />
+ <Reference Include="System.Data.DataSetExtensions" />
+ <Reference Include="System.Xaml">
+ <RequiredTargetFramework>4.0</RequiredTargetFramework>
+ </Reference>
+ <Reference Include="UIAutomationProvider" />
+ <Reference Include="UIAutomationTypes" />
+ <Reference Include="WindowsBase" />
+ <Reference Include="PresentationCore" />
+ <Reference Include="PresentationFramework" />
+ </ItemGroup>
+ <ItemGroup>
+ <ApplicationDefinition Include="App.xaml">
+ <Generator>MSBuild:Compile</Generator>
+ <SubType>Designer</SubType>
+ </ApplicationDefinition>
+ <Page Include="Xaml\Tablet.xaml">
+ <Generator>MSBuild:Compile</Generator>
+ <SubType>Designer</SubType>
+ </Page>
+ <Compile Include="Xaml\ActivityButton.cs" />
+ <Compile Include="App.xaml.cs">
+ <DependentUpon>App.xaml</DependentUpon>
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="Proxy.cs" />
+ <Compile Include="Xaml\Tablet.xaml.cs">
+ <DependentUpon>Tablet.xaml</DependentUpon>
+ <SubType>Code</SubType>
+ </Compile>
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="Properties\AssemblyInfo.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="Properties\Resources.Designer.cs">
+ <AutoGen>True</AutoGen>
+ <DesignTime>True</DesignTime>
+ <DependentUpon>Resources.resx</DependentUpon>
+ </Compile>
+ <Compile Include="Properties\Settings.Designer.cs">
+ <AutoGen>True</AutoGen>
+ <DependentUpon>Settings.settings</DependentUpon>
+ <DesignTimeSharedInput>True</DesignTimeSharedInput>
+ </Compile>
+ <EmbeddedResource Include="Properties\Resources.resx">
+ <Generator>ResXFileCodeGenerator</Generator>
+ <LastGenOutput>Resources.Designer.cs</LastGenOutput>
+ </EmbeddedResource>
+ <None Include="app.config" />
+ <None Include="back.png">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </None>
+ <None Include="packages.config" />
+ <None Include="Properties\Settings.settings">
+ <Generator>SettingsSingleFileGenerator</Generator>
+ <LastGenOutput>Settings.Designer.cs</LastGenOutput>
+ </None>
+ <AppDesigner Include="Properties\" />
+ </ItemGroup>
+ <ItemGroup>
+ <Content Include="Resources\icon.png">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </Content>
+ <Content Include="ActivityTablet.xml">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </Content>
+ </ItemGroup>
+ <ItemGroup>
+ <BootstrapperPackage Include=".NETFramework,Version=v4.0,Profile=Client">
+ <Visible>False</Visible>
+ <ProductName>Microsoft .NET Framework 4 Client Profile %28x86 and x64%29</ProductName>
+ <Install>true</Install>
+ </BootstrapperPackage>
+ <BootstrapperPackage Include="Microsoft.Net.Client.3.5">
+ <Visible>False</Visible>
+ <ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
+ <Install>false</Install>
+ </BootstrapperPackage>
+ <BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
+ <Visible>False</Visible>
+ <ProductName>.NET Framework 3.5 SP1</ProductName>
+ <Install>false</Install>
+ </BootstrapperPackage>
+ <BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
+ <Visible>False</Visible>
+ <ProductName>Windows Installer 3.1</ProductName>
+ <Install>true</Install>
+ </BootstrapperPackage>
+ </ItemGroup>
+ <ItemGroup>
+ <Resource Include="Images\activity.PNG" />
+ <Resource Include="activity1.PNG" />
+ <Resource Include="activity_trans.png" />
+ <Resource Include="logo.PNG" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\NooSphere.ActivitySystem\NooSphere.ActivitySystem.csproj">
+ <Project>{5CD6DD93-3EA1-425F-89D7-A80FD23BBC71}</Project>
+ <Name>NooSphere.ActivitySystem</Name>
+ </ProjectReference>
+ <ProjectReference Include="..\NooSphere.Core\NooSphere.Core.csproj">
+ <Project>{03C072A4-5960-4A5D-B0CC-98EBD854E970}</Project>
+ <Name>NooSphere.Core</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+ <Import Project="$(SolutionDir)\.nuget\nuget.targets" />
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
</Project>
View
5 NooSphere/ActivityTablet/Xaml/Tablet.xaml.cs
@@ -19,14 +19,11 @@
using NooSphere.ActivitySystem.Base;
using NooSphere.ActivitySystem.Base.Client;
using NooSphere.ActivitySystem.Base.Service;
-using NooSphere.ActivitySystem.Contracts.Service;
+using NooSphere.ActivitySystem.Helpers;
using NooSphere.ActivitySystem.Host;
-using NooSphere.Context.IO;
using NooSphere.Core.ActivityModel;
-using NooSphere.ActivitySystem.Contracts;
using Newtonsoft.Json;
using ActivityTablet.Properties;
-using NooSphere.Helpers;
using NooSphere.Core.Devices;
using NooSphere.ActivitySystem.Discovery;
View
5 NooSphere/NooSphere.ActivitySystem/Base/Client/ActivityClient.cs
@@ -11,17 +11,16 @@
****************************************************************************/
using System.Collections.Concurrent;
-using System.Globalization;
using System.IO;
using System.Net;
using System.ServiceModel;
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
+using NooSphere.ActivitySystem.Helpers;
using NooSphere.Core.ActivityModel;
using NooSphere.Core.Devices;
-using NooSphere.Helpers;
using Newtonsoft.Json;
using NooSphere.ActivitySystem.FileServer;
#if !ANDROID
@@ -391,7 +390,7 @@ public Activity GetActivity(string activityId)
/// Sends a "Send Message" request to the activity manager
/// </summary>
/// <param name="msg">The message that needs to be included in the request</param>
- public void SendMessage(string msg)
+ public void SendMessage(Message msg)
{
if (_connected)
View
0 ...tem/Contracts/Client/IActivityNetEvent.cs → ...tySystem/Base/Client/IActivityNetEvent.cs
File renamed without changes.
View
4 ...tySystem/Contracts/Client/IComNetEvent.cs → ...ctivitySystem/Base/Client/IComNetEvent.cs
@@ -13,14 +13,14 @@
using System.ServiceModel;
using System.ServiceModel.Web;
-namespace NooSphere.ActivitySystem.Contracts
+namespace NooSphere.ActivitySystem.Base.Client
{
[ServiceContract]
public interface IComNetEvent
{
[OperationContract]
[WebInvoke(RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json, UriTemplate = "MessageReceived", Method = "POST")]
- void MessageNetReceived(string msg);
+ void MessageNetReceived(Message msg);
}
public enum ComEvent
{
View
2 ...ystem/Contracts/Client/IDeviceNetEvent.cs → ...vitySystem/Base/Client/IDeviceNetEvent.cs
@@ -14,7 +14,7 @@
using NooSphere.Core.Devices;
using System.ServiceModel.Web;
-namespace NooSphere.ActivitySystem.Contracts
+namespace NooSphere.ActivitySystem.Base.Client
{
[ServiceContract]
public interface IDeviceNetEvent
View
2 ...ySystem/Contracts/Client/IFileNetEvent.cs → ...tivitySystem/Base/Client/IFileNetEvent.cs
@@ -14,7 +14,7 @@
using System.ServiceModel.Web;
using NooSphere.Core.ActivityModel;
-namespace NooSphere.ActivitySystem.Contracts
+namespace NooSphere.ActivitySystem.Base.Client
{
[ServiceContract]
public interface IFileNetEvent
View
4 ...stem/Contracts/Client/INetEventHandler.cs → ...itySystem/Base/Client/INetEventHandler.cs
@@ -1,6 +1,8 @@
using System.ServiceModel;
+using NooSphere.ActivitySystem.Contracts;
+using NooSphere.ActivitySystem.Contracts.Client;
-namespace NooSphere.ActivitySystem.Contracts.Client
+namespace NooSphere.ActivitySystem.Base.Client
{
[ServiceContract]
interface INetEventHandler : IServiceBase, IActivityNetEvent, IComNetEvent, IDeviceNetEvent, IFileNetEvent, IUserEvent
View
2 ...ySystem/Contracts/Client/IUserNetEvent.cs → ...tivitySystem/Base/Client/IUserNetEvent.cs
@@ -15,7 +15,7 @@
using System.ServiceModel.Web;
using NooSphere.Core.ActivityModel;
-namespace NooSphere.ActivitySystem.Contracts
+namespace NooSphere.ActivitySystem.Base.Client
{
[ServiceContract]
public interface IUserEvent
View
736 NooSphere/NooSphere.ActivitySystem/Base/Client/NetEventHandler.cs
@@ -1,368 +1,368 @@
-/****************************************************************************
- (c) 2012 Steven Houben(shou@itu.dk) and Søren Nielsen(snielsen@itu.dk)
-
- Pervasive Interaction Technology Laboratory (pIT lab)
- IT University of Copenhagen
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU GENERAL PUBLIC LICENSE V3 or later,
- as published by the Free Software Foundation. Check
- http://www.gnu.org/licenses/gpl.html for details.
-****************************************************************************/
-
-using System;
-using System.IO;
-using System.Net;
-using System.Threading;
-using NooSphere.Core.ActivityModel;
-using System.ServiceModel;
-using NooSphere.Core.Devices;
-using NooSphere.ActivitySystem.Contracts.Client;
-#if ANDROID
-using System.Text;
-using Newtonsoft.Json;
-using Newtonsoft.Json.Linq;
-using NooSphere.Helpers;
-
-#endif
-#if !ANDROID
-#endif
-
-namespace NooSphere.ActivitySystem.Base.Client
-{
- #if !ANDROID
- [ServiceBehavior(ConcurrencyMode = ConcurrencyMode.Single, InstanceContextMode = InstanceContextMode.Single,
- UseSynchronizationContext = false)]
-#endif
- public class NetEventHandler : INetEventHandler
- {
-#if ANDROID
- #region Private Members
- private readonly HttpListener _httpListener;
- private static readonly AutoResetEvent ListenForNextRequest = new AutoResetEvent(false);
- #endregion
-
- #region Protected Members
- protected string BaseUrl;
- #endregion
-
- #region Constructor
- public NetEventHandler()
- {
- BaseUrl = Net.GetUrl(Net.GetIp(IPType.All), Net.FindPort(), "").ToString();
- ServicePointManager.DefaultConnectionLimit = 100;
- _httpListener = new HttpListener();
- _httpListener.Prefixes.Add(BaseUrl);
-
- _httpListener.Start();
- ThreadPool.QueueUserWorkItem(Listen);
- }
- #endregion
-
- #region HttpHandlers
- private void Listen(object state)
- {
- while(_httpListener.IsListening)
- {
- _httpListener.BeginGetContext(HandleRequest, _httpListener);
- ListenForNextRequest.WaitOne();
- }
- }
- private void HandleRequest(IAsyncResult result)
- {
- var listener = result.AsyncState as HttpListener;
- HttpListenerContext context;
-
- if (listener == null) return;
-
- try
- {
- context = listener.EndGetContext(result);
- }
- catch (Exception ex)
- {
- System.Diagnostics.Debug.WriteLine(ex.ToString());
- return;
- }
- finally
- {
- ListenForNextRequest.Set();
- }
-
- if (context == null) return;
-
- var url = context.Request.RawUrl;
- var path = url.Split("/".ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
-
- switch (context.Request.HttpMethod)
- {
- case "POST":
- switch (path[0])
- {
- case "ActivityAdded":
- using (var streamReader = new StreamReader(context.Request.InputStream))
- ActivityNetAdded(JsonConvert.DeserializeObject<Activity>(streamReader.ReadToEnd()));
- Respond(context, 200, String.Empty);
- break;
- case "ActivityRemoved":
- using (var streamReader = new StreamReader(context.Request.InputStream))
- ActivityNetRemoved(JsonConvert.DeserializeObject<Guid>(streamReader.ReadToEnd()));
- Respond(context, 200, String.Empty);
- break;
- case "ActivityChanged":
- using (var streamReader = new StreamReader(context.Request.InputStream))
- ActivityNetAdded(JsonConvert.DeserializeObject<Activity>(streamReader.ReadToEnd()));
- Respond(context, 200, String.Empty);
- break;
- case "MessageReceived":
- using (var streamReader = new StreamReader(context.Request.InputStream))
- MessageNetReceived(JsonConvert.DeserializeObject<string[]>(streamReader.ReadToEnd())[0]);
- Respond(context, 200, String.Empty);
- break;
- case "DeviceAdded":
- using (var streamReader = new StreamReader(context.Request.InputStream))
- DeviceNetAdded(JsonConvert.DeserializeObject<Device>(streamReader.ReadToEnd()));
- Respond(context, 200, String.Empty);
- break;
- case "DeviceRemoved":
- using (var streamReader = new StreamReader(context.Request.InputStream))
- DeviceNetRemoved(JsonConvert.DeserializeObject<string>(streamReader.ReadToEnd()));
- Respond(context, 200, String.Empty);
- break;
- case "DeviceRoleChanged":
- using (var streamReader = new StreamReader(context.Request.InputStream))
- DeviceNetRoleChanged(JsonConvert.DeserializeObject<Device>(streamReader.ReadToEnd()));
- Respond(context, 200, String.Empty);
- break;
- case "FileDownloadRequest":
- using (var streamReader = new StreamReader(context.Request.InputStream))
- FileNetDownloadRequest(JsonConvert.DeserializeObject<Resource>(streamReader.ReadToEnd()));
- Respond(context, 200, String.Empty);
- break;
- case "FileDeleteRequest":
- using (var streamReader = new StreamReader(context.Request.InputStream))
- FileNetDeleteRequest(JsonConvert.DeserializeObject<Resource>(streamReader.ReadToEnd()));
- Respond(context, 200, String.Empty);
- break;
- case "FileUploadRequest":
- using (var streamReader = new StreamReader(context.Request.InputStream))
- FileNetUploadRequest(JsonConvert.DeserializeObject<Resource>(streamReader.ReadToEnd()));
- Respond(context, 200, String.Empty);
- break;
- case "FriendAdded":
- using (var streamReader = new StreamReader(context.Request.InputStream))
- FriendNetAdded(JsonConvert.DeserializeObject<User>(streamReader.ReadToEnd()));
- Respond(context, 200, String.Empty);
- break;
- case "FriendRequest":
- using (var streamReader = new StreamReader(context.Request.InputStream))
- FriendNetRequest(JsonConvert.DeserializeObject<User>(streamReader.ReadToEnd()));
- Respond(context, 200, String.Empty);
- break;
- case "FriendRemoved":
- using (var streamReader = new StreamReader(context.Request.InputStream))
- FriendNetRemoved(JsonConvert.DeserializeObject<Guid>(streamReader.ReadToEnd()));
- Respond(context, 200, String.Empty);
- break;
- case "ParticipantAdded":
- using (var streamReader = new StreamReader(context.Request.InputStream))
- {
- var obj = JObject.Parse(streamReader.ReadToEnd());
- ParticipantNetAdded(JsonConvert.DeserializeObject<User>(obj["u"].ToString()),
- JsonConvert.DeserializeObject<Guid>(obj["activityId"].ToString()));
- }
- Respond(context, 200, String.Empty);
- break;
- case "ParticipantRemoved":
- using (var streamReader = new StreamReader(context.Request.InputStream))
- {
- var obj = JObject.Parse(streamReader.ReadToEnd());
- ParticipantNetRemoved(JsonConvert.DeserializeObject<User>(obj["u"].ToString()),
- JsonConvert.DeserializeObject<Guid>(obj["activityId"].ToString()));
- }
- Respond(context, 200, String.Empty);
- break;
- }
- break;
- case "GET":
- if (path.Length == 0)
- Respond(context, 200, "true");
- else
- HandleBadRequest(context);
- break;
- default:
- HandleBadRequest(context);
- break;
- }
- }
-
- private void HandleBadRequest(HttpListenerContext context)
- {
- Respond(context, 400, "Bad request.");
- }
-
- private void Respond(HttpListenerContext context, int statusCode, string content)
- {
- context.Response.StatusCode = statusCode;
-
- var buffer = Encoding.UTF8.GetBytes(content);
- context.Response.ContentLength64 = buffer.Length;
- context.Response.OutputStream.Write(buffer, 0, buffer.Length);
- context.Response.OutputStream.Close();
- context.Response.Close();
- }
- #endregion
- #endif
-
- #region Events
-
- public event ActivityAddedHandler ActivityAdded;
- public event ActivityRemovedHandler ActivityRemoved;
- public event ActivityChangedHandler ActivityChanged;
- public event ActivitySwitchedHandler ActivitySwitched = null;
-
- public event DeviceAddedHandler DeviceAdded;
- public event DeviceRemovedHandler DeviceRemoved;
- public event DeviceRoleChangedHandler DeviceRoleChanged;
-
- public event MessageReceivedHandler MessageReceived;
-
- protected event FileDownloadRequestHandler FileDownloadRequest;
- protected event FileUploadRequestHandler FileUploadRequest;
- protected event FileDeleteRequestHandler FileDeleteRequest;
-
- public event FriendAddedHandler FriendAdded;
- public event FriendDeletedHandler FriendDeleted;
- public event FriendRequestReceivedHandler FriendRequestReceived;
-
- public event ParticipantAddedHandler ParticipantAdded;
- public event ParticipantRemovedHandler ParticipantRemoved;
-
- public event EventHandler UserOnline;
- public event EventHandler UserOffline;
-
- public event ServiceDownHandler ServiceIsDown;
- #endregion
-
- #region Net Event handlers
-
- public virtual void ActivityNetSwitched(Activity act)
- {
- if (ActivitySwitched != null)
- ActivitySwitched(this, new ActivityEventArgs(act));
- }
- protected virtual void OnUserOffline(EventArgs e)
- {
- if (UserOffline != null)
- UserOffline(this, e);
- }
-
- protected virtual void OnUserOnline(EventArgs e)
- {
- if (UserOnline != null)
- UserOnline(this, e);
- }
-
- public virtual void ActivityNetAdded(Activity act)
- {
- if (ActivityAdded != null)
- ActivityAdded(this, new ActivityEventArgs(act));
- }
-
- public virtual void ActivityNetRemoved(Guid id)
- {
- if (ActivityRemoved != null)
- ActivityRemoved(this, new ActivityRemovedEventArgs(id));
- }
-
- public virtual void ActivityNetChanged(Activity act)
- {
- if (ActivityChanged != null)
- ActivityChanged(this, new ActivityEventArgs(act));
- }
-
- public virtual void MessageNetReceived(string msg)
- {
- if (MessageReceived != null)
- MessageReceived(this, new ComEventArgs(msg));
- }
-
- public virtual void FileNetDownloadRequest(Resource r)
- {
- if (FileDownloadRequest != null)
- FileDownloadRequest(this, new FileEventArgs(r));
- }
-
- public virtual void FileNetDeleteRequest(Resource r)
- {
- if (FileDeleteRequest != null)
- FileDeleteRequest(this, new FileEventArgs(r));
- }
-
- public virtual void FileNetUploadRequest(Resource r)
- {
- if (FileUploadRequest != null)
- FileUploadRequest(this, new FileEventArgs(r));
- }
-
- public virtual void DeviceNetAdded(Device dev)
- {
- if (DeviceAdded != null)
- DeviceAdded(this, new DeviceEventArgs(dev));
- }
-
- public virtual void DeviceNetRemoved(string id)
- {
- if (DeviceRemoved != null)
- DeviceRemoved(this, new DeviceRemovedEventArgs(id));
- }
-
- public virtual void DeviceNetRoleChanged(Core.Devices.Device dev)
- {
- if (DeviceRoleChanged != null)
- DeviceRoleChanged(this, new DeviceEventArgs(dev));
- }
-
- public virtual void FriendNetAdded(User u)
- {
- if (FriendAdded != null)
- FriendAdded(this, new FriendEventArgs(u));
- }
-
- public virtual void FriendNetRequest(User u)
- {
- if (FriendRequestReceived != null)
- FriendRequestReceived(this, new FriendEventArgs(u));
- }
-
- public virtual void FriendNetRemoved(Guid i)
- {
- if (FriendDeleted != null)
- FriendDeleted(this, new FriendDeletedEventArgs(i));
- }
-
- public virtual void ParticipantNetAdded(User u, Guid activityId)
- {
- if (ParticipantAdded != null)
- ParticipantAdded(this, new ParticipantEventArgs(u, activityId));
- }
-
- public virtual void ParticipantNetRemoved(User u, Guid activityId)
- {
- if (ParticipantRemoved != null)
- ParticipantRemoved(this, new ParticipantEventArgs(u, activityId));
- }
-
- public virtual void ServiceDown()
- {
- if(ServiceIsDown!=null)
- ServiceIsDown(this,new EventArgs());
- }
-
- public bool Alive()
- {
- return true;
- }
- #endregion
- }
-}
+/****************************************************************************
+ (c) 2012 Steven Houben(shou@itu.dk) and Søren Nielsen(snielsen@itu.dk)
+
+ Pervasive Interaction Technology Laboratory (pIT lab)
+ IT University of Copenhagen
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU GENERAL PUBLIC LICENSE V3 or later,
+ as published by the Free Software Foundation. Check
+ http://www.gnu.org/licenses/gpl.html for details.
+****************************************************************************/
+
+using System;
+using System.IO;
+using System.Net;
+using System.Threading;
+using NooSphere.Core.ActivityModel;
+using System.ServiceModel;
+using NooSphere.Core.Devices;
+using NooSphere.ActivitySystem.Contracts.Client;
+#if ANDROID
+using System.Text;
+using Newtonsoft.Json;
+using Newtonsoft.Json.Linq;
+using NooSphere.Helpers;
+
+#endif
+#if !ANDROID
+#endif
+
+namespace NooSphere.ActivitySystem.Base.Client
+{
+ #if !ANDROID
+ [ServiceBehavior(ConcurrencyMode = ConcurrencyMode.Single, InstanceContextMode = InstanceContextMode.Single,
+ UseSynchronizationContext = false)]
+#endif
+ public class NetEventHandler : INetEventHandler
+ {
+#if ANDROID
+ #region Private Members
+ private readonly HttpListener _httpListener;
+ private static readonly AutoResetEvent ListenForNextRequest = new AutoResetEvent(false);
+ #endregion
+
+ #region Protected Members
+ protected string BaseUrl;
+ #endregion
+
+ #region Constructor
+ public NetEventHandler()
+ {
+ BaseUrl = Net.GetUrl(Net.GetIp(IPType.All), Net.FindPort(), "").ToString();
+ ServicePointManager.DefaultConnectionLimit = 100;
+ _httpListener = new HttpListener();
+ _httpListener.Prefixes.Add(BaseUrl);
+
+ _httpListener.Start();
+ ThreadPool.QueueUserWorkItem(Listen);
+ }
+ #endregion
+
+ #region HttpHandlers
+ private void Listen(object state)
+ {
+ while(_httpListener.IsListening)
+ {
+ _httpListener.BeginGetContext(HandleRequest, _httpListener);
+ ListenForNextRequest.WaitOne();
+ }
+ }
+ private void HandleRequest(IAsyncResult result)
+ {
+ var listener = result.AsyncState as HttpListener;
+ HttpListenerContext context;
+
+ if (listener == null) return;
+
+ try
+ {
+ context = listener.EndGetContext(result);
+ }
+ catch (Exception ex)
+ {
+ System.Diagnostics.Debug.WriteLine(ex.ToString());
+ return;
+ }
+ finally
+ {
+ ListenForNextRequest.Set();
+ }
+
+ if (context == null) return;
+
+ var url = context.Request.RawUrl;
+ var path = url.Split("/".ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
+
+ switch (context.Request.HttpMethod)
+ {
+ case "POST":
+ switch (path[0])
+ {
+ case "ActivityAdded":
+ using (var streamReader = new StreamReader(context.Request.InputStream))
+ ActivityNetAdded(JsonConvert.DeserializeObject<Activity>(streamReader.ReadToEnd()));
+ Respond(context, 200, String.Empty);
+ break;
+ case "ActivityRemoved":
+ using (var streamReader = new StreamReader(context.Request.InputStream))
+ ActivityNetRemoved(JsonConvert.DeserializeObject<Guid>(streamReader.ReadToEnd()));
+ Respond(context, 200, String.Empty);
+ break;
+ case "ActivityChanged":
+ using (var streamReader = new StreamReader(context.Request.InputStream))
+ ActivityNetAdded(JsonConvert.DeserializeObject<Activity>(streamReader.ReadToEnd()));
+ Respond(context, 200, String.Empty);
+ break;
+ case "MessageReceived":
+ using (var streamReader = new StreamReader(context.Request.InputStream))
+ MessageNetReceived(JsonConvert.DeserializeObject<string[]>(streamReader.ReadToEnd())[0]);
+ Respond(context, 200, String.Empty);
+ break;
+ case "DeviceAdded":
+ using (var streamReader = new StreamReader(context.Request.InputStream))
+ DeviceNetAdded(JsonConvert.DeserializeObject<Device>(streamReader.ReadToEnd()));
+ Respond(context, 200, String.Empty);
+ break;
+ case "DeviceRemoved":
+ using (var streamReader = new StreamReader(context.Request.InputStream))
+ DeviceNetRemoved(JsonConvert.DeserializeObject<string>(streamReader.ReadToEnd()));
+ Respond(context, 200, String.Empty);
+ break;
+ case "DeviceRoleChanged":
+ using (var streamReader = new StreamReader(context.Request.InputStream))
+ DeviceNetRoleChanged(JsonConvert.DeserializeObject<Device>(streamReader.ReadToEnd()));
+ Respond(context, 200, String.Empty);
+ break;
+ case "FileDownloadRequest":
+ using (var streamReader = new StreamReader(context.Request.InputStream))
+ FileNetDownloadRequest(JsonConvert.DeserializeObject<Resource>(streamReader.ReadToEnd()));
+ Respond(context, 200, String.Empty);
+ break;
+ case "FileDeleteRequest":
+ using (var streamReader = new StreamReader(context.Request.InputStream))
+ FileNetDeleteRequest(JsonConvert.DeserializeObject<Resource>(streamReader.ReadToEnd()));
+ Respond(context, 200, String.Empty);
+ break;
+ case "FileUploadRequest":
+ using (var streamReader = new StreamReader(context.Request.InputStream))
+ FileNetUploadRequest(JsonConvert.DeserializeObject<Resource>(streamReader.ReadToEnd()));
+ Respond(context, 200, String.Empty);
+ break;
+ case "FriendAdded":
+ using (var streamReader = new StreamReader(context.Request.InputStream))
+ FriendNetAdded(JsonConvert.DeserializeObject<User>(streamReader.ReadToEnd()));
+ Respond(context, 200, String.Empty);
+ break;
+ case "FriendRequest":
+ using (var streamReader = new StreamReader(context.Request.InputStream))
+ FriendNetRequest(JsonConvert.DeserializeObject<User>(streamReader.ReadToEnd()));
+ Respond(context, 200, String.Empty);
+ break;
+ case "FriendRemoved":
+ using (var streamReader = new StreamReader(context.Request.InputStream))
+ FriendNetRemoved(JsonConvert.DeserializeObject<Guid>(streamReader.ReadToEnd()));
+ Respond(context, 200, String.Empty);
+ break;
+ case "ParticipantAdded":
+ using (var streamReader = new StreamReader(context.Request.InputStream))
+ {
+ var obj = JObject.Parse(streamReader.ReadToEnd());
+ ParticipantNetAdded(JsonConvert.DeserializeObject<User>(obj["u"].ToString()),
+ JsonConvert.DeserializeObject<Guid>(obj["activityId"].ToString()));
+ }
+ Respond(context, 200, String.Empty);
+ break;
+ case "ParticipantRemoved":
+ using (var streamReader = new StreamReader(context.Request.InputStream))
+ {
+ var obj = JObject.Parse(streamReader.ReadToEnd());
+ ParticipantNetRemoved(JsonConvert.DeserializeObject<User>(obj["u"].ToString()),
+ JsonConvert.DeserializeObject<Guid>(obj["activityId"].ToString()));
+ }
+ Respond(context, 200, String.Empty);
+ break;
+ }
+ break;
+ case "GET":
+ if (path.Length == 0)
+ Respond(context, 200, "true");
+ else
+ HandleBadRequest(context);
+ break;
+ default:
+ HandleBadRequest(context);
+ break;
+ }
+ }
+
+ private void HandleBadRequest(HttpListenerContext context)
+ {
+ Respond(context, 400, "Bad request.");
+ }
+
+ private void Respond(HttpListenerContext context, int statusCode, string content)
+ {
+ context.Response.StatusCode = statusCode;
+
+ var buffer = Encoding.UTF8.GetBytes(content);
+ context.Response.ContentLength64 = buffer.Length;
+ context.Response.OutputStream.Write(buffer, 0, buffer.Length);
+ context.Response.OutputStream.Close();
+ context.Response.Close();
+ }
+ #endregion
+ #endif
+
+ #region Events
+
+ public event ActivityAddedHandler ActivityAdded;
+ public event ActivityRemovedHandler ActivityRemoved;
+ public event ActivityChangedHandler ActivityChanged;
+ public event ActivitySwitchedHandler ActivitySwitched = null;
+
+ public event DeviceAddedHandler DeviceAdded;
+ public event DeviceRemovedHandler DeviceRemoved;
+ public event DeviceRoleChangedHandler DeviceRoleChanged;
+
+ public event MessageReceivedHandler MessageReceived;
+
+ protected event FileDownloadRequestHandler FileDownloadRequest;
+ protected event FileUploadRequestHandler FileUploadRequest;
+ protected event FileDeleteRequestHandler FileDeleteRequest;
+
+ public event FriendAddedHandler FriendAdded;
+ public event FriendDeletedHandler FriendDeleted;
+ public event FriendRequestReceivedHandler FriendRequestReceived;
+
+ public event ParticipantAddedHandler ParticipantAdded;
+ public event ParticipantRemovedHandler ParticipantRemoved;
+
+ public event EventHandler UserOnline;
+ public event EventHandler UserOffline;
+
+ public event ServiceDownHandler ServiceIsDown;
+ #endregion
+
+ #region Net Event handlers
+
+ public virtual void ActivityNetSwitched(Activity act)
+ {
+ if (ActivitySwitched != null)
+ ActivitySwitched(this, new ActivityEventArgs(act));
+ }
+ protected virtual void OnUserOffline(EventArgs e)
+ {
+ if (UserOffline != null)
+ UserOffline(this, e);
+ }
+
+ protected virtual void OnUserOnline(EventArgs e)
+ {
+ if (UserOnline != null)
+ UserOnline(this, e);
+ }
+
+ public virtual void ActivityNetAdded(Activity act)
+ {
+ if (ActivityAdded != null)
+ ActivityAdded(this, new ActivityEventArgs(act));
+ }
+
+ public virtual void ActivityNetRemoved(Guid id)
+ {
+ if (ActivityRemoved != null)
+ ActivityRemoved(this, new ActivityRemovedEventArgs(id));
+ }
+
+ public virtual void ActivityNetChanged(Activity act)
+ {
+ if (ActivityChanged != null)
+ ActivityChanged(this, new ActivityEventArgs(act));
+ }
+
+ public virtual void MessageNetReceived(Message msg)
+ {
+ if (MessageReceived != null)
+ MessageReceived(this, new ComEventArgs(msg));
+ }
+
+ public virtual void FileNetDownloadRequest(Resource r)
+ {
+ if (FileDownloadRequest != null)
+ FileDownloadRequest(this, new FileEventArgs(r));
+ }
+
+ public virtual void FileNetDeleteRequest(Resource r)
+ {
+ if (FileDeleteRequest != null)
+ FileDeleteRequest(this, new FileEventArgs(r));
+ }
+
+ public virtual void FileNetUploadRequest(Resource r)
+ {
+ if (FileUploadRequest != null)
+ FileUploadRequest(this, new FileEventArgs(r));
+ }
+
+ public virtual void DeviceNetAdded(Device dev)
+ {
+ if (DeviceAdded != null)
+ DeviceAdded(this, new DeviceEventArgs(dev));
+ }
+
+ public virtual void DeviceNetRemoved(string id)
+ {
+ if (DeviceRemoved != null)
+ DeviceRemoved(this, new DeviceRemovedEventArgs(id));
+ }
+
+ public virtual void DeviceNetRoleChanged(Core.Devices.Device dev)
+ {
+ if (DeviceRoleChanged != null)
+ DeviceRoleChanged(this, new DeviceEventArgs(dev));
+ }
+
+ public virtual void FriendNetAdded(User u)
+ {
+ if (FriendAdded != null)
+ FriendAdded(this, new FriendEventArgs(u));
+ }
+
+ public virtual void FriendNetRequest(User u)
+ {
+ if (FriendRequestReceived != null)
+ FriendRequestReceived(this, new FriendEventArgs(u));
+ }
+
+ public virtual void FriendNetRemoved(Guid i)
+ {
+ if (FriendDeleted != null)
+ FriendDeleted(this, new FriendDeletedEventArgs(i));
+ }
+
+ public virtual void ParticipantNetAdded(User u, Guid activityId)
+ {
+ if (ParticipantAdded != null)
+ ParticipantAdded(this, new ParticipantEventArgs(u, activityId));
+ }
+
+ public virtual void ParticipantNetRemoved(User u, Guid activityId)
+ {
+ if (ParticipantRemoved != null)
+ ParticipantRemoved(this, new ParticipantEventArgs(u, activityId));
+ }
+
+ public virtual void ServiceDown()
+ {
+ if(ServiceIsDown!=null)
+ ServiceIsDown(this,new EventArgs());
+ }
+
+ public bool Alive()
+ {
+ return true;
+ }
+ #endregion
+ }
+}
View
4 NooSphere/NooSphere.ActivitySystem/Base/ComEventArgs.cs
@@ -14,9 +14,9 @@ namespace NooSphere.ActivitySystem.Base
{
public class ComEventArgs
{
- public string Message { get; set; }
+ public Message Message { get; set; }
public ComEventArgs() { }
- public ComEventArgs(string message)
+ public ComEventArgs(Message message)
{
Message = message;
}
View
2 ...ere.ActivitySystem/Contracts/EventType.cs → ...ooSphere.ActivitySystem/Base/EventType.cs
@@ -10,7 +10,7 @@
http://www.gnu.org/licenses/gpl.html for details.
****************************************************************************/
-namespace NooSphere.ActivitySystem.Contracts
+namespace NooSphere.ActivitySystem.Base
{
public enum EventType
{
View
1 NooSphere/NooSphere.ActivitySystem/Base/EventTypeConverter.cs
@@ -11,6 +11,7 @@
****************************************************************************/
using System;
+using NooSphere.ActivitySystem.Base.Client;
using NooSphere.ActivitySystem.Contracts;
using NooSphere.ActivitySystem.Contracts.Client;
View
7 NooSphere/NooSphere.ActivitySystem/Base/Heartbeat.cs
@@ -1,7 +0,0 @@
-
-namespace NooSphere.ActivitySystem.Base
-{
- public class Heartbeat
- {
- }
-}
View
2 ....ActivitySystem/Contracts/IServiceBase.cs → ...phere.ActivitySystem/Base/IServiceBase.cs
@@ -1,7 +1,7 @@
using System.ServiceModel;
using System.ServiceModel.Web;
-namespace NooSphere.ActivitySystem.Contracts
+namespace NooSphere.ActivitySystem.Base
{
[ServiceContract]
public interface IServiceBase
View
10 ...tivitySystem/Base/Client/Configuration.cs → .../NooSphere.ActivitySystem/Base/Message.cs
@@ -12,11 +12,11 @@
namespace NooSphere.ActivitySystem.Base
{
- public enum Configuration
+ public class Message
{
- Client, //Run the client only
- Host, //Run the host only
- ClientAndHost, //Run both client and host
- ClientAndManager //Run both client and local manager
+ public string Header { get; set; }
+ public string From { get; set; }
+ public string To { get; set; }
+ public string Content { get; set; }
}
}
View
5 NooSphere/NooSphere.ActivitySystem/Base/Service/ActivityCloudConnector.cs
@@ -22,14 +22,13 @@
using System.Threading;
using System.Threading.Tasks;
using System.Web;
-
+using NooSphere.ActivitySystem.Helpers;
using SignalR.Client;
using Newtonsoft.Json.Linq;
using Newtonsoft.Json;
using NooSphere.Core.ActivityModel;
-using NooSphere.Helpers;
namespace NooSphere.ActivitySystem.Base
{
@@ -278,7 +277,7 @@ private void SignalRecieved(string obj)
if (MessageReceived != null)
MessageReceived(this,
new ComEventArgs(
- JsonConvert.DeserializeObject<String>(data.ToString())));
+ JsonConvert.DeserializeObject<Message>(data.ToString())));
break;
case "ParticipantAdded":
if (ParticipantAdded != null)
View
10 NooSphere/NooSphere.ActivitySystem/Base/Service/ActivityManager.cs
@@ -14,17 +14,15 @@
using System.Collections.Generic;
using System.Linq;
using System.ServiceModel;
-using System.Threading;
using System.IO;
using Newtonsoft.Json;
+using NooSphere.ActivitySystem.Base.Client;
using NooSphere.ActivitySystem.Contracts.Client;
-using NooSphere.ActivitySystem.Contracts.Service;
+using NooSphere.ActivitySystem.Helpers;
using NooSphere.Core.ActivityModel;
using NooSphere.Core.Devices;
-using NooSphere.ActivitySystem.Contracts;
using NooSphere.ActivitySystem.PubSub;
using NooSphere.ActivitySystem.FileServer;
-using NooSphere.Helpers;
using System.Threading.Tasks;
namespace NooSphere.ActivitySystem.Base.Service
@@ -614,9 +612,9 @@ public void SwitchActivity(string id, string deviceId)
#endregion
#region Messenger
- public void SendMessage( string message,string deviceId)
+ public void SendMessage(Message message,string deviceId)
{
- _publisher.Publish( ComEvent.MessageReceived.ToString(), message);
+ _publisher.Publish(ComEvent.MessageReceived.ToString(), message);
}
#endregion
}
View
3 ...tem/Contracts/Service/IActivityManager.cs → ...tySystem/Base/Service/IActivityManager.cs
@@ -13,11 +13,12 @@
using System;
using System.Collections.Generic;
using System.ServiceModel;
+using NooSphere.ActivitySystem.Contracts;
using NooSphere.Core.ActivityModel;
using NooSphere.Core.Devices;
using System.ServiceModel.Web;
-namespace NooSphere.ActivitySystem.Contracts.Service
+namespace NooSphere.ActivitySystem.Base.Service
{
[ServiceContract]
public interface IActivityManager :IServiceBase, IMessenger,IFileServer
View
3 ...tySystem/Contracts/Service/IFileServer.cs → ...ctivitySystem/Base/Service/IFileServer.cs
@@ -10,14 +10,13 @@
http://www.gnu.org/licenses/gpl.html for details.
****************************************************************************/
-using System.Collections.Generic;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.IO;
using NooSphere.Core.ActivityModel;
using NooSphere.ActivitySystem.FileServer;
-namespace NooSphere.ActivitySystem.Contracts
+namespace NooSphere.ActivitySystem.Base.Service
{
[ServiceContract]
public interface IFileServer
View
4 ...itySystem/Contracts/Service/IMessenger.cs → ...ActivitySystem/Base/Service/IMessenger.cs
@@ -13,13 +13,13 @@
using System.ServiceModel;
using System.ServiceModel.Web;
-namespace NooSphere.ActivitySystem.Contracts
+namespace NooSphere.ActivitySystem.Base.Service
{
[ServiceContract]
public interface IMessenger
{
[OperationContract]
[WebInvoke(BodyStyle = WebMessageBodyStyle.WrappedRequest,RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json, UriTemplate = "messages", Method = "POST")]
- void SendMessage(string message,string deviceId);
+ void SendMessage(Message message,string deviceId);
}
}
View
100 NooSphere/NooSphere.ActivitySystem/Context/ContextMonitor.cs
@@ -0,0 +1,100 @@
+/****************************************************************************
+ (c) 2012 Steven Houben(shou@itu.dk) and Søren Nielsen(snielsen@itu.dk)
+
+ Pervasive Interaction Technology Laboratory (pIT lab)
+ IT University of Copenhagen
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU GENERAL PUBLIC LICENSE V3 or later,
+ as published by the Free Software Foundation. Check
+ http://www.gnu.org/licenses/gpl.html for details.
+****************************************************************************/
+
+using System;
+using System.Collections.Generic;
+using System.Threading;
+using System.Threading.Tasks;
+
+namespace NooSphere.ActivitySystem.Context
+{
+ public class ContextMonitor
+ {
+ #region Properties
+ public Dictionary<Guid,IContextService> Services { get; set; }
+ public List<Task> Tasks { get; set; }
+ public bool Running { get; set; }
+ #endregion
+
+ #region Private Members
+ private readonly CancellationTokenSource _cancellation = new CancellationTokenSource();
+ #endregion
+
+ #region Events
+ public event DataReceivedHandler DataReceived = null;
+ public event EventHandler Started = null;
+ public event EventHandler Stopped = null;
+ #endregion
+
+ #region Constructor
+ public ContextMonitor(Dictionary<Guid,IContextService> services =null)
+ {
+ if (services == null)
+ Services = new Dictionary<Guid, IContextService>();
+ else
+ Services = services;
+
+ Running = false;
+ }
+ public void Start()
+ {
+ Tasks = new List<Task>(Services.Count);
+ foreach (var contextService in Services.Values)
+ {
+ var service = contextService;
+ Tasks.Add(StartService(service));
+ }
+ if(Started !=null)
+ Started(this, new EventArgs());
+ }
+
+ private Task StartService(IContextService service)
+ {
</