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

get and set the connection's name #11

Open
wants to merge 2 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
2 changes: 1 addition & 1 deletion ExampleCLI/ExampleCLI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<OutputPath>..\bin\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
Expand Down
2 changes: 1 addition & 1 deletion ExampleGUI/ExampleGUI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<OutputPath>..\bin\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
Expand Down
12 changes: 10 additions & 2 deletions ExampleGUI/FormServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,16 @@ private void buttonSend_Click(object sender, EventArgs e)
{
if (string.IsNullOrWhiteSpace(textBoxMessage.Text))
return;

_server.PushMessage(textBoxMessage.Text);
if (listBoxClients.SelectedItem == null)
{
_server.PushMessage(textBoxMessage.Text);
}
else
{
var name = listBoxClients.SelectedItem.ToString();
_server.PushMessage(textBoxMessage.Text, name);
}

textBoxMessage.Text = "";
}
}
Expand Down
2 changes: 1 addition & 1 deletion NamedPipeWrapper/NamedPipeConnection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public class NamedPipeConnection<TRead, TWrite>
/// <summary>
/// Gets the connection's name.
/// </summary>
public string Name { get; }
public string Name { get; set; }

/// <summary>
/// Gets a value indicating whether the pipe is connected or not.
Expand Down
2 changes: 1 addition & 1 deletion NamedPipeWrapper/NamedPipeWrapper.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<OutputPath>..\bin\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
Expand Down