C# Class ExamplesChat.Android.ChatAppBase

In an attempt to keep things as clear as possible all shared implementation across chat examples has been provided in this base class.
显示文件 Open project: MarcFletcher/NetworkComms.Net

Protected Properties

Property Type Description
lastPeerMessageDict ChatMessage>.Dictionary

Public Methods

Method Description
AppendLineToChatHistory ( string message ) : void

Append the provided message to the chat history text box.

ChatAppBase ( string name, ConnectionType connectionType ) : System

Constructor for ChatAppBase

ClearChatHistory ( ) : void

Clears the chat history

ClearInputLine ( ) : void

Clears the input text box

PrintUsageInstructions ( ) : void

Outputs the usage instructions to the chat window

RefreshNetworkCommsConfiguration ( ) : void

Updates the configuration of this instance depending on set fields

SendMessage ( string stringToSend ) : void

Send a message.

ShowMessage ( string message ) : void

Show a message box as an alternative to writing to the chat history

Protected Methods

Method Description
HandleIncomingChatMessage ( PacketHeader header, Connection connection, ChatMessage incomingMessage ) : void

Performs whatever functions we might so desire when we receive an incoming ChatMessage

Private Methods

Method Description
HandleConnectionClosed ( Connection connection ) : void

Performs whatever functions we might so desire when an existing connection is closed.

Method Details

AppendLineToChatHistory() public abstract method

Append the provided message to the chat history text box.
public abstract AppendLineToChatHistory ( string message ) : void
message string Message to be appended
return void

ChatAppBase() public method

Constructor for ChatAppBase
public ChatAppBase ( string name, ConnectionType connectionType ) : System
name string
connectionType ConnectionType
return System

ClearChatHistory() public abstract method

Clears the chat history
public abstract ClearChatHistory ( ) : void
return void

ClearInputLine() public abstract method

Clears the input text box
public abstract ClearInputLine ( ) : void
return void

HandleIncomingChatMessage() protected method

Performs whatever functions we might so desire when we receive an incoming ChatMessage
protected HandleIncomingChatMessage ( PacketHeader header, Connection connection, ChatMessage incomingMessage ) : void
header NetworkCommsDotNet.PacketHeader The PacketHeader corresponding with the received object
connection Connection The Connection from which this object was received
incomingMessage ChatMessage The incoming ChatMessage we are after
return void

PrintUsageInstructions() public method

Outputs the usage instructions to the chat window
public PrintUsageInstructions ( ) : void
return void

RefreshNetworkCommsConfiguration() public method

Updates the configuration of this instance depending on set fields
public RefreshNetworkCommsConfiguration ( ) : void
return void

SendMessage() public method

Send a message.
public SendMessage ( string stringToSend ) : void
stringToSend string
return void

ShowMessage() public abstract method

Show a message box as an alternative to writing to the chat history
public abstract ShowMessage ( string message ) : void
message string Message to be output
return void

Property Details

lastPeerMessageDict protected_oe property

Dictionary to keep track of which peer messages have already been written to the chat window
protected Dictionary lastPeerMessageDict
return ChatMessage>.Dictionary