public MapSelectForm() { InitializeComponent(); treeView1.Nodes.Clear(); _selectedNode = treeView1.Nodes.Add("", "Top"); try { MessageCommunicationManager.Start(EnvironmentManager.Instance.MasterSite.ServerId); _client = MessageCommunicationManager.Get(EnvironmentManager.Instance.MasterSite.ServerId); //System.Threading.Thread.Sleep(500); bool x = _client.IsConnected; _msgObject = _client.RegisterCommunicationFilter(MapResponseHandler, new CommunicationIdFilter(MessageId.Server.GetMapResponse)); MapRequestData data = new MapRequestData() { MapGuid = "", }; _client.TransmitMessage(new VideoOS.Platform.Messaging.Message(MessageId.Server.GetMapRequest, data), null, null, null); } catch (Exception ex) { MessageBox.Show("Map Select issue:" + ex.Message); } }
private void OnBeforeExpand(object sender, TreeViewCancelEventArgs e) { _selectedNode = e.Node; if (_selectedNode != null) { if (_selectedNode.Nodes.Count == 1 && _selectedNode.Nodes[0].Text == "Empty") { try { MapRequestData data = new MapRequestData() { MapGuid = SelectedMapId, }; _client.TransmitMessage( new VideoOS.Platform.Messaging.Message(MessageId.Server.GetMapRequest, data), null, null, null); } catch (Exception ex) { MessageBox.Show("Map Select issue:" + ex.Message); } } } }