public void getUPnPSource(UPnP_SourceFunctions e, EventArgs s)
 {
     _UPnPSource = e;
     MessageBox.Show("Source added");
 }
        /// <summary>
        /// Eventfunction that is run when an UPnP source is detected on the network. Only accepts sources with the friendly name: "HiPi - Source". 
        /// If it has the right name then it creates one stacks (ContentDirectory)
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="d"></param>
        private void AddSource(MediaServerDiscovery sender, UPnPDevice d)
        {
            Console.WriteLine("Added Source Device: " + d.FriendlyName);

            if (d.FriendlyName == "HiPi - Source")
            {
                UPnP_SourceFunctions func = new UPnP_SourceFunctions(null,
                    //new SourceStack.CpConnectionManager(d.GetServices(SourceStack.CpConnectionManager.SERVICE_NAME)[0]),
                    new SourceStack.CpContentDirectory(d.GetServices(SourceStack.CpContentDirectory.SERVICE_NAME)[0]));

                AddSourceEvent(func, null);
            }
        }
 public void getUPnPSource(UPnP_SourceFunctions e, EventArgs s)
 {
     _UPnPSource = e;
     _UPnPSource.BrowseResult += getResult;
     _UPnPSource.Browse("all");
     _UPnPSource.Browse("playqueue");
 }