Skip to content
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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -264,3 +264,6 @@ __pycache__/
/Web/*
/AutoBill/bin/*
/AutoBill/obj/*

*.zip
*.swp
178 changes: 178 additions & 0 deletions Chatter/Chatter.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,178 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.30729</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{84BCF238-F124-48AA-A388-0050F66E36E3}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>OpenALPRQueueConsumer.Chatter</RootNamespace>
<AssemblyName>OpenALPRQueueConsumer.Chatter</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>Chatter.snk</AssemblyOriginatorKeyFile>
<FileUpgradeFlags>
</FileUpgradeFlags>
<OldToolsVersion>3.5</OldToolsVersion>
<UpgradeBackupLocation />
<TargetFrameworkProfile />
<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>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
</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>
<Prefer32Bit>false</Prefer32Bit>
<CodeAnalysisRuleSet>
</CodeAnalysisRuleSet>
</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>
<Prefer32Bit>false</Prefer32Bit>
<CodeAnalysisRuleSet>
</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x86\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>
<CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>false</Prefer32Bit>
<CodeAnalysisRuleSet>
</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<OutputPath>bin\x86\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget>
<CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>
<CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>false</Prefer32Bit>
<CodeAnalysisRuleSet>
</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>..\build\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>false</Prefer32Bit>
<CodeAnalysisRuleSet>ManagedMinimumRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisIgnoreGeneratedCode>false</CodeAnalysisIgnoreGeneratedCode>
<LangVersion>latest</LangVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>..\build\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x64</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisIgnoreBuiltInRuleSets>false</CodeAnalysisIgnoreBuiltInRuleSets>
<CodeAnalysisIgnoreBuiltInRules>false</CodeAnalysisIgnoreBuiltInRules>
<Prefer32Bit>false</Prefer32Bit>
<CodeAnalysisRuleSet>
</CodeAnalysisRuleSet>
<RunCodeAnalysis>false</RunCodeAnalysis>
<LangVersion>latest</LangVersion>
</PropertyGroup>
<PropertyGroup>
<ApplicationIcon>shutter32x32BlueIcon.ico</ApplicationIcon>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Runtime.Serialization">
<RequiredTargetFramework>3.0</RequiredTargetFramework>
</Reference>
<Reference Include="System.ServiceModel">
<RequiredTargetFramework>3.0</RequiredTargetFramework>
</Reference>
<Reference Include="System.Web.Extensions" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Proxy\ChatProxy.cs" />
<Compile Include="Interfaces\IChat.cs" />
<Compile Include="Interfaces\IChatCallback.cs" />
<Compile Include="Interfaces\IChatChannel.cs" />
<Compile Include="Data\Message.cs" />
<Compile Include="Proxy\ProxyCallBackEventArgs.cs" />
<Compile Include="Proxy\ProxyEventArgs.cs" />
<Compile Include="Proxy\ProxySingleton.cs" />
<Compile Include="Data\User.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Utility\CommonSimpleEncrypt.cs" />
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
<None Include="Chatter.snk" />
</ItemGroup>
<ItemGroup>
<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>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
<Visible>False</Visible>
<ProductName>Windows Installer 3.1</ProductName>
<Install>true</Install>
</BootstrapperPackage>
</ItemGroup>
<ItemGroup>
<Content Include="shutter32x32BlueIcon.ico" />
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.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>
Binary file added Chatter/Chatter.snk
Binary file not shown.
80 changes: 80 additions & 0 deletions Chatter/Data/Message.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
using System;
using System.Runtime.Serialization;

namespace OpenALPRQueueConsumer.Chatter
{
[DataContract]
[Serializable]
public class Message
{
[DataMember]
public Info MessageInfo { private set; get; }

public Message(Info info)
{
MessageInfo = info;
}
}

[DataContract]
[Serializable]
public class Info
{
[DataMember]
public string Message1 { set; get; }

[DataMember]
public string Message2 { set; get; }

[DataMember]
public string Message3 { set; get; }

[DataMember]
public string Message4 { set; get; }

[DataMember]
public int Integer { set; get; }

[DataMember]
public MessageId MsgId { set; get; }

[DataMember]
public bool Bool { set; get; }

public Info()
{
Message1 = string.Empty;
Message2 = string.Empty;
Message3 = string.Empty;
Message4 = string.Empty;
}

public override string ToString()
{
return MsgId.ToString();
}
}

public enum MessageId : int
{
Init,
//ExportProgress,
//ExportNotFound,
//Message,
//Status,
ConnectedToMilestoneServer,
//StartExport,

//InitToServer,
//NewExport,
//ExportUpdated,
//ExportDeleted,
//ExportPaused,
ConnectedToMilestoneToServer,
//LicenseFilePath,
//Search,
//SearchResult,

//IsApplicationLicensed
}
}
46 changes: 46 additions & 0 deletions Chatter/Data/User.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
using System.ComponentModel;
using System.Runtime.Serialization;

namespace OpenALPRQueueConsumer.Chatter
{
[DataContract]
public class User : INotifyPropertyChanged
{
public static string AutoExporterServiceName = "AutoExporterSvc";
public static string SystemTrayIconName = "SystemTrayIcon";
public const string ManagmentClientPluginName = "ManagmentClientPlugin";

public event PropertyChangedEventHandler PropertyChanged;

private string name;

public User(string name)
{
this.name = name;
}

[DataMember]
public string Name
{
get { return name; }
set
{
if (name != value)
{
name = value;
OnPropertyChanged(nameof(Name));
}
}
}

protected void OnPropertyChanged(string propertyValue)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyValue));
}

public override string ToString()
{
return name ;
}
}
}
32 changes: 32 additions & 0 deletions Chatter/Interfaces/IChat.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
using System;
using System.CodeDom.Compiler;
using System.ServiceModel;

namespace OpenALPRQueueConsumer.Chatter.Interfaces
{
// https://www.codeproject.com/Articles/19752/WCF-WPF-Chat-Application

#region IChat interface
[GeneratedCode("System.ServiceModel", "4.0.0.0")]
[ServiceContract(SessionMode = SessionMode.Required, CallbackContract = typeof(IChatCallback))]
public interface IChat
{
[OperationContract(AsyncPattern = true, Action = "http://tempuri.org/IChat/Join", ReplyAction = "http://tempuri.org/IChat/JoinResponse")]
IAsyncResult BeginJoin(User name, AsyncCallback callback, object asyncState);

User[] EndJoin(IAsyncResult result);

[OperationContract(IsOneWay = false, IsInitiating = true, IsTerminating = false, Action = "http://tempuri.org/IChat/Join")]
User[] Join(User name);

[OperationContract(IsOneWay = true, IsInitiating = false, IsTerminating = false, Action = "http://tempuri.org/IChat/Leave")]
void Leave();

[OperationContract(IsOneWay = true, IsInitiating = false, IsTerminating = false, Action = "http://tempuri.org/IChat/Say")]
void Say(Message msg);

[OperationContract(IsOneWay = true, IsInitiating = false, IsTerminating = false, Action = "http://tempuri.org/IChat/Whisper")]
void Whisper(string sendTo, Message msg);
}
#endregion
}
26 changes: 26 additions & 0 deletions Chatter/Interfaces/IChatCallback.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@

using System.CodeDom.Compiler;
using System.ServiceModel;

namespace OpenALPRQueueConsumer.Chatter.Interfaces
{
// https://www.codeproject.com/Articles/19752/WCF-WPF-Chat-Application

#region IChatCallback interface
[GeneratedCode("System.ServiceModel", "4.0.0.0")]
public interface IChatCallback
{
[OperationContract(IsOneWay = true, Action = "http://tempuri.org/IChat/Receive")]
void Receive(User sender, Message message);

[OperationContract(IsOneWay = true, Action = "http://tempuri.org/IChat/ReceiveWhisper")]
void ReceiveWhisper(User sender, Message message);

[OperationContract(IsOneWay = true, Action = "http://tempuri.org/IChat/UserEnter")]
void UserEnter(User user);

[OperationContract(IsOneWay = true, Action = "http://tempuri.org/IChat/UserLeave")]
void UserLeave(User user);
}
#endregion
}
14 changes: 14 additions & 0 deletions Chatter/Interfaces/IChatChannel.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using System.CodeDom.Compiler;
using System.ServiceModel;

namespace OpenALPRQueueConsumer.Chatter.Interfaces
{
// https://www.codeproject.com/Articles/19752/WCF-WPF-Chat-Application

#region IChatChannel interface
[GeneratedCode("System.ServiceModel", "4.0.0.0")]
public interface IChatChannel : IChat, IClientChannel
{
}
#endregion
}
Loading