Results 61 to 75 of 110
-
28-10-2010, 18:02 #61
-= TeamSpeak Addict =-
- Join Date
- Dec 2009
- Location
- Germany
- Posts
- 115
Which dispatcher are you using? Notifications only work with the Async one.
The sync one is, as the name suggests, not meant to be async like events.Last edited by Scordo; 28-10-2010 at 19:34.
-
28-10-2010, 19:30 #62
-= TeamSpeak User =-
- Join Date
- Oct 2010
- Location
- Germany
- Posts
- 13
Okay, that explains it.
-
28-10-2010, 19:33 #63
-= TeamSpeak Addict =-
- Join Date
- Dec 2009
- Location
- Germany
- Posts
- 115
An example on how to use the asnyc one can be found within the project "TS3ServerManager" on the project page.
-
02-11-2010, 19:40 #64
-= TeamSpeak User =-
- Join Date
- Nov 2010
- Location
- Germany
- Posts
- 3
hi ,
i try to use the lib with wpf vb.net
connecting to a server,selectserverbyid, recieving client or channel list are no problem
but if i try to use the getchanneltree function
i get a list of channels i think but they are all named
"Ts3QueryLib.Core.Common.ChannelTreeItem"
i get 3 of them and i have 3 channels on my test server
but no clients in this list and no channel names xD
the two code snippets below show how i try to call the function
i hope you can explain me how to call it right
Code:Dim cl As List(Of ChannelListEntry) = Ts3qr.GetChannelList.Values Dim clientl As List(Of ClientListEntry) = Ts3qr.GetClientList.Values TreeView1.ItemsSource = QueryUtils.GetChannelTree(cl, clientl)
Code:TreeView1.ItemsSource = Ts3qr.Utils.GetChannelTree(True)
Last edited by Nerenye; 02-11-2010 at 20:01.
-
02-11-2010, 20:20 #65
-= TeamSpeak Lover =-
- Join Date
- Jan 2010
- Location
- Germany
- Posts
- 29
Sorry I'm not familiar with VB

