Пример #1
0
 public Server (Root root, Uri url)
 {
     if (root == null) {
         throw new ArgumentNullException ("root");
     }
     
     this.root = root;
     
     if (url == null) {
         url = MakeUrl ();
     }
     
     var serializer = Helper.Get<XmlSerializer> (static_serializer);
     root.Initialize (serializer, url);
     // FIXME this is a test
     description_server = new DataServer (serializer.GetBytes (root), @"text/xml", url);
     ssdp_server = new SsdpServer (url.ToString ());
     ssdp_server.Announce ("upnp:rootdevice", root.RootDevice.Udn + "::upnp:rootdevice", false);
     AnnounceDevice (root.RootDevice);
 }
Пример #2
0
 protected internal virtual void Initialize (Root root, string iconUrlFragment)
 {
     if (iconUrlFragment == null) {
         throw new ArgumentNullException ("iconUrlFragment");
     }
     
     Initialize (root);
     UrlFragment = iconUrlFragment;
     server = new DataServer (Data, MimeType, Url);
 }