/// <summary>
        ///     Create the base oa element for harmony documents
        /// </summary>
        /// <param name="command">Command to call</param>
        /// <returns>Element</returns>
        private static Element CreateOaElement(HarmonyCommands command)
        {
            var element = new Element("oa");

            element.Attributes.Add("xmlns", Namespace);
            element.Attributes.Add("mime", $"vnd.logitech.harmony/vnd.logitech.harmony.engine?{command}");
            return(element);
        }
        /// <summary>
        ///     Create a simple document for the command
        /// </summary>
        /// <param name="command">Command to call</param>
        /// <param name="elementValue">The value of the OA element, if one is needed</param>
        /// <returns>Document</returns>
        private static Document CreateDocument(HarmonyCommands command, string elementValue = null)
        {
            var document = new Document
            {
                Namespace = Namespace
            };

            var element = CreateOaElement(command);

            if (elementValue != null)
            {
                element.Value = elementValue;
            }
            document.AddChild(element);
            return(document);
        }
Esempio n. 3
0
 /// <summary>
 ///     Create the base oa element for harmony documents
 /// </summary>
 /// <param name="command">Command to call</param>
 /// <returns>Element</returns>
 private static Element CreateOaElement(HarmonyCommands command)
 {
     var element = new Element("oa");
     element.Attributes.Add("xmlns", Namespace);
     element.Attributes.Add("mime", $"vnd.logitech.harmony/vnd.logitech.harmony.engine?{command}");
     return element;
 }
Esempio n. 4
0
        /// <summary>
        ///     Create a simple document for the command
        /// </summary>
        /// <param name="command">Command to call</param>
        /// <param name="elementValue">The value of the OA element, if one is needed</param>
        /// <returns>Document</returns>
        private static Document CreateDocument(HarmonyCommands command, string elementValue = null)
        {
            var document = new Document
            {
                Namespace = Namespace
            };

            var element = CreateOaElement(command);
            if (elementValue != null)
            {
                element.Value = elementValue;
            }
            document.AddChild(element);
            return document;
        }