示例#1
0
文件: UPNP.cs 项目: tngraf/UPnP
        } // ParseAction()

        /// <summary>
        /// Parses the argument.
        /// </summary>
        /// <param name="element">The element.</param>
        /// <returns>A <see cref="UpnpArgument"/> object.</returns>
        private static UpnpArgument ParseArgument(XContainer element)
        {
            var argument = new UpnpArgument();

            argument.Name                 = XmlSupport.GetFirstSubNodeValue(element, "name");
            argument.Direction            = XmlSupport.GetFirstSubNodeValue(element, "direction");
            argument.RelatedStateVariable =
                XmlSupport.GetFirstSubNodeValue(element, "relatedStateVariable");
            argument.ReturnValue =
                XmlSupport.GetFirstSubNodeValue(element, "retVal", false);
            return(argument);
        } // ParseArgument()
示例#2
0
        } // UpnpService()

        #endregion // CONSTRUCTION

        //// ---------------------------------------------------------------------

        #region PUBLIC METHODS
        /// <summary>
        /// Gets the information about the given variable.
        /// </summary>
        /// <param name="argument">The argument.</param>
        /// <returns>A <see cref="UpnpStateVariable"/> object.</returns>
        public UpnpStateVariable GetVariableInfo(UpnpArgument argument)
        {
            return(this.stateVariables.FirstOrDefault(
                       variable => argument.RelatedStateVariable.Equals(variable.Name, StringComparison.OrdinalIgnoreCase)));
        } // GetVariableInfo()
示例#3
0
        } // UpnpServiceAction()

        #endregion // CONSTRUCTION

        //// ---------------------------------------------------------------------

        #region PUBLIC METHODS
        /// <summary>
        /// Adds the argument.
        /// </summary>
        /// <param name="argument">The argument.</param>
        public void AddArgument(UpnpArgument argument)
        {
            this.arguments.Add(argument);
        } // AddArgument()