Click or drag to resize

ScoringProgramDataConnectorPipeClient Class

Handles request from the scoring programs. This code is freely available for external programmers to adapt to their specific needs. This code, however, is guaranteed to work. Interop options are available for many programming languages that can interface with .Net Standard 2.0 assemblies.
Note that this class is written as a singleton: there should never be more than one instance communicating over the pipe. The constructor is protected however, so by inheriting from this class a non singleton instance can be used.
The class implements IDisposable through its base class, as the base class contains a stream writer and stream reader that must be disposed when the communication shuts down. Be sure to call Dispose on the class any time it is no longer in use, otherwise communication will stall.
The code has no dependencies, except one on NLog (and Net Standard 2.0). If you decide to copy the code make sure to add a dependency to the NLog NuGet package or implement your own logging.
All public functions have synchronous and asynchronous implementations (ending in "Async").
To get started inspect the following functions:
Connect and ConnectAsync: Connection to the Data Connector.
Initialize and InitializeAsync: Initialization of a new event.
IssueManagementCommand and IssueManagementCommandAsync: Query the Bridgemate Control Software.
Inheritance Hierarchy

Namespace: BridgeSystems.Bridgemate.DataConnector.ScoringProgramClient
Assembly: BridgeSystems.Bridgemate.DataConnector.ScoringProgramClient (in BridgeSystems.Bridgemate.DataConnector.ScoringProgramClient.dll) Version: 5.0.1014.1+c0d6f9bc4d7d415f4cee902c0a8eb3b5237ddd44
Syntax
C#
public class ScoringProgramDataConnectorPipeClient : ScoringProgramDataConnectorClientCommandManager, 
	IScoringProgramClient

The ScoringProgramDataConnectorPipeClient type exposes the following members.

Constructors
 NameDescription
Protected methodScoringProgramDataConnectorPipeClient Initializes the class.
Top
Properties
 NameDescription
Public propertyIsActive Can be used to see if there already is a connection to the Data Connector. If so, do not try to connect again.
(Overrides DataConnectorClientCommandManagerTCommandIsActive)
Public propertyIsSending Only one request can be sent at the same time. So let asynchronous code always check, set and reset this property before, while and after sending a request. Feel free to make more nifty implementations.
(Inherited from ScoringProgramDataConnectorClientCommandManager)
Public propertyLastHandrecordQueueItemId The id of the last handrecord queue item downloaded from the Data Connector. You can use this to internally accept this item (and all before of the same type).
(Inherited from ScoringProgramDataConnectorClientCommandManager)
Public propertyLastParticipantQueueItemId The id of the last participant queue item downloaded from the Data Connector. You can use this to internally accept this item (and all before of the same type).
(Inherited from ScoringProgramDataConnectorClientCommandManager)
Public propertyLastPlayerDataQueueItemId The id of the last player data queue item downloaded from the Data Connector. You can use this to internally accept this item (and all before of the same type).
(Inherited from ScoringProgramDataConnectorClientCommandManager)
Public propertyLastResultQueueItemId The id of the last result queue item downloaded from the Data Connector. You can use this to internally accept this item (and all before of the same type).
(Inherited from ScoringProgramDataConnectorClientCommandManager)
Public propertyLoggingSource The source of the logging records.
(Inherited from ScoringProgramDataConnectorClientCommandManager)
Public propertyTimeOutInMilliSeconds The timeout for establishing a connection with the Data Connector. If not set the default value DefaultTimeOutInMilliSeconds will be used.
(Inherited from DataConnectorClientCommandManagerTCommand)
Top
Methods
 NameDescription
