本文整理汇总了C#中Client.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# Client.ToString方法的具体用法?C# Client.ToString怎么用?C# Client.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Client
的用法示例。
在下文中一共展示了Client.ToString方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TestClientRestarting
public void TestClientRestarting()
{
Client client = new Client();
client.Start();
client.Stop();
client.ToString(); // shouldn't throw an exception
client.Start();
client.Stop();
client.Dispose();
client.ToString();
}
示例2: UnPack
public void UnPack(Client client, Packet packet, IEventDispatcher eventDispatcher)
{
string ip = client.ToString().Split(':')[0];
ushort port = packet.Reader.ReadUInt16();
eventDispatcher.ThrowNewEvent(EventID, new MasterServerDatas {IP = ip, Port = port});
}
示例3: ReturnFormattedNameWithNoPreferredNameAsToString
public void ReturnFormattedNameWithNoPreferredNameAsToString()
{
var client = new Client()
{
FullName = new FullName("Steven", "Smith"),
Salutation = "Mr."
};
var expectedResult = "Mr. Steven Smith";
Assert.AreEqual(expectedResult, client.ToString());
}
示例4: UnPack
public void UnPack(Client client, Packet packet, IEventDispatcher eventDispatcher)
{
eventDispatcher.ThrowNewEvent(EventID,
new MasterServerDatas
{
IP = client.ToString().Split(':')[0],
Port = packet.Reader.ReadUInt16(),
Map = packet.Reader.ReadString(),
MaxPlayer = packet.Reader.ReadByte(),
ConnectedPlayer = packet.Reader.ReadByte()
});
}
示例5: okButton_Click
private void okButton_Click(object sender, RoutedEventArgs e) {
string fName = firstNameTextBox.Text.ToString();
string lName = lastNameTextBox.Text.ToString();
Client newClient = new Client(fName, lName);
DataManager.AddClient(newClient);
main.listView1.ItemsSource = DataManager.NameList;
main.listView1.SelectedItem = newClient.ToString();
main.UpdateClientInfo();
this.Close();
}
示例6: Main
public static void Main(string[] args)
{
GLib.GType.Init ();
GLib.Thread.Init ();
Client client = new Client (new string[] {null});
client.Uevent += HandleClientUevent;
Console.WriteLine ("Created client {0}", client.ToString());
foreach (string sub in client.Subsystems) {
// if (string.IsNullOrEmpty (sub))
// continue;
Console.WriteLine ("Looking at subsystem: {0}", sub);
foreach (Device device in client.QueryBySubsystem (sub)) {
Console.WriteLine ("Looking at:\n\t {0} ({1})\n\t{2}", string.IsNullOrEmpty (device.Name) ? "nameless device" : device.Name,
device.Number, device.DeviceFile);
}
}
GLib.MainLoop loop = new GLib.MainLoop ();
loop.Run ();
}
示例7: Command
public Command(Client.CommandName commandName, params string[] options): this(commandName.ToString(), options)
{
}
示例8: ClientStart
void ClientStart(IPEndPoint _ipMyPoint,IPEndPoint _ipTargetPoint)
{
NetwInterfaceEx = new Client();
MessageServiceClass.MessageProcessing ("Client was created"+NetwInterfaceEx.ToString()+"with target"+_ipTargetPoint.Address.AddressFamily);
NetwInterfaceEx.StartMain(_ipMyPoint, _ipTargetPoint);
}