Beispiel #1
0
 protected void OnDeviceFound(SatIpDeviceFoundArgs args)
 {
     if (DeviceFound != null)
     {
         DeviceFound(this, args);
     }
 }
Beispiel #2
0
        private void DeviceFound(object sender, SatIpDeviceFoundArgs args)
        {
            if (InvokeRequired)
            {
                this.BeginInvoke((MethodInvoker) delegate
                {
                    DeviceFound(sender, args);
                });
                return;
            }
            var servernode = treeView1.Nodes[0].Nodes.Add(args.Device.UniqueDeviceName, args.Device.FriendlyName);

            servernode.ToolTipText = args.Device.DeviceDescription;
            foreach (var tuner in args.Device.Tuners)
            {
                switch (tuner.Type)
                {
                case TunerType.Cable:
                    servernode.Nodes.Add("Cable");
                    break;

                case TunerType.Satellite:
                    servernode.Nodes.Add("Satellite");
                    break;

                case TunerType.Terrestrial:
                    servernode.Nodes.Add("Terrestrial");
                    break;
                }
            }
            if (treeView1.Nodes[0].IsExpanded != true)
            {
                treeView1.Nodes[0].Expand();
            }
        }
        private void DeviceFound(object sender, SatIpDeviceFoundArgs args)
        {
            if (InvokeRequired)
            {
                BeginInvoke((MethodInvoker) delegate { DeviceFound(sender, args); });
                return;
            }

            var servernode = treeView1.Nodes[0].Nodes.Add(args.Device.UniqueDeviceName, args.Device.FriendlyName);

            servernode.ToolTipText = args.Device.DeviceDescription;
            servernode.Tag         = args.Device;
            args.Device.RtspSession.Describe();
            foreach (var tuner in args.Device.Tuners)
            {
                switch (tuner.Type)
                {
                case TunerType.Cable:
                    var dvbcnode = new TreeNode("DVBC Tuner");
                    dvbcnode.Tag = new CableTuner();
                    servernode.Nodes.Add(dvbcnode);
                    break;

                case TunerType.Satellite:
                    var dvbsnode = new TreeNode("DVBS Tuner");
                    dvbsnode.Tag = new SatelliteTuner();
                    servernode.Nodes.Add(dvbsnode);
                    break;

                case TunerType.Terrestrial:
                    var dvbtnode = new TreeNode("DVBT Tuner");
                    dvbtnode.Tag = new TerrestrialTuner();
                    servernode.Nodes.Add(dvbtnode);
                    break;
                }
            }
            if (treeView1.Nodes[0].IsExpanded != true)
            {
                treeView1.Nodes[0].Expand();
            }
        }