Esempio n. 1
0
        /// <summary>
        ///     Create a "pair" document, this is a bit different from the others
        /// </summary>
        /// <param name="token">Token</param>
        /// <returns>Document</returns>
        public static Document LogitechPairDocument(string token)
        {
            var document = new Document
            {
                Namespace = Namespace
            };

            var element = new Element("oa");
            element.Attributes.Add("xmlns", "connect.logitech.com");
            element.Attributes.Add("mime", "vnd.logitech.connect/vnd.logitech.pair");
            element.Value = $"token={token}:name=foo#iOS6.0.1#iPhone";
            document.AddChild(element);
            return document;
        }
Esempio n. 2
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;
        }