diff --git a/CSharp/App/Modules/BehaviorTreeModule/ListToStringConverter.cs b/CSharp/App/Modules/BehaviorTreeModule/ListToStringConverter.cs index 74e62a3146241f7b1935c940762a620f9a76b271..f1e7261e8d3733989f8ee5da4251ff3577569a94 100644 --- a/CSharp/App/Modules/BehaviorTreeModule/ListToStringConverter.cs +++ b/CSharp/App/Modules/BehaviorTreeModule/ListToStringConverter.cs @@ -15,7 +15,7 @@ namespace Modules.BehaviorTreeModule { return ""; } - var list = (List) value; + var list = ((List) value); return String.Join(",", list); } @@ -25,7 +25,7 @@ namespace Modules.BehaviorTreeModule { return new List(); } - var s = (string) value; + string s = (string) value; s = s.Trim(); if (s == "") { diff --git a/CSharp/App/Modules/BehaviorTreeModule/NodeDataEditor.xaml.cs b/CSharp/App/Modules/BehaviorTreeModule/NodeDataEditor.xaml.cs index b0b1181a9d7f4d1845906f1cf6ec2e0fc21aba1c..06fe5f944f3501646d42719ef7fdce0b32d3d959 100644 --- a/CSharp/App/Modules/BehaviorTreeModule/NodeDataEditor.xaml.cs +++ b/CSharp/App/Modules/BehaviorTreeModule/NodeDataEditor.xaml.cs @@ -1,7 +1,6 @@ using System; using System.Windows; using System.Windows.Controls; -using Common.Helper; namespace Modules.BehaviorTreeModule { @@ -10,11 +9,14 @@ namespace Modules.BehaviorTreeModule /// public partial class NodeDataEditor { + private readonly string[] nodeTypes; + public NodeDataEditor() { this.InitializeComponent(); - string[] nodeTypes = Enum.GetNames(typeof (NodeType)); + nodeTypes = Enum.GetNames(typeof (NodeType)); + Array.Sort(nodeTypes); this.cbType.ItemsSource = nodeTypes; } @@ -38,7 +40,9 @@ namespace Modules.BehaviorTreeModule { return; } - this.cbType.SelectedIndex = EnumHelper.EnumIndex(this.TreeNodeViewModel.Type); + string typeStr = ((NodeType) this.TreeNodeViewModel.Type).ToString(); + int selectIndex = Array.IndexOf(nodeTypes, typeStr); + this.cbType.SelectedIndex = selectIndex; } private void CbType_OnSelectionChanged(object sender, SelectionChangedEventArgs e) diff --git a/CSharp/Platform/Network/IService.cs b/CSharp/Platform/Network/IService.cs index 385f3d209ac11f452551c9aa7c62aa53f4b21551..311004c23e05c0592dc1987abf306bcf1d935f67 100644 --- a/CSharp/Platform/Network/IService.cs +++ b/CSharp/Platform/Network/IService.cs @@ -19,8 +19,6 @@ namespace Network Task GetChannel(string host, int port); - Task GetChannel(string address); - Task GetChannel(); void Remove(IChannel channel); diff --git a/CSharp/Platform/TNet/TService.cs b/CSharp/Platform/TNet/TService.cs index 8704ad42aa717c9e4395eac3aa7a5f2b42b045cb..1f3f2767250c78af40ecaa5f1a2147d48ea1215c 100644 --- a/CSharp/Platform/TNet/TService.cs +++ b/CSharp/Platform/TNet/TService.cs @@ -108,13 +108,6 @@ namespace TNet return await ConnectAsync(host, port); } - public async Task GetChannel(string address) - { - string[] ss = address.Split(':'); - int port = Convert.ToInt32(ss[1]); - return await GetChannel(ss[0], port); - } - public void RunOnce(int timeout) { poller.Run(timeout); diff --git a/CSharp/Platform/UNet/UService.cs b/CSharp/Platform/UNet/UService.cs index 22889b2bd53fb0a0c12a2d0c912d30dea1b45f6b..c37db18d4a38d2a8c48f2b91f8a92fefbf7af8d3 100644 --- a/CSharp/Platform/UNet/UService.cs +++ b/CSharp/Platform/UNet/UService.cs @@ -67,13 +67,6 @@ namespace UNet return channel; } - public async Task GetChannel(string address) - { - string[] ss = address.Split(':'); - int port = Convert.ToInt32(ss[1]); - return await GetChannel(ss[0], port); - } - public async Task GetChannel(string host, int port) { UChannel channel = null;