public UPnPConfigPackage(IIpConfig ip, IUPnPConfig upnp, IXMLWriter xw, List<string>servicepath)
 {
     IpConf = ip;
     UpnpConf = upnp;
     XmlWr = xw;
     ServiceConfPaths = servicepath;
 }
 public XMLServicesConfig(List<string> paths, IXMLWriter writer)
 {
     foreach (string path in paths)
     {
         LoadConfig(path);
         writer.GenServiceDescription(deviceType, _functions);
         _functions.Clear();
     }
 }
Exemplo n.º 3
0
        public UPnP(IUPnPConfigPackage config)
        {
            IpConf = config.IpConf;
            UpnpConf = config.UpnpConf;
            XmlWriter = config.XmlWr;

            XmlWriter.GenDeviceDescription(UpnpConf);

            XMLServicesConfig ServiceConf = new XMLServicesConfig(config.ServiceConfPaths);

            TCPServer = new TcpServer(IpConf.IP, IpConf.TCPPort);
            UDPServer = new UDPHandler(IpConf, UpnpConf);
            UDPServer.Start();

            SubscribeToUpnpEvents();
        }
Exemplo n.º 4
0
        private void InitializeWriter(Type type)
        {
            if (typeof(Book) == type)
            {
                writer = new BookXMLWriter();
                return;
            }
            if (typeof(Newspaper) == type)
            {
                writer = new NewspaperXMLWriter();
                return;
            }
            if (typeof(Patent) == type)
            {
                writer = new PatentXMLWriter();
                return;
            }

            writer = null;
        }
Exemplo n.º 5
0
 public CartRepository(IXMLReader xMLReader, IXMLWriter xMLWriter)
 {
     _xMLReader = xMLReader;
     _xMLWriter = xMLWriter;
 }