The TreeView needs to know which properties you want to display.
I think I converted the ChannelTreeItems to my own class like this:
This way it is easy to display the stuff you want in the TreeView with an ItemTemplate like this.Code:public class TeamspeakTreeItem { private List<TeamspeakTreeItem> _subItems; public List<TeamspeakTreeItem> SubItems { get { return _subItems; } set { _subItems = value; } } public string Name { get; set; } public Uri ImageSource { get; set; } public ChannelTreeItem OriginalItem { get; set; } public TeamspeakTreeItem (string name, Uri imageSource, ChannelTreeItem originalItem) { this._subItems = new List<TeamspeakTreeItem>(); this.Name = name; this.ImageSource = imageSource; this.OriginalItem = originalItem; } }
Code:<TreeView.ItemTemplate> <HierarchicalDataTemplate ItemsSource="{Binding SubItems}"> <StackPanel Orientation="Horizontal"> <Image Source="{Binding ImageSource}" Width="15" Height="15"/> <TextBlock Text="{Binding Name}"/> </StackPanel> </HierarchicalDataTemplate> </TreeView.ItemTemplate>
-
02-11-2010, 20:36 #66
-= TeamSpeak User =-
- Join Date
- Nov 2010
- Location
- Germany
- Posts
- 3
HI thanks for the quick reply but i have problems with your solution
you said i have to show the items with an item template but how can i set it
in my settings tab of treeview i can take a resource or databinding
how can i set the template or where i have to write the template?
and i aktually donīt understand how to call these functions
had i to call the original function on one of the ways i postet below ?
-
02-11-2010, 23:28 #67
-= TeamSpeak Addict =-
- Join Date
- Dec 2009
- Location
- Germany
- Posts
- 115
Here is how to get it all mixed up for WPF.
C#
XAMLCode:private void button1_Click(object sender, System.Windows.RoutedEventArgs e) { ChannelTreeView.ItemsSource = GetChannelTreeForTreeView(QueryRunner); } private static IEnumerable<TreeItem> GetChannelTreeForTreeView(QueryRunner queryRunner) { List<ChannelTreeItem> channelTree = queryRunner.Utils.GetChannelTree(false); foreach (ChannelTreeItem channelTreeItem in channelTree) { TreeItem treeViewItem = new TreeItem { Data = channelTreeItem.Channel }; FillTreeViewItem(treeViewItem, channelTreeItem); yield return treeViewItem; } } private static void FillTreeViewItem(TreeItem treeViewItem, ChannelTreeItem channelTreeItem) { foreach (ClientListEntry clientListEntry in channelTreeItem.Clients) treeViewItem.Children.Add(new TreeItem { Data = clientListEntry }); foreach (ChannelTreeItem childChannelTreeItem in channelTreeItem.Children) { TreeItem childTreeViewItem = new TreeItem { Data = childChannelTreeItem.Channel }; treeViewItem.Children.Add(childTreeViewItem); FillTreeViewItem(childTreeViewItem, childChannelTreeItem); } } public class TreeItem { public object Data { get; set; } public List<TreeItem> Children { get; private set; } public TreeItem() { Children = new List<TreeItem>(); } }
You can change the DataTemplates to extend the style and to include more info or images.Code:<TreeView x:Name="ChannelTreeView" Height="398" HorizontalAlignment="Left" Margin="26,18,0,0" VerticalAlignment="Top" Width="372"> <TreeView.Resources> <HierarchicalDataTemplate DataType="{x:Type Controls:MainAreaControl+TreeItem}" ItemsSource="{Binding Children}"> <ContentPresenter Content="{Binding Data}"/> </HierarchicalDataTemplate> <DataTemplate DataType="{x:Type HelperClasses:ChannelListEntry}"> <TextBlock Text="{Binding Path=Name}" /> </DataTemplate> <DataTemplate DataType="{x:Type HelperClasses:ClientListEntry}" > <TextBlock Text="{Binding Path=Nickname}" /> </DataTemplate> </TreeView.Resources> </TreeView>
The "false" in the following code means "do not use cached values, always do a call to the queryport to get channels and users". When using "true" the channels and users are only received once and then cached for further calls to "GetChannelTree":
queryRunner.Utils.GetChannelTree(false);
Bye,
SCO
-
05-11-2010, 17:35 #68
-= TeamSpeak User =-
- Join Date
- Nov 2010
- Location
- Germany
- Posts
- 3
Sry but this is not working vor me
iīm working with vb and not with c#
i tryed to convert the code but i still have errors left
thanks for your help
i try to write my own funktion to show channels and clients
with labels
-
07-11-2010, 01:22 #69
-= TeamSpeak Addict =-
- Join Date
- Dec 2009
- Location
- Germany
- Posts
- 115
I've created a little sample app about how to use the AsyncTcpDispatcher.
You can download it here:
QueryLibSamples.zip
-
28-11-2010, 16:18 #70
-= TeamSpeak Addict =-
- Join Date
- Dec 2009
- Location
- Germany
- Posts
- 115
New Version 0.30.25.0
Due to the recent beta 30 release I've created a new release of the library. You can download it here:
http://ts3querylib.codeplex.com/releases/view/54586
Changes:
- Added new event "TokenUsed" to QueryRunner.Notifications (beta 30 change)
- Added properties SortId and NameMode to ChannelGroup class which is used by QueryRunner.GetChannelGrouLists(). (beta 30 change)
- Added method GetOwnPermissionDetails to QueryRunner class. This method reflects the new "permget" command. (beta 30 change)
- Added property ParentChannelId to class ChannelInfoResponse which is used in QueryRunner.GetChannelInfo(..) (beta 30 change)
- Added properties ClientCreated and ClientLastConnected to ClientListEntry class used by QueryRunner.GetClientList (beta 30 change)
- Added ServerPort to WhoAmIResponse class which is used in QueryRunner.SendWhoAmI(). (beta 30 change)
Please report bugs and feel free to criticize me
SCO
-
28-11-2010, 17:12 #71
-= TeamSpeak Addict =-
- Join Date
- Dec 2009
- Location
- Switzerland
- Posts
- 246
Thx for the great job
-
24-05-2011, 21:11 #72
-= TeamSpeak Addict =-
- Join Date
- Dec 2009
- Location
- Germany
- Posts
- 115
Just to let you know: This project is alive and with the new Windows Phone 7.1 SDK Release I'm going to implement support for Windows Phone 7 - Sockets are available there
.
-
25-05-2011, 12:32 #73
-= TeamSpeak Addict =-
- Join Date
- Dec 2009
- Location
- Switzerland
- Posts
- 246
Thx for the info
-
16-06-2011, 19:12 #74
-= TeamSpeak Addict =-
- Join Date
- Jan 2010
- Location
- US
- Posts
- 135
-
16-06-2011, 20:49 #75
-= TeamSpeak Addict =-
- Join Date
- Dec 2009
- Location
- Germany
- Posts
- 115
The version under source control @ codeplex already supports wp7 but i had no verve to release a new version.
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
BUG? Repeated query client connect/diconnect
By HHD_HELLBOUND in forum Bug ReportsReplies: 5Last Post: 09-02-2012, 08:04 -
[Solved] Normal user ban others?
By Morfi in forum Server SupportReplies: 21Last Post: 23-03-2010, 15:13 -
Beta 15 Crashing?
By MaXXimus in forum Linux / FreeBSDReplies: 4Last Post: 25-01-2010, 11:52 -
Query Port connection returns "ERROR: invalid id"
By Polecr0c in forum [TeamSpeak 2] Server SupportReplies: 2Last Post: 11-05-2006, 09:05


Reply With Quote
