Beispiel #1
0
        static void Auto3DUPnP_ServiceFound(object sender, ServiceEventArgs e)
        {
            foreach (ServiceCallBack scb in _serviceCallbacks)
              {
            bool bNameCheck = true;

            if (scb.Callback.UPnPManufacturer != "")
            {
              bNameCheck = e.Service.ParentDevice.Manufacturer.StartsWith(scb.Callback.UPnPManufacturer);
            }

            using (Settings reader = new MPSettings())
            {
            bool logOnlyKnownDevices = reader.GetValueAsBool("Auto3DPlugin", "LogOnlyKnownDevices", true);

            if (((scb.Callback.UPnPServiceName == e.Service.ServiceType) || (e.Service.ServiceType.Contains(scb.Callback.UPnPServiceName))) && bNameCheck && !scb.ClientNotified)
            {
                LogService(e.Service, true, true);

                scb.Callback.ServiceAdded(e.Service);
                scb.ClientNotified = true;
            }
            else
                if (!logOnlyKnownDevices)
                    LogService(e.Service, false, true);
            }
              }
        }
Beispiel #2
0
        static void Auto3DUPnP_ServiceFound(object sender, ServiceEventArgs e)
        {
            foreach (ServiceCallBack scb in _serviceCallbacks)
            {
                bool bNameCheck = true;

                if (scb.Callback.UPnPManufacturer != "")
                {
                    bNameCheck = e.Service.ParentDevice.Manufacturer.StartsWith(scb.Callback.UPnPManufacturer);
                }

                using (Settings reader = new MPSettings())
                {
                    bool logOnlyKnownDevices = reader.GetValueAsBool("Auto3DPlugin", "LogOnlyKnownDevices", true);

                    if (((scb.Callback.UPnPServiceName == e.Service.ServiceType) || (e.Service.ServiceType.Contains(scb.Callback.UPnPServiceName))) && bNameCheck && !scb.ClientNotified)
                    {
                        LogService(e.Service, true, true);

                        scb.Callback.ServiceAdded(e.Service);
                        scb.ClientNotified = true;
                    }
                    else
                    if (!logOnlyKnownDevices)
                    {
                        LogService(e.Service, false, true);
                    }
                }
            }
        }