Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Started custom data source implementation #259 #260

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions Tailviewer.sln
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Installer", "src\Installer\
{9997F434-58B2-4C26-B622-5CA411A82BF7} = {9997F434-58B2-4C26-B622-5CA411A82BF7}
{C667EB8A-6781-4623-AC7C-D3FBA2F6E7D4} = {C667EB8A-6781-4623-AC7C-D3FBA2F6E7D4}
{799F74C7-6DE8-455D-936D-E11D7525AB36} = {799F74C7-6DE8-455D-936D-E11D7525AB36}
{F4F3D6CC-4DBB-40BC-BC12-7AF88CFDAB22} = {F4F3D6CC-4DBB-40BC-BC12-7AF88CFDAB22}
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tailviewer.Api", "src\Tailviewer.Api\Tailviewer.Api.csproj", "{0C18B216-9FF4-4DCF-88C0-4B1448892F43}"
Expand Down Expand Up @@ -64,6 +65,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tailviewer.Formats.Serilog"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tailviewer.Formats.Serilog.Test", "src\Plugins\Tailviewer.Formats.Serilog.Test\Tailviewer.Formats.Serilog.Test.csproj", "{B132CF5C-8555-4D0F-A55A-F870C003EB59}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tailviewer.DataSources.UDP", "src\Plugins\Tailviewer.DataSources.UDP\Tailviewer.DataSources.UDP.csproj", "{F4F3D6CC-4DBB-40BC-BC12-7AF88CFDAB22}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tailviewer.DataSources.UDP.Test", "src\Plugins\Tailviewer.DataSources.UDP.Test\Tailviewer.DataSources.UDP.Test.csproj", "{589025EC-2835-485C-BDCF-D9B77C65167E}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -134,6 +139,14 @@ Global
{B132CF5C-8555-4D0F-A55A-F870C003EB59}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B132CF5C-8555-4D0F-A55A-F870C003EB59}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B132CF5C-8555-4D0F-A55A-F870C003EB59}.Release|Any CPU.Build.0 = Release|Any CPU
{F4F3D6CC-4DBB-40BC-BC12-7AF88CFDAB22}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F4F3D6CC-4DBB-40BC-BC12-7AF88CFDAB22}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F4F3D6CC-4DBB-40BC-BC12-7AF88CFDAB22}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F4F3D6CC-4DBB-40BC-BC12-7AF88CFDAB22}.Release|Any CPU.Build.0 = Release|Any CPU
{589025EC-2835-485C-BDCF-D9B77C65167E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{589025EC-2835-485C-BDCF-D9B77C65167E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{589025EC-2835-485C-BDCF-D9B77C65167E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{589025EC-2835-485C-BDCF-D9B77C65167E}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -157,6 +170,8 @@ Global
{A628892A-4BE2-4726-983E-CCE47C716CC1} = {3E228233-3DBD-48B5-85B3-BEAD0C65F084}
{9997F434-58B2-4C26-B622-5CA411A82BF7} = {BC0C0BBB-9D4C-47CE-9888-EB956F4A4562}
{B132CF5C-8555-4D0F-A55A-F870C003EB59} = {790E58D1-E0A7-4B82-B617-3A5D442B8CC0}
{F4F3D6CC-4DBB-40BC-BC12-7AF88CFDAB22} = {BC0C0BBB-9D4C-47CE-9888-EB956F4A4562}
{589025EC-2835-485C-BDCF-D9B77C65167E} = {790E58D1-E0A7-4B82-B617-3A5D442B8CC0}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {B0BB6C40-85F7-419C-8CBC-89473DC30B16}
Expand Down
6 changes: 3 additions & 3 deletions src/GlobalAssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]

[assembly: AssemblyVersion("0.9.3.0")]
[assembly: AssemblyFileVersion("0.9.3.0")]
[assembly: AssemblyInformationalVersion("0.9.3.0")]
[assembly: AssemblyVersion("0.9.4.0")]
[assembly: AssemblyFileVersion("0.9.4.0")]
[assembly: AssemblyInformationalVersion("0.9.4.0")]
3 changes: 3 additions & 0 deletions src/Installer/Installer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,9 @@
<EmbeddedResource Include="..\..\bin\Plugins\Tailviewer.Formats.Serilog.0.0.0.tvp">
<LogicalName>InstallationFiles\Plugins\Tailviewer.Formats.Serilog.0.0.0.tvp</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="..\..\bin\Plugins\Tailviewer.DataSources.UDP.0.0.0.tvp">
<LogicalName>InstallationFiles\Plugins\Tailviewer.DataSources.UDP.0.0.0.tvp</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="..\..\bin\MMQ.dll">
<Link>InstallationFiles\MMQ.dll</Link>
<LogicalName>InstallationFiles\MMQ.dll</LogicalName>
Expand Down
11 changes: 11 additions & 0 deletions src/Plugins/Tailviewer.DataSources.UDP.Test/Class1.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;

namespace Tailviewer.DataSources.UDP.Test
{
public class Class1
{
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Tailviewer.DataSources.UDP.Test")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Tailviewer.DataSources.UDP.Test")]
[assembly: AssemblyCopyright("Copyright © 2020")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("589025ec-2835-485c-bdcf-d9b77c65167e")]

// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{589025EC-2835-485C-BDCF-D9B77C65167E}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Tailviewer.DataSources.UDP.Test</RootNamespace>
<AssemblyName>Tailviewer.DataSources.UDP.Test</AssemblyName>
<TargetFrameworkVersion>v4.7.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>..\..\..\bin\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>..\..\..\bin\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
</ItemGroup>
<ItemGroup>
<Compile Include="Class1.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
10 changes: 10 additions & 0 deletions src/Plugins/Tailviewer.DataSources.UDP/IUdpSocket.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
using System;

namespace Tailviewer.DataSources.UDP
{
public interface IUdpSocket
: IDisposable
{
event Action<UdpDatagram> OnMessage;
}
}
39 changes: 39 additions & 0 deletions src/Plugins/Tailviewer.DataSources.UDP/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
using System.Reflection;
using System.Runtime.InteropServices;
using Tailviewer.BusinessLogic.Plugins;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Tailviewer.DataSources.UDP")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Tailviewer.DataSources.UDP")]
[assembly: AssemblyCopyright("Copyright © Simon Mießler 2020")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("f4f3d6cc-4dbb-40bc-bc12-7af88cfdab22")]

// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

[assembly: PluginId("Tailviewer.DataSources", "UDP")]
[assembly: PluginAuthor("Simon Mießler")]
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{F4F3D6CC-4DBB-40BC-BC12-7AF88CFDAB22}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Tailviewer.DataSources.UDP</RootNamespace>
<AssemblyName>Tailviewer.DataSources.UDP</AssemblyName>
<TargetFrameworkVersion>v4.7.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>..\..\..\bin\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>..\..\..\bin\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="log4net, Version=2.0.12.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<HintPath>..\..\..\packages\log4net.2.0.12\lib\net45\log4net.dll</HintPath>
</Reference>
<Reference Include="PresentationFramework" />
<Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="System.Core" />
<Reference Include="System.Extensions, Version=2.0.59.0, Culture=neutral, PublicKeyToken=951c63ca832f7094, processorArchitecture=MSIL">
<HintPath>..\..\..\packages\System.Threading.Extensions.2.0.59\lib\net45\System.Extensions.dll</HintPath>
</Reference>
<Reference Include="System.Web" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="IUdpSocket.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="UdpCustomDataSourceConfiguration.cs" />
<Compile Include="UdpDatagram.cs" />
<Compile Include="UdpDataSourceViewModel.cs" />
<Compile Include="UdpDataSourcePlugin.cs" />
<Compile Include="UdpLogFile.cs" />
<Compile Include="UdpSocket.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Tailviewer.Api\Tailviewer.Api.csproj">
<Project>{0C18B216-9FF4-4DCF-88C0-4B1448892F43}</Project>
<Name>Tailviewer.Api</Name>
</ProjectReference>
<ProjectReference Include="..\..\Tailviewer.Core\Tailviewer.Core.csproj">
<Project>{62C60D20-180E-4A59-9EF3-30161E1E31CB}</Project>
<Name>Tailviewer.Core</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>"archive.exe" pack "$(MSBuildProjectDirectory)\$(OutDir)Tailviewer.DataSources.UDP.dll"
xcopy "$(MSBuildProjectDirectory)\$(OutDir)Tailviewer.DataSources.UDP.*.tvp" "$(MSBuildProjectDirectory)\$(OutDir)Plugins\" /y</PostBuildEvent>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
using System;
using System.Xml;
using Tailviewer.BusinessLogic.Plugins;

namespace Tailviewer.DataSources.UDP
{
public sealed class UdpCustomDataSourceConfiguration
: ICustomDataSourceConfiguration
{
public string Address;

#region Implementation of ICloneable

object ICloneable.Clone()
{
return Clone();
}

public UdpCustomDataSourceConfiguration Clone()
{
throw new NotImplementedException();
}

#endregion

#region Implementation of ICustomDataSourceConfiguration

public void Restore(XmlReader reader)
{
for(int i = 0; i < reader.AttributeCount; ++i)
{
reader.MoveToAttribute(i);
switch (reader.Name)
{
case "address":
Address = reader.Value;
break;
}
}
}

public void Store(XmlWriter writer)
{
writer.WriteAttributeString("address", Address);
}

#endregion
}
}
Loading