Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

testing contextmonitor

  • Loading branch information...
commit feaa02f4a374aeb67f12fac972fa989947db3e71 1 parent de8f72a
Steven Houben authored
View
483 NooSphere/ActivityBar/ActivityUI.csproj
@@ -1,242 +1,243 @@
-<?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)' == '' ">x86</Platform>
- <ProductVersion>8.0.30703</ProductVersion>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{B885C84D-D2C7-4B1A-8167-2D6544AF99E3}</ProjectGuid>
- <OutputType>WinExe</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>ActivityUI</RootNamespace>
- <AssemblyName>ActivityUI</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>
- <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|x86' ">
- <PlatformTarget>x86</PlatformTarget>
- <DebugSymbols>true</DebugSymbols>
- <DebugType>full</DebugType>
- <Optimize>false</Optimize>
- <OutputPath>bin\Debug\</OutputPath>
- <DefineConstants>DEBUG;TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
- <PlatformTarget>x86</PlatformTarget>
- <DebugType>pdbonly</DebugType>
- <Optimize>true</Optimize>
- <OutputPath>bin\Release\</OutputPath>
- <DefineConstants>TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- </PropertyGroup>
- <ItemGroup>
- <Reference Include="Mono.Zeroconf, Version=4.0.0.90, Culture=neutral, PublicKeyToken=e60c4f4a95e1099e, processorArchitecture=MSIL">
- <HintPath>..\packages\Mono.Zeroconf.0.9.0.0\lib\Net20\Mono.Zeroconf.dll</HintPath>
- </Reference>
- <Reference Include="Mono.Zeroconf.Providers.Bonjour">
- <HintPath>..\packages\Mono.Zeroconf.0.9.0.0\lib\Net20\Mono.Zeroconf.Providers.Bonjour.dll</HintPath>
- </Reference>
- <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="PresentationFramework.Aero" />
- <Reference Include="System" />
- <Reference Include="System.Data" />
- <Reference Include="System.Drawing" />
- <Reference Include="System.Runtime.Serialization" />
- <Reference Include="System.ServiceModel" />
- <Reference Include="System.ServiceModel.Activation" />
- <Reference Include="System.ServiceModel.Web" />
- <Reference Include="System.Web" />
- <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="WindowsBase" />
- <Reference Include="PresentationCore" />
- <Reference Include="PresentationFramework" />
- <Reference Include="WindowsFormsIntegration" />
- </ItemGroup>
- <ItemGroup>
- <ApplicationDefinition Include="Xaml\App.xaml">
- <Generator>MSBuild:Compile</Generator>
- <SubType>Designer</SubType>
- </ApplicationDefinition>
- <Compile Include="Activity\Proxy.cs" />
- <Compile Include="Settings.cs" />
- <Compile Include="Xaml\ActivityButton.cs" />
- <Compile Include="Xaml\IconToAvgColorBrushConverter.cs" />
- <Compile Include="StartupMode.cs" />
- <Compile Include="Xaml\PopUp\ActivityWindow.xaml.cs">
- <DependentUpon>ActivityWindow.xaml</DependentUpon>
- </Compile>
- <Compile Include="Xaml\PopUp\DeviceWindow.xaml.cs">
- <DependentUpon>DeviceWindow.xaml</DependentUpon>
- </Compile>
- <Compile Include="Xaml\PopUp\ManagerWindow.xaml.cs">
- <DependentUpon>ManagerWindow.xaml</DependentUpon>
- </Compile>
- <Compile Include="Xaml\PopUp\StartMenu.xaml.cs">
- <DependentUpon>StartMenu.xaml</DependentUpon>
- </Compile>
- <Compile Include="Xaml\Win7ColorTracking.cs" />
- <Page Include="Styles\Dark.xaml">
- <SubType>Designer</SubType>
- <Generator>MSBuild:Compile</Generator>
- </Page>
- <Page Include="Xaml\ActivityBar.xaml">
- <SubType>Designer</SubType>
- <Generator>MSBuild:Compile</Generator>
- </Page>
- <Compile Include="Xaml\ActivityBar.xaml.cs">
- <DependentUpon>ActivityBar.xaml</DependentUpon>
- </Compile>
- <Compile Include="Xaml\App.xaml.cs">
- <DependentUpon>App.xaml</DependentUpon>
- <SubType>Code</SubType>
- </Compile>
- <Page Include="Xaml\Login\LoginWindow.xaml">
- <SubType>Designer</SubType>
- <Generator>MSBuild:Compile</Generator>
- </Page>
- <Page Include="Styles\GlassButton.xaml">
- <SubType>Designer</SubType>
- <Generator>MSBuild:Compile</Generator>
- </Page>
- <Page Include="Styles\ColoredButtons.xaml">
- <SubType>Designer</SubType>
- <Generator>MSBuild:Compile</Generator>
- </Page>
- <Page Include="Xaml\PopUp\ActivityWindow.xaml">
- <SubType>Designer</SubType>
- <Generator>MSBuild:Compile</Generator>
- </Page>
- <Page Include="Xaml\PopUp\DeviceWindow.xaml">
- <Generator>MSBuild:Compile</Generator>
- <SubType>Designer</SubType>
- </Page>
- <Page Include="Xaml\PopUp\ManagerWindow.xaml">
- <SubType>Designer</SubType>
- <Generator>MSBuild:Compile</Generator>
- </Page>
- <Page Include="Xaml\PopUp\StartMenu.xaml">
- <Generator>MSBuild:Compile</Generator>
- <SubType>Designer</SubType>
- </Page>
- <Page Include="Xaml\Simple Styles.xaml">
- <Generator>MSBuild:Compile</Generator>
- <SubType>Designer</SubType>
- </Page>
- </ItemGroup>
- <ItemGroup>
- <Compile Include="Xaml\Login\LoginWindow.xaml.cs">
- <DependentUpon>LoginWindow.xaml</DependentUpon>
- </Compile>
- <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="packages.config" />
- <None Include="Properties\Settings.settings">
- <Generator>SettingsSingleFileGenerator</Generator>
- <LastGenOutput>Settings.Designer.cs</LastGenOutput>
- </None>
- <AppDesigner Include="Properties\" />
- </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.Platform.Windows\NooSphere.Platform.Windows.csproj">
- <Project>{B3333919-EE66-441A-8AB3-6E6601A8A0B1}</Project>
- <Name>NooSphere.Platform.Windows</Name>
- </ProjectReference>
- </ItemGroup>
- <ItemGroup>
- <Resource Include="Images\add.png" />
- <Resource Include="Xaml\computer.png" />
- <Resource Include="Xaml\image.png" />
- <Resource Include="Xaml\phone.png" />
- <Resource Include="Xaml\PopUp\DefaultUser.png" />
- <Resource Include="Xaml\PopUp\frame.png" />
- <Resource Include="Xaml\PopUp\wrench.png" />
- </ItemGroup>
- <ItemGroup>
- <Resource Include="Images\house.png" />
- </ItemGroup>
- <ItemGroup>
- <Resource Include="Images\application_view_tile.png" />
- </ItemGroup>
- <ItemGroup>
- <Resource Include="Images\cross.png" />
- </ItemGroup>
- <ItemGroup>
- <Resource Include="Images\activity.PNG" />
- </ItemGroup>
- <ItemGroup>
- <Resource Include="Images\activity1.PNG" />
- </ItemGroup>
- <ItemGroup>
- <Resource Include="Images\application_xp_terminal.png" />
- <Resource Include="Images\arrow_undo.png" />
- <Resource Include="Images\brick.png" />
- <Resource Include="Images\brick_go.png" />
- <Resource Include="Images\disk.png" />
- <Resource Include="Images\door_out.png" />
- <Resource Include="Images\lightbulb.png" />
- <Resource Include="Images\package.png" />
- <Resource Include="Images\wrench.png" />
- </ItemGroup>
- <ItemGroup>
- <Resource Include="Images\logo.PNG" />
- </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)' == '' ">x86</Platform>
+ <ProductVersion>8.0.30703</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{B885C84D-D2C7-4B1A-8167-2D6544AF99E3}</ProjectGuid>
+ <OutputType>WinExe</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>ActivityUI</RootNamespace>
+ <AssemblyName>ActivityUI</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>
+ <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|x86' ">
+ <PlatformTarget>x86</PlatformTarget>
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\Debug\</OutputPath>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
+ <PlatformTarget>x86</PlatformTarget>
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>bin\Release\</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="Mono.Zeroconf, Version=4.0.0.90, Culture=neutral, PublicKeyToken=e60c4f4a95e1099e, processorArchitecture=MSIL">
+ <HintPath>..\packages\Mono.Zeroconf.0.9.0.0\lib\Net20\Mono.Zeroconf.dll</HintPath>
+ </Reference>
+ <Reference Include="Mono.Zeroconf.Providers.Bonjour">
+ <HintPath>..\packages\Mono.Zeroconf.0.9.0.0\lib\Net20\Mono.Zeroconf.Providers.Bonjour.dll</HintPath>
+ </Reference>
+ <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="PresentationFramework.Aero" />
+ <Reference Include="System" />
+ <Reference Include="System.Data" />
+ <Reference Include="System.Drawing" />
+ <Reference Include="System.Runtime.Serialization" />
+ <Reference Include="System.ServiceModel" />
+ <Reference Include="System.ServiceModel.Activation" />
+ <Reference Include="System.ServiceModel.Web" />
+ <Reference Include="System.Web" />
+ <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="WindowsBase" />
+ <Reference Include="PresentationCore" />
+ <Reference Include="PresentationFramework" />
+ <Reference Include="WindowsFormsIntegration" />
+ </ItemGroup>
+ <ItemGroup>
+ <ApplicationDefinition Include="Xaml\App.xaml">
+ <Generator>MSBuild:Compile</Generator>
+ <SubType>Designer</SubType>
+ </ApplicationDefinition>
+ <Compile Include="Activity\Proxy.cs" />
+ <Compile Include="Context\InputRedirect.cs" />
+ <Compile Include="Settings.cs" />
+ <Compile Include="Xaml\ActivityButton.cs" />
+ <Compile Include="Xaml\IconToAvgColorBrushConverter.cs" />
+ <Compile Include="StartupMode.cs" />
+ <Compile Include="Xaml\PopUp\ActivityWindow.xaml.cs">
+ <DependentUpon>ActivityWindow.xaml</DependentUpon>
+ </Compile>
+ <Compile Include="Xaml\PopUp\DeviceWindow.xaml.cs">
+ <DependentUpon>DeviceWindow.xaml</DependentUpon>
+ </Compile>
+ <Compile Include="Xaml\PopUp\ManagerWindow.xaml.cs">
+ <DependentUpon>ManagerWindow.xaml</DependentUpon>
+ </Compile>
+ <Compile Include="Xaml\PopUp\StartMenu.xaml.cs">
+ <DependentUpon>StartMenu.xaml</DependentUpon>
+ </Compile>
+ <Compile Include="Xaml\Win7ColorTracking.cs" />
+ <Page Include="Styles\Dark.xaml">
+ <SubType>Designer</SubType>
+ <Generator>MSBuild:Compile</Generator>
+ </Page>
+ <Page Include="Xaml\ActivityBar.xaml">
+ <SubType>Designer</SubType>
+ <Generator>MSBuild:Compile</Generator>
+ </Page>
+ <Compile Include="Xaml\ActivityBar.xaml.cs">
+ <DependentUpon>ActivityBar.xaml</DependentUpon>
+ </Compile>
+ <Compile Include="Xaml\App.xaml.cs">
+ <DependentUpon>App.xaml</DependentUpon>
+ <SubType>Code</SubType>
+ </Compile>
+ <Page Include="Xaml\Login\LoginWindow.xaml">
+ <SubType>Designer</SubType>
+ <Generator>MSBuild:Compile</Generator>
+ </Page>
+ <Page Include="Styles\GlassButton.xaml">
+ <SubType>Designer</SubType>
+ <Generator>MSBuild:Compile</Generator>
+ </Page>
+ <Page Include="Styles\ColoredButtons.xaml">
+ <SubType>Designer</SubType>
+ <Generator>MSBuild:Compile</Generator>
+ </Page>
+ <Page Include="Xaml\PopUp\ActivityWindow.xaml">
+ <SubType>Designer</SubType>
+ <Generator>MSBuild:Compile</Generator>
+ </Page>
+ <Page Include="Xaml\PopUp\DeviceWindow.xaml">
+ <Generator>MSBuild:Compile</Generator>
+ <SubType>Designer</SubType>
+ </Page>
+ <Page Include="Xaml\PopUp\ManagerWindow.xaml">
+ <SubType>Designer</SubType>
+ <Generator>MSBuild:Compile</Generator>
+ </Page>
+ <Page Include="Xaml\PopUp\StartMenu.xaml">
+ <Generator>MSBuild:Compile</Generator>
+ <SubType>Designer</SubType>
+ </Page>
+ <Page Include="Xaml\Simple Styles.xaml">
+ <Generator>MSBuild:Compile</Generator>
+ <SubType>Designer</SubType>
+ </Page>
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="Xaml\Login\LoginWindow.xaml.cs">
+ <DependentUpon>LoginWindow.xaml</DependentUpon>
+ </Compile>
+ <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="packages.config" />
+ <None Include="Properties\Settings.settings">
+ <Generator>SettingsSingleFileGenerator</Generator>
+ <LastGenOutput>Settings.Designer.cs</LastGenOutput>
+ </None>
+ <AppDesigner Include="Properties\" />
+ </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.Platform.Windows\NooSphere.Platform.Windows.csproj">
+ <Project>{B3333919-EE66-441A-8AB3-6E6601A8A0B1}</Project>
+ <Name>NooSphere.Platform.Windows</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <ItemGroup>
+ <Resource Include="Images\add.png" />
+ <Resource Include="Xaml\computer.png" />
+ <Resource Include="Xaml\image.png" />
+ <Resource Include="Xaml\phone.png" />
+ <Resource Include="Xaml\PopUp\DefaultUser.png" />
+ <Resource Include="Xaml\PopUp\frame.png" />
+ <Resource Include="Xaml\PopUp\wrench.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <Resource Include="Images\house.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <Resource Include="Images\application_view_tile.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <Resource Include="Images\cross.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <Resource Include="Images\activity.PNG" />
+ </ItemGroup>
+ <ItemGroup>
+ <Resource Include="Images\activity1.PNG" />
+ </ItemGroup>
+ <ItemGroup>
+ <Resource Include="Images\application_xp_terminal.png" />
+ <Resource Include="Images\arrow_undo.png" />
+ <Resource Include="Images\brick.png" />
+ <Resource Include="Images\brick_go.png" />
+ <Resource Include="Images\disk.png" />
+ <Resource Include="Images\door_out.png" />
+ <Resource Include="Images\lightbulb.png" />
+ <Resource Include="Images\package.png" />
+ <Resource Include="Images\wrench.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <Resource Include="Images\logo.PNG" />
+ </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
180 NooSphere/ActivityBar/Context/InputRedirect.cs
@@ -0,0 +1,180 @@
+
+/****************************************************************************
+ (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.Drawing;
+using System.Runtime.InteropServices;
+using System.Windows.Forms;
+using NooSphere.ActivitySystem.Context;
+using NooSphere.ActivitySystem.Context.Multicast;
+using NooSphere.Platform.Windows.Hooks;
+
+namespace ActivityUI.Context
+{
+ public class InputRedirect : IContextService
+ {
+ private MulticastSocket _mSocket;
+ private Point _previousPoint;
+ private bool _unInitializedMouse = true;
+ public PointerRole PointerRole { get; private set; }
+
+ public InputRedirect(PointerRole role)
+ {
+ PointerRole = role;
+
+ }
+ public void Start()
+ {
+ _mSocket = new MulticastSocket("225.5.6.7", 5000, 10);
+ _mSocket.OnNotifyMulticastSocketListener += _mSocket_OnNotifyMulticastSocketListener;
+ Initialize(PointerRole);
+ }
+ public void Stop()
+ {
+ MouseHook.UnRegister();
+ }
+ private void Initialize(PointerRole role)
+ {
+ switch (role)
+ {
+ case PointerRole.Controller:
+ MouseHook.Register();
+ MouseHook.MouseDown += MouseHookMouseDown;
+ MouseHook.MouseMove += MouseHookMouseMove;
+ MouseHook.MouseUp += MouseHookMouseUp;
+ break;
+ case PointerRole.Slave:
+ MouseHook.MouseDown += MouseHookMouseDown;
+ MouseHook.MouseMove += MouseHookMouseMove;
+ MouseHook.MouseUp += MouseHookMouseUp;
+ _mSocket.StartReceiving();
+ break;
+ }
+ }
+
+
+ private void MouseHookMouseUp(object sender, MouseEventArgs e)
+ {
+ if (PointerRole == PointerRole.Controller)
+ Send(new PointerMessage(e.X, e.Y, PointerEvent.MouseUp).ToString());
+ }
+ private void MouseHookMouseMove(object sender, MouseEventArgs e)
+ {
+ if (_unInitializedMouse)
+ {
+ _previousPoint = e.Location;
+ _unInitializedMouse = false;
+ }
+ var xDif = _previousPoint.X - e.Location.X;
+ var yDif = _previousPoint.Y - e.Location.Y;
+ Console.WriteLine(xDif + "---" + yDif);
+
+ if (PointerRole == PointerRole.Controller)
+ Send(new PointerMessage(e.Location.X, e.Location.Y+ yDif, PointerEvent.MouseMove).ToString());
+ _previousPoint = e.Location;
+ }
+ private void MouseHookMouseDown(object sender, MouseEventArgs e)
+ {
+ if (PointerRole == PointerRole.Controller)
+ Send(new PointerMessage(e.X, e.Y, PointerEvent.MouseDown).ToString());
+ }
+
+ [DllImport("User32.dll")]
+ private static extern bool SetCursorPos(int x, int y);
+ [DllImport("user32.dll")]
+ public static extern void mouse_event(int dwFlags, int dx, int dy, int cButtons, int dwExtraInfo);
+
+ public const int MOUSEEVENTF_LEFTDOWN = 0x02;
+ public const int MOUSEEVENTF_LEFTUP = 0x04;
+ public const int MOUSEEVENTF_RIGHTDOWN = 0x08;
+ public const int MOUSEEVENTF_RIGHTUP = 0x10;
+ private void _mSocket_OnNotifyMulticastSocketListener(object sender, NotifyMulticastSocketListenerEventArgs e)
+ {
+ if (e.Type == MulticastSocketMessageType.MessageReceived)
+ {
+ var msg = System.Text.Encoding.ASCII.GetString((byte[])e.NewObject);
+ var res = new PointerMessage(Convert.ToInt32(msg.Split('@')[0]), Convert.ToInt32(msg.Split('@')[1]), (PointerEvent)Enum.Parse(typeof(PointerEvent), msg.Split('@')[2]));
+ HandleMessage(res);
+ if (DataReceived != null)
+ {
+ DataReceived(this, new DataEventArgs(msg));
+ }
+ }
+ }
+ private void HandleMessage(PointerMessage res)
+ {
+ switch (res.Message)
+ {
+ case PointerEvent.MouseMove:
+ SetCursorPos(res.X, res.Y);
+ break;
+ case PointerEvent.MouseDown:
+ mouse_event(MOUSEEVENTF_LEFTDOWN, res.X, res.Y, 0, 0);
+ break;
+ case PointerEvent.MouseUp:
+ mouse_event(MOUSEEVENTF_LEFTUP, res.X, res.Y, 0, 0);
+ break;
+ }
+ }
+
+
+ public string Name { get; set; }
+ public Guid Id { get; set; }
+
+ public void Send(string message)
+ {
+ _mSocket.Send(message);
+ }
+
+ public event DataReceivedHandler DataReceived;
+ public event System.EventHandler Started;
+ public event System.EventHandler Stopped;
+
+ }
+
+ public class PointerMessage
+ {
+ public int X { get; set; }
+ public int Y { get; set; }
+ public PointerEvent Message { get; set; }
+
+ public PointerMessage(int x, int y, PointerEvent msg)
+ {
+ X = x;
+ Y = y;
+ Message = msg;
+ }
+ public override string ToString()
+ {
+ return X + "@" + Y + "@" + Message;
+ }
+ }
+
+ public enum PointerRole
+ {
+ Controller,
+ Slave,
+ Both
+ }
+
+ public enum PointerEvent
+ {
+ MouseMove,
+ MouseUp,
+ MouseDown,
+ TouchUp,
+ TouchDown
+ }
+
+
+}
View
7 NooSphere/ActivityBar/Xaml/ActivityBar.xaml.cs
@@ -23,6 +23,7 @@
using System.Windows.Threading;
using System.Runtime.InteropServices;
using System.Windows.Interop;
+using ActivityUI.Context;
using NooSphere.ActivitySystem.Base;
using NooSphere.ActivitySystem.Base.Client;
using NooSphere.ActivitySystem.Base.Service;
@@ -244,7 +245,10 @@ private void StartClient(string activityManagerHttpAddress)
_client.ContextMessageReceived += _client_ContextMessageReceived;
_client.ConnectionEstablished += ClientConnectionEstablished;
- _client.ServiceIsDown += new ServiceDownHandler(_client_ServiceIsDown);
+ _client.ServiceIsDown += _client_ServiceIsDown;
+
+ _client.ContextMonitor.AddContextService(new InputRedirect(PointerRole.Slave));
+
_client.Open(activityManagerHttpAddress);
}
@@ -268,6 +272,7 @@ void _client_ContextMessageReceived(object sender, ContextEventArgs e)
void ClientConnectionEstablished(object sender, EventArgs e)
{
+ _client.ContextMonitor.Start();
BuildUi();
_startingUp = false;
}
View
5 NooSphere/ActivityTablet/ActivityTablet.csproj
@@ -94,6 +94,7 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
+ <Compile Include="Context\InputRedirect.cs" />
<Compile Include="DisplayMode.cs" />
<Compile Include="Xaml\ActivityButton.cs" />
<Compile Include="App.xaml.cs">
@@ -181,6 +182,10 @@
<Project>{03C072A4-5960-4A5D-B0CC-98EBD854E970}</Project>
<Name>NooSphere.Core</Name>
</ProjectReference>
+ <ProjectReference Include="..\NooSphere.Platform.Windows\NooSphere.Platform.Windows.csproj">
+ <Project>{B3333919-EE66-441A-8AB3-6E6601A8A0B1}</Project>
+ <Name>NooSphere.Platform.Windows</Name>
+ </ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(SolutionDir)\.nuget\nuget.targets" />
View
180 NooSphere/ActivityTablet/Context/InputRedirect.cs
@@ -0,0 +1,180 @@
+
+/****************************************************************************
+ (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.Drawing;
+using System.Runtime.InteropServices;
+using System.Windows.Forms;
+using NooSphere.ActivitySystem.Context;
+using NooSphere.ActivitySystem.Context.Multicast;
+using NooSphere.Platform.Windows.Hooks;
+
+namespace ActivityTablet.Context
+{
+ public class InputRedirect : IContextService
+ {
+ private MulticastSocket _mSocket;
+ private Point _previousPoint;
+ private bool _unInitializedMouse = true;
+ public PointerRole PointerRole { get; private set; }
+
+ public InputRedirect(PointerRole role)
+ {
+ PointerRole = role;
+
+ }
+ public void Start()
+ {
+ _mSocket = new MulticastSocket("225.5.6.7", 5000, 10);
+ _mSocket.OnNotifyMulticastSocketListener += _mSocket_OnNotifyMulticastSocketListener;
+ Initialize(PointerRole);
+ }
+ public void Stop()
+ {
+ MouseHook.UnRegister();
+ }
+ private void Initialize(PointerRole role)
+ {
+ switch (role)
+ {
+ case PointerRole.Controller:
+ MouseHook.Register();
+ MouseHook.MouseDown += MouseHookMouseDown;
+ MouseHook.MouseMove += MouseHookMouseMove;
+ MouseHook.MouseUp += MouseHookMouseUp;
+ break;
+ case PointerRole.Slave:
+ MouseHook.MouseDown += MouseHookMouseDown;
+ MouseHook.MouseMove += MouseHookMouseMove;
+ MouseHook.MouseUp += MouseHookMouseUp;
+ _mSocket.StartReceiving();
+ break;
+ }
+ }
+
+
+ private void MouseHookMouseUp(object sender, MouseEventArgs e)
+ {
+ if (PointerRole == PointerRole.Controller)
+ Send(new PointerMessage(e.X, e.Y, PointerEvent.MouseUp).ToString());
+ }
+ private void MouseHookMouseMove(object sender, MouseEventArgs e)
+ {
+ if (_unInitializedMouse)
+ {
+ _previousPoint = e.Location;
+ _unInitializedMouse = false;
+ }
+ var xDif = _previousPoint.X - e.Location.X;
+ var yDif = _previousPoint.Y - e.Location.Y;
+ Console.WriteLine(xDif + "---" + yDif);
+
+ if (PointerRole == PointerRole.Controller)
+ Send(new PointerMessage(_previousPoint.X + xDif, _previousPoint.Y + yDif, PointerEvent.MouseMove).ToString());
+ _previousPoint = e.Location;
+ }
+ private void MouseHookMouseDown(object sender, MouseEventArgs e)
+ {
+ if (PointerRole == PointerRole.Controller)
+ Send(new PointerMessage(e.X, e.Y, PointerEvent.MouseDown).ToString());
+ }
+
+ [DllImport("User32.dll")]
+ private static extern bool SetCursorPos(int x, int y);
+ [DllImport("user32.dll")]
+ public static extern void mouse_event(int dwFlags, int dx, int dy, int cButtons, int dwExtraInfo);
+
+ public const int MOUSEEVENTF_LEFTDOWN = 0x02;
+ public const int MOUSEEVENTF_LEFTUP = 0x04;
+ public const int MOUSEEVENTF_RIGHTDOWN = 0x08;
+ public const int MOUSEEVENTF_RIGHTUP = 0x10;
+ private void _mSocket_OnNotifyMulticastSocketListener(object sender, NotifyMulticastSocketListenerEventArgs e)
+ {
+ if (e.Type == MulticastSocketMessageType.MessageReceived)
+ {
+ var msg = System.Text.Encoding.ASCII.GetString((byte[])e.NewObject);
+ var res = new PointerMessage(Convert.ToInt32(msg.Split('@')[0]), Convert.ToInt32(msg.Split('@')[1]), (PointerEvent)Enum.Parse(typeof(PointerEvent), msg.Split('@')[2]));
+ HandleMessage(res);
+ if (DataReceived != null)
+ {
+ DataReceived(this, new DataEventArgs(msg));
+ }
+ }
+ }
+ private void HandleMessage(PointerMessage res)
+ {
+ switch (res.Message)
+ {
+ case PointerEvent.MouseMove:
+ SetCursorPos(res.X, res.Y);
+ break;
+ case PointerEvent.MouseDown:
+ mouse_event(MOUSEEVENTF_LEFTDOWN, res.X, res.Y, 0, 0);
+ break;
+ case PointerEvent.MouseUp:
+ mouse_event(MOUSEEVENTF_LEFTUP, res.X, res.Y, 0, 0);
+ break;
+ }
+ }
+
+
+ public string Name { get; set; }
+ public Guid Id { get; set; }
+
+ public void Send(string message)
+ {
+ _mSocket.Send(message);
+ }
+
+ public event DataReceivedHandler DataReceived;
+ public event System.EventHandler Started;
+ public event System.EventHandler Stopped;
+
+ }
+
+ public class PointerMessage
+ {
+ public int X { get; set; }
+ public int Y { get; set; }
+ public PointerEvent Message { get; set; }
+
+ public PointerMessage(int x, int y, PointerEvent msg)
+ {
+ X = x;
+ Y = y;
+ Message = msg;
+ }
+ public override string ToString()
+ {
+ return X + "@" + Y + "@" + Message;
+ }
+ }
+
+ public enum PointerRole
+ {
+ Controller,
+ Slave,
+ Both
+ }
+
+ public enum PointerEvent
+ {
+ MouseMove,
+ MouseUp,
+ MouseDown,
+ TouchUp,
+ TouchDown
+ }
+
+
+}
View
6 NooSphere/ActivityTablet/Xaml/Tablet.xaml.cs
@@ -19,6 +19,7 @@
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Threading;
+using ActivityTablet.Context;
using NooSphere.ActivitySystem.Base;
using NooSphere.ActivitySystem.Base.Client;
using NooSphere.ActivitySystem.Base.Service;
@@ -191,6 +192,9 @@ private void StartClient(string addr)
_client.ConnectionEstablished += ClientConnectionEstablished;
_client.FileAdded += ClientFileAdded;
_client.ActivitySwitched += ClientActivitySwitched;
+
+ _client.ContextMonitor.AddContextService(new InputRedirect(PointerRole.Controller));
+
_client.Open(addr);
}
catch (Exception ex)
@@ -199,6 +203,7 @@ private void StartClient(string addr)
MessageBox.Show(ex.ToString());
}
}
+
private void PopulateResource(Activity activity)
{
@@ -312,6 +317,7 @@ private void ClientMessageReceived(object sender, ComEventArgs e)
}
private void ClientConnectionEstablished(object sender, EventArgs e)
{
+ _client.ContextMonitor.Start();
BuildUI();
}
private void BtnQuitClick(object sender, RoutedEventArgs e)
View
5 NooSphere/NooSphere.ActivitySystem/Base/Client/ActivityClient.cs
@@ -27,6 +27,7 @@
#if !ANDROID
using NooSphere.ActivitySystem.Host;
using System.Net;
+using NooSphere.ActivitySystem.Context;
#endif
namespace NooSphere.ActivitySystem.Base.Client
@@ -62,6 +63,7 @@ public class ActivityClient : NetEventHandler,IActivityNode
public User CurrentUser { get; set; }
public string LocalPath { get { return _fileStore.BasePath; } }
public Dictionary<string,Device> DeviceList { get; set; }
+ public ContextMonitor ContextMonitor { get; set; }
#endregion
@@ -76,8 +78,11 @@ public ActivityClient(string localFileDirectory,Device d)
{
InitializeFileService(localFileDirectory);
Device = d;
+ ContextMonitor = new ContextMonitor();
+
OnInitializedEvent(new EventArgs());
+
ActivityChanged += ActivityClientActivityChanged;
ActivityRemoved += ActivityClientActivityRemoved;
}
View
185 NooSphere/NooSphere.ActivitySystem/Context/IO/PointerNode.cs
@@ -1,185 +0,0 @@
-
-///****************************************************************************
-// (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.Drawing;
-//using System.Runtime.InteropServices;
-//using System.Windows.Forms;
-//using NooSphere.ActivitySystem.Context;
-//using NooSphere.Context.Multicast;
-//using NooSphere.Platform.Windows.Hooks;
-
-//namespace NooSphere.Context.IO
-//{
-// public class PointerNode : IContextService
-// {
-// private MulticastSocket _mSocket;
-
-// public PointerRole PointerRole { get; private set; }
-
-// public PointerNode(PointerRole role)
-// {
-// PointerRole = role;
-
-// }
-// public void Start()
-// {
-// _mSocket = new MulticastSocket("225.5.6.7", 5000, 10);
-// _mSocket.OnNotifyMulticastSocketListener += _mSocket_OnNotifyMulticastSocketListener;
-// Initialize(PointerRole);
-// }
-
-// public void Stop()
-// {
-// MouseHook.UnRegister();
-// }
-// private void Initialize(PointerRole role)
-// {
-// switch (role)
-// {
-// case PointerRole.Controller:
-// MouseHook.Register();
-// MouseHook.MouseDown += new MouseEventHandler(MouseHookMouseDown);
-// MouseHook.MouseMove += new MouseEventHandler(MouseHookMouseMove);
-// MouseHook.MouseUp += new MouseEventHandler(MouseHookMouseUp);
-// break;
-// case PointerRole.Slave:
-// MouseHook.MouseDown += new MouseEventHandler(MouseHookMouseDown);
-// MouseHook.MouseMove += new MouseEventHandler(MouseHookMouseMove);
-// MouseHook.MouseUp += new MouseEventHandler(MouseHookMouseUp);
-// _mSocket.StartReceiving();
-// break;
-// }
-// }
-
-// private Point _previousPoint;
-// private bool _unInitializedMouse = true;
-// private void MouseHookMouseUp(object sender, MouseEventArgs e)
-// {
-// if (PointerRole == PointerRole.Controller)
-// Send(new PointerMessage(e.X, e.Y, PointerEvent.Up).ToString());
-// }
-// private void MouseHookMouseMove(object sender, MouseEventArgs e)
-// {
-// if (_unInitializedMouse)
-// {
-// _previousPoint = e.Location;
-// _unInitializedMouse = false;
-// }
-// var xDif = _previousPoint.X - e.Location.X;
-// var yDif = _previousPoint.Y - e.Location.Y;
-// Console.WriteLine(xDif + "---" + yDif);
-
-// if (PointerRole == PointerRole.Controller)
-// Send(new PointerMessage(_previousPoint.X + xDif, _previousPoint.Y + yDif, PointerEvent.Move).ToString());
-// _previousPoint = e.Location;
-// }
-// private void MouseHookMouseDown(object sender, MouseEventArgs e)
-// {
-// if (PointerRole == PointerRole.Controller)
-// Send(new PointerMessage(e.X, e.Y, PointerEvent.Down).ToString());
-// }
-
-// [DllImport("User32.dll")]
-// private static extern bool SetCursorPos(int x, int y);
-// [DllImport("user32.dll")]
-// public static extern void mouse_event(int dwFlags, int dx, int dy, int cButtons, int dwExtraInfo);
-
-// public const int MOUSEEVENTF_LEFTDOWN = 0x02;
-// public const int MOUSEEVENTF_LEFTUP = 0x04;
-// public const int MOUSEEVENTF_RIGHTDOWN = 0x08;
-// public const int MOUSEEVENTF_RIGHTUP = 0x10;
-// private void _mSocket_OnNotifyMulticastSocketListener(object sender, NotifyMulticastSocketListenerEventArgs e)
-// {
-// if (e.Type == MulticastSocketMessageType.MessageReceived)
-// {
-// var msg = System.Text.Encoding.ASCII.GetString((byte[])e.NewObject);
-
-// var res = new PointerMessage(Convert.ToInt32(msg.Split('@')[0]), Convert.ToInt32(msg.Split('@')[1]), (PointerEvent)Enum.Parse(typeof(PointerEvent), msg.Split('@')[2]));
-
-
-
-// HandleMessage(res);
-// if (DataReceived != null)
-// {
-// DataReceived(this, new DataEventArgs(msg));
-// }
-// }
-// }
-
-// private void HandleMessage(PointerMessage res)
-// {
-// switch (res.Message)
-// {
-// case PointerEvent.Move:
-// SetCursorPos(res.X, res.Y);
-// break;
-// case PointerEvent.Down:
-// mouse_event(MOUSEEVENTF_LEFTDOWN, res.X, res.Y, 0, 0);
-// break;
-// case PointerEvent.Up:
-// mouse_event(MOUSEEVENTF_LEFTUP, res.X, res.Y, 0, 0);
-// break;
-// }
-// }
-
-
-// public string Name { get; set; }
-
-// public void Send(string message)
-// {
-// _mSocket.Send(message);
-// }
-
-// public event DataReceivedHandler DataReceived;
-// public event System.EventHandler Started;
-// public event System.EventHandler Stopped;
-
-// }
-
-// public class PointerMessage
-// {
-// public int X { get; set; }
-// public int Y { get; set; }
-// public PointerEvent Message { get; set; }
-
-// public PointerMessage(int x, int y, PointerEvent msg)
-// {
-// X = x;
-// Y = y;
-// Message = msg;
-// }
-// public override string ToString()
-// {
-// return X + "@" + Y + "@" + Message;
-// }
-// }
-
-// public enum PointerRole
-// {
-// Controller,
-// Slave,
-// Both
-// }
-
-// public enum PointerEvent
-// {
-// MouseMove,
-// MouseUp,
-// MouseDown,
-// TouchUp,
-// TouchDown
-// }
-
-
-//}
View
1  NooSphere/NooSphere.ActivitySystem/NooSphere.ActivitySystem.csproj
@@ -80,7 +80,6 @@
<Compile Include="Context\ContextMonitor.cs" />
<Compile Include="Context\DataEventArgs.cs" />
<Compile Include="Context\IContextService.cs" />
- <Compile Include="Context\IO\PointerNode.cs" />
<Compile Include="Context\Multicast\MulticastSocket.cs" />
<Compile Include="Context\Multicast\MulticastSocketListener.cs" />
<Compile Include="Context\Multicast\StateObject.cs" />
View
149 NooSphere/NooSphere.ActivitySystem/PubSub/RestPublisher.cs
@@ -1,73 +1,76 @@
-/****************************************************************************
- (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.Linq;
-using System.Threading.Tasks;
-using NooSphere.ActivitySystem.Helpers;
-
-namespace NooSphere.ActivitySystem.PubSub
-{
- public class RestPublisher
- {
- /// <summary>
- /// Publishes an event to all suscribers
- /// </summary>
- /// <param name="publishUrl"> </param>
- /// <param name="netObject">The object that needs to be published</param>
- /// <param name="source">The source that whishes to publish </param>
- /// <param name="sendToSource">Enables or disable self-publishing to source</param>
- public void Publish(string publishUrl, object netObject, object source = null, bool sendToSource = false)
- {
- //Log.Out("Publisher", string.Format("Published {0}",publishUrl), LogCode.Net);
- var toRemove = new List<string>();
-
- var devices = Registry.ConnectedClients.Values.ToList();
- for (int i = 0; i < devices.Count;i++ )
- {
- try
- {
- var addr = devices[i].Device.BaseAddress;
- Task.Factory.StartNew(
- delegate
- {
- Rest.Post(addr + publishUrl, netObject);
- Log.Out("Publisher",
- string.Format("Published {0} to {1}", publishUrl, addr),
- LogCode.Net);
- });
- }
- catch (Exception)
- {
-
- }
- }
- }
-
- /// <summary>
- /// Publish event to one subscriber
- /// </summary>
- /// <param name="publishUrl"></param>
- /// <param name="netObject"></param>
- /// <param name="subscriber"> </param>
- public void PublishToSubscriber(string publishUrl, object netObject,object subscriber)
- {
- Task.Factory.StartNew(
- delegate
- {
- Rest.Post(subscriber + publishUrl, netObject);
- Log.Out("Publisher", string.Format("Publishing {0} to {1}", publishUrl, subscriber), LogCode.Net);
- });
- }
- }
-}
+/****************************************************************************
+ (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.Linq;
+using System.Threading.Tasks;
+using NooSphere.ActivitySystem.Helpers;
+using NooSphere.ActivitySystem.Base.Service;
+
+namespace NooSphere.ActivitySystem.PubSub
+{
+ public class RestPublisher
+ {
+ /// <summary>
+ /// Publishes an event to all suscribers
+ /// </summary>
+ /// <param name="publishUrl"> </param>
+ /// <param name="netObject">The object that needs to be published</param>
+ /// <param name="source">The source that whishes to publish </param>
+ /// <param name="sendToSource">Enables or disable self-publishing to source</param>
+ public void Publish(string publishUrl, object netObject, object source = null, bool sendToSource = false)
+ {
+ //Log.Out("Publisher", string.Format("Published {0}",publishUrl), LogCode.Net);
+ var toRemove = new List<string>();
+
+ var devices = Registry.ConnectedClients;
+ for (var i = 0; i < devices.Count;i++ )
+ {
+ var addr = devices.Values.ToList()[i].Device.BaseAddress;
+ try
+ {
+ Task.Factory.StartNew(
+ delegate
+ {
+ Rest.Post(addr + publishUrl, netObject);
+ Log.Out("Publisher",
+ string.Format("Published {0} to {1}", publishUrl, addr),
+ LogCode.Net);
+ });
+ }
+ catch (Exception)
+ {
+ toRemove.Add(devices.Keys.ToList()[i]);
+ }
+ }
+ foreach (var addr in toRemove)
+ Registry.ConnectedClients.Remove(addr);
+ }
+
+ /// <summary>
+ /// Publish event to one subscriber
+ /// </summary>
+ /// <param name="publishUrl"></param>
+ /// <param name="netObject"></param>
+ /// <param name="subscriber"> </param>
+ public void PublishToSubscriber(string publishUrl, object netObject,object subscriber)
+ {
+ Task.Factory.StartNew(
+ delegate
+ {
+ Rest.Post(subscriber + publishUrl, netObject);
+ Log.Out("Publisher", string.Format("Publishing {0} to {1}", publishUrl, subscriber), LogCode.Net);
+ });
+ }
+ }
+}

0 comments on commit feaa02f

Please sign in to comment.
Something went wrong with that request. Please try again.