Public methodAcceptQueueData Signals to the Data Connector synchronously that a specific type of queuedata up to the specified id does not need to be sent again.
(Inherited from ScoringProgramDataConnectorClientCommandManager)
Public methodAcceptQueueDataAsync Signals to the Data Connector asynchronously that a specific type of queuedata up to the specified id does not need to be sent again.
(Inherited from ScoringProgramDataConnectorClientCommandManager)
Public methodAddSession Adds the given session to a known event synchronously. This event must have been sent to the Data Connector previously using an InitDTO.
(Inherited from ScoringProgramDataConnectorClientCommandManager)
Public methodAddSessionAsync Adds the given session to a known event asynchronously. This event must have been sent to the Data Connector previously using an InitDTO.
(Inherited from ScoringProgramDataConnectorClientCommandManager)
Public methodClearData Instructs the DataConnector to synchronously clear all incoming and outgoing queuedata and to remove al validation data as well. Use with caution!
(Inherited from ScoringProgramDataConnectorClientCommandManager)
Public methodClearDataAsync Instructs the DataConnector to asynchronously clear all incoming and outgoing queuedata and to remove al validation data as well. Use with caution!
(Inherited from ScoringProgramDataConnectorClientCommandManager)
Public methodConnect Connect to the Data Connector synchronously
Public methodConnect(String) Connects to the specified named pipe synchronously.
(Overrides DataConnectorClientCommandManagerTCommandConnect(String))
Public methodConnectAsync Connect to the Data Connector asynchronously.
Public methodConnectAsync(String) Connects to the specified named pipe synchronously.
(Overrides DataConnectorClientCommandManagerTCommandConnectAsync(String))
Public methodContinue Instructs BCS synchronously to continue working with a previously created event.
(Inherited from ScoringProgramDataConnectorClientCommandManager)
Public methodContinueAsync Instructs BCS asynchronously to continue working with a previously created event.
(Inherited from ScoringProgramDataConnectorClientCommandManager)
Public methodDisconnect Disconnects from the Data Connector synchronously, causing the Data Connector to close the pipe and reopen it.
Public methodDisconnectAsync Disconnects from the Data Connector asynchronously, causing the Data Connector to close the pipe and reopen it.
Public methodDispose Disposes the class.
(Inherited from DataConnectorClientCommandManagerTCommand)
Protected methodDispose(Boolean) Disposes the class.
(Overrides DataConnectorClientCommandManagerTCommandDispose(Boolean))
Public methodDoesSessionExist Does an synchronous check on if the session with the given guid exists.
(Inherited from ScoringProgramDataConnectorClientCommandManager)
Public methodDoesSessionExistAsync Does an asynchronous check on if the session with the given guid exists.
(Inherited from ScoringProgramDataConnectorClientCommandManager)
Public methodGetAllMovements Returns the movements synchronously for the given session as they are in use by BCS.Mind that the Data Connector itself creates updates to enact movement changes.
(Inherited from ScoringProgramDataConnectorClientCommandManager)
Public methodGetAllMovementsAsync Returns the movements asynchronously for the given session as they are in use by BCS.Mind that the Data Connector itself creates updates to enact movement changes.
(Inherited from ScoringProgramDataConnectorClientCommandManager)
Public methodGetMovement Returns the movement for the given section synchronously as it is in use by BCS.Mind that the Data Connector itself creates updates to enact movement changes.
(Inherited from ScoringProgramDataConnectorClientCommandManager)
Public methodGetMovementAsync Returns the movement asynchronously for the given section as it is in use by BCS.Mind that the Data Connector itself creates updates to enact movement changes.
(Inherited from ScoringProgramDataConnectorClientCommandManager)
Public methodInitialize Instructs BCS to create a new sessions with the provided table domain data (scoring groups, sections, tables, rounds). Player names, Results and Handrecords can be included or can be uploaded later. The latter option is considerably less performant.
(Inherited from ScoringProgramDataConnectorClientCommandManager)
Public methodInitializeAsync Instructs BCS to create new sessions with the provided table domain data (scoring groups, sections, tables, rounds). Player names, Results and Handrecords can be included or can be uploaded later. The latter option is considerably less performant.
(Inherited from ScoringProgramDataConnectorClientCommandManager)
Public methodStatic memberInstance The single instance of the pipe client. Use this property to retrieve the client and use it in the external program.
Public methodIssueManagementCommand Issue a management command to BCS synchronously. This command can either be a query for information on the location of its scoring file, which sessions it is currently administering or which sessions are know to it, or it can be an instruction to shut down.
(Inherited from ScoringProgramDataConnectorClientCommandManager)
Public methodIssueManagementCommandAsync Issue a management command to BCS asynchronously. This command can either be a query for information on the location of its scoring file, which sessions it is currently administering or which sessions are known to it, or it can be an instruction to shut down.
(Inherited from ScoringProgramDataConnectorClientCommandManager)
Protected methodLogError Logs an exception.
(Inherited from ScoringProgramDataConnectorClientCommandManager)
Protected methodLogMethodEntry(String) Logs the entry to a method with its parameters (if any).
(Inherited from ScoringProgramDataConnectorClientCommandManager)
Public methodLogMethodEntry(String, ValueTupleString, Object) Logs the entry to a method with its parameters (if any),
(Inherited from DataConnectorClientCommandManagerTCommand)
Public methodPing Communicates to the Data Connector synchronously to see if it is responsive. This is done by sending a random piece of data and checking of the Data Connector returns it.
(Inherited from ScoringProgramDataConnectorClientCommandManager)
Public methodPingAsync Communicates to the Data Connector asynchronously to see if it is responsive. This is done by sending a random piece of data and checking of the Data Connector returns it.
(Inherited from ScoringProgramDataConnectorClientCommandManager)
Public methodPollForHandrecords Polls the Data Connector synchronously for new handrecords for the session,
(Inherited from ScoringProgramDataConnectorClientCommandManager)
Public methodPollForHandrecordsAsync Polls the Data Connector asynchronously for new handrecords for the session,
(Inherited from ScoringProgramDataConnectorClientCommandManager)
Public methodPollForParticipations Polls the client queue synchronously for new participations for the specified session.
(Inherited from ScoringProgramDataConnectorClientCommandManager)
Public methodPollForParticipationsAsync Polls the client queue asynchronously for new participations for the specified session.
(Inherited from ScoringProgramDataConnectorClientCommandManager)
Public methodPollForPlayerData Polls the client queue asynchronously for new player data for the specified session.
(Inherited from ScoringProgramDataConnectorClientCommandManager)
Public methodPollForPlayerDataAsync Polls the client queue asynchronously for new player data for the specified session.
(Inherited from ScoringProgramDataConnectorClientCommandManager)
Public methodPollForResults Polls the client queue for new boardresults synchronously. Required. The guid of the session to poll participations for.Poll all results for the session, included ones polled before.
(Inherited from ScoringProgramDataConnectorClientCommandManager)
Public methodPollForResultsAsync Polls the client queue for new boardresults asynchronously. Required. The guid of the session to poll participations for.Poll all results for the session, included ones polled before.
(Inherited from ScoringProgramDataConnectorClientCommandManager)
Public methodSendBridgemate2Settings Adds or updates the Bridgemate 2 settings for the given sections synchronously. There can and must be one dto per section. The section letters cannot be left out!
(Inherited from ScoringProgramDataConnectorClientCommandManager)
Public methodSendBridgemate2SettingsAsync Adds or updates the Bridgemate 2 settings for the given sections asynchronously. There can and must be one dto per section. The section letters cannot be left out.
(Inherited from ScoringProgramDataConnectorClientCommandManager)
Public methodSendBridgemate3Settings Adds or updates the Bridgemate 3 settings for the given sections synchronously. There can and must be one dto per section. The section letters cannot be left out!
(Inherited from ScoringProgramDataConnectorClientCommandManager)
Public methodSendBridgemate3SettingsAsync Adds or updates the Bridgemate 3 settings for the given sections asynchronously. There can and must be one dto per section. The section letters cannot be left out!
(Inherited from ScoringProgramDataConnectorClientCommandManager)
Protected methodSendData The code that handles the actual sending of requests and reading their reponses aynchronously.
(Overrides ScoringProgramDataConnectorClientCommandManagerSendData(String, ScoringProgramDataConnectorCommands, String, String))
Protected methodSendDataAsync The code that handles the actual sending of requests and reading their reponses aynchronously.
(Overrides ScoringProgramDataConnectorClientCommandManagerSendDataAsync(String, ScoringProgramDataConnectorCommands, String, String))
Public methodSendHandrecords Sends handrecords synchronously to the BCS queue.
(Inherited from ScoringProgramDataConnectorClientCommandManager)
Public methodSendHandrecordsAsync Sends handrecords asynchronously to the BCS queue.
(Inherited from ScoringProgramDataConnectorClientCommandManager)
Public methodSendParticipations Sends participations asynchronously to the BCS queue.
(Inherited from ScoringProgramDataConnectorClientCommandManager)
Public methodSendParticipationsAsync Sends participations asynchronously to the BCS queue.
(Inherited from ScoringProgramDataConnectorClientCommandManager)
Public methodSendPlayerData Sends PlayerData synchronously to the BCS queue.
(Inherited from ScoringProgramDataConnectorClientCommandManager)
Public methodSendPlayerDataAsync Sends PlayerData asynchronously to the BCS queue.
(Inherited from ScoringProgramDataConnectorClientCommandManager)
Public methodSendResults Sends boardresults synchronously to the BCS queue
(Inherited from ScoringProgramDataConnectorClientCommandManager)
Public methodSendResultsAsync Sends boardresults asynchronously to the BCS queue
(Inherited from ScoringProgramDataConnectorClientCommandManager)
Public methodUpdateMovement Instructs BCS synchronously to update the movement for the given section. Be sure to include the movement for the section after its change. BCS will figure out how to adjust its data to enact the change. Mind that board results will be erased for each table starting from the lowest numbered round with different round data.
(Inherited from ScoringProgramDataConnectorClientCommandManager)
Public methodUpdateMovementAsync Instructs BCS asynchronously to update the movement for the given section. Be sure to include the movement for the section after its change. BCS will figure out how to adjust its data to enact the change. Mind that board results will be erased for each table starting from the lowest numbered round with different round data.
(Inherited from ScoringProgramDataConnectorClientCommandManager)
Public methodUpdateScoringGroups Instructs BCS synchronously to update the scoringgroups. This can be done to change the scoring method or to rearrange the sections that are attached to them.
(Inherited from ScoringProgramDataConnectorClientCommandManager)
Public methodUpdateScoringGroupsAsync Instructs BCS asynchronously to update the scoringgroups. This can be done to change the scoring method or to rearrange the sections that are attached to them.
(Inherited from ScoringProgramDataConnectorClientCommandManager)
Top
Fields
 NameDescription
Public fieldDataConnectorClientLogger NLog implementation of logging.
(Inherited from DataConnectorClientCommandManagerTCommand)
Public fieldPipeName The name of the pipe that handles the bidirectional communication with the Data Connector. Each Windows account must have its own pipe, hence the username of the logged in user (as Windows knows it) is appended. Tip: you can find the usernames as Windows knows them by going to the C:\Users folder.
Top
See Also