Ejemplo n.º 1
0
 public TreeChannel(TS3Channel chan, string parentcn)
 {
     this._Name             = chan.Title;
     this.ParentChannelName = parentcn;
     if (chan.HasPassword)
     {
         this._Icon = new BitmapImage(new Uri("pack://application:,,,/Ts3Tray;component/Resources/channel_locked.png"));
     }
     else
     {
         this._Icon = new BitmapImage(new Uri("pack://application:,,,/Ts3Tray;component/Resources/channel.png"));
     }
     if (chan.HasSubchannels)
     {
         parentcn = (string.IsNullOrEmpty(parentcn) ? this._Name : (parentcn + "/" + this._Name));
         foreach (TS3Channel current in chan.SubchannelList)
         {
             this._SubChannels.Add(new TreeChannel(current, parentcn));
         }
     }
     if (chan.HasUser)
     {
         foreach (TS3User current2 in chan.UserList)
         {
             this._ChannelUser.Add(new TreeUser(current2));
         }
     }
     if (chan.Codec == 3)
     {
         this.AddXtras("pack://application:,,,/Ts3Tray;component/Resources/channel_music.png");
     }
     if (chan.IsDefault)
     {
         this.AddXtras("pack://application:,,,/Ts3Tray;component/Resources/home.png");
     }
     if (chan.HasPassword)
     {
         this.AddXtras("pack://application:,,,/Ts3Tray;component/Resources/locked.png");
         this._NeedPassword = true;
     }
 }
Ejemplo n.º 2
0
 private List <string> parseuser(List <string> map, TS3Channel chan)
 {
     if (chan.HasUser)
     {
         foreach (TS3User current in chan.UserList)
         {
             if (!map.Contains(current.Name))
             {
                 map.Add(current.Name);
             }
         }
     }
     if (chan.HasSubchannels)
     {
         foreach (TS3Channel current2 in chan.SubchannelList)
         {
             map = this.parseuser(map, current2);
         }
     }
     return(map);
 }