Пример #1
0
        }     // OnServiceFound()

        /// <summary>
        /// Called when an action has been found.
        /// </summary>
        /// <param name="nodeService">The node service.</param>
        /// <param name="action">The action.</param>
        private void OnActionFound(TreeNode nodeService, UpnpServiceAction action)
        {
#if SHOW_SEARCH_RESULTS
            log.Info($"            {action}");
#endif
            AddActionNode(nodeService, action);
        } // OnActionFound()
Пример #2
0
        } // AddServiceNode()

        /// <summary>
        /// Adds the action node.
        /// </summary>
        /// <param name="serviceNode">The service node.</param>
        /// <param name="action">The action.</param>
        private static void AddActionNode(TreeNode serviceNode, UpnpServiceAction action)
        {
            var node = new TreeNode(action.Name);

            node.ImageKey         = @"Action";
            node.SelectedImageKey = @"Action";
            node.Tag = new NodeData(NodeType.Action, action);

            serviceNode.Nodes.Add(node);
        } // AddActionNode()
Пример #3
0
        } // SwitchContentPanel()

        /// <summary>
        /// Switches to the action view.
        /// </summary>
        /// <param name="action">The action.</param>
        private void SwitchToActionView(UpnpServiceAction action)
        {
            if (this.actionView == null)
            {
                this.actionView = new ActionInfoControl();
            } // if

            this.SetCurrentViewControl(this.actionView);
            this.currentView       = this.actionView;
            this.actionView.Action = action;
        } // SwitchToActionView()
Пример #4
0
        } // ParseDidlItemMetaData()

        /*
         * <item id="33$@155" parentID="33$466" restricted="1" xmlns="urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/">
         * <dc:title xmlns:dc="http://purl.org/dc/elements/1.1/">DTH-Unplugged</dc:title>
         * <upnp:class xmlns:upnp="urn:schemas-upnp-org:metadata-1-0/upnp/">object.item.videoItem</upnp:class>
         * <dc:date xmlns:dc="http://purl.org/dc/elements/1.1/">2015-02-08T09:54:25</dc:date>
         * <res protocolInfo="http-get:*:video/avi:DLNA.ORG_OP=01;DLNA.ORG_FLAGS=01700000000000000000000000000000" resolution="512x384" size="698892352" bitrate="196265" duration="0:59:20.000" nrAudioChannels="2" sampleFrequency="44100">http://192.168.0.16:50002/v/NDLNA/155.avi</res>
         * </item>
         */

        /// <summary>
        /// Invokes an action.
        /// </summary>
        /// <param name="action">The action.</param>
        /// <param name="input">The input.</param>
        /// <returns>An <see cref="InvokeActionResult"/> object.</returns>
        private static async Task <InvokeActionResult> InvokeAction(UpnpServiceAction action, IEnumerable <object> input)
        {
            var soap   = new SOAP();
            var result = new InvokeActionResult();

            try
            {
                var res = await soap.Invoke(action.Service.ControlUrl,
                                            action.Service.Type, action, input.ToArray());

                result = res;
            }
            catch (Exception ex)
            {
                Log.Error("Error executing action", ex);
                result.Success = false;
            } // catch

            return(result);
        } // InvokeAction()