public DaapSource (DAAP.Service service) : base (Catalog.GetString ("Music Share"), service.Name, (service.Address.ToString () + service.Port).Replace (":", "").Replace (".", ""), 300, true) { this.service = service; Properties.SetString ("UnmapSourceActionLabel", Catalog.GetString ("Disconnect")); Properties.SetString ("UnmapSourceActionIconName", "gtk-disconnect"); SupportsPlaylists = false; SavedCount = 0; UpdateIcon (); AfterInitialized (); }
public DaapSource(DAAP.Service service) : base(Catalog.GetString("Music Share"), service.Name, (service.Address.ToString() + service.Port).Replace(":", "").Replace(".", ""), 300) { this.service = service; Properties.SetString("UnmapSourceActionLabel", Catalog.GetString("Disconnect")); Properties.SetString("UnmapSourceActionIconName", "gtk-disconnect"); SupportsPlaylists = false; SavedCount = 0; UpdateIcon(); AfterInitialized(); }
private void AddDaapServer (Service service) { ThreadAssist.ProxyToMain (delegate { DaapSource source = new DaapSource (service); string key = String.Format ("{0}:{1}", service.Name, service.Port); if (source_map.Count == 0) { ServiceManager.SourceManager.AddSource (container); } if (source_map.ContainsKey (key)) { // Received new connection info for service container.RemoveChildSource (source_map [key]); source_map [key] = source; } else { // New service information source_map.Add (key, source); } container.AddChildSource (source); // Don't flash shares we find on startup (well, within 5s of startup) if ((DateTime.Now - locator_started).TotalSeconds > 5) { source.NotifyUser (); } }); }
public Client(Service service) : this(service.Address, service.Port) { }
public ServiceArgs(Service service) { this.service = service; }
protected override void Run() { try { NativeDaap.Client tmp_client = new NativeDaap.Client (address, port); service = new Service (address, port, tmp_client.Name, tmp_client.AuthenticationMethod != AuthenticationMethod.None); } catch (WebException) { // On error, create a dummy service service = new Service (address, port, server, false); } OnFinished (); }