void PeerReload() { if (UniP2PManager.GetPeerCount() != 0) { peerInfoTreeView.Reload(); } Repaint(); }
void OnGUI() { RenderHeadPanel(); if (EnableAutoReload && UniP2PManager.GetPeerCount() != c_count) { PeerReload(); c_count = UniP2PManager.GetPeerCount(); } SplitterGUILayout.BeginVerticalSplit(this.splitterState, EmptyLayoutOption); { RenderTable(); } SplitterGUILayout.EndVerticalSplit(); }
protected override TreeViewItem BuildRoot() { var rootItem = new TreeViewItem { depth = -1 }; var children = new List <TreeViewItem>(); var index = 1; foreach (var peer in UniP2PManager.GetAllPeer()) { children.Add(new PeerInfoItem(index++, peer)); } CurrentBindingItems = children; rootItem.children = CurrentBindingItems as List <TreeViewItem>; return(rootItem); }