Esempio n. 1
0
        public Boolean Save()
        {
            Boolean Saved = true;

            try
            {
                XmlNode Node;

                m_Doc.RemoveAll();

                Node = m_Doc.CreateXmlDeclaration("1.0", "utf-8", String.Empty);
                m_Doc.AppendChild(Node);

                Node = m_Doc.CreateComment(String.Format(" ScpControl Configuration Data. {0} ", DateTime.Now));
                m_Doc.AppendChild(Node);

                Node = m_Doc.CreateWhitespace("\r\n");
                m_Doc.AppendChild(Node);

                Node = m_Doc.CreateNode(XmlNodeType.Element, "ScpControl", null);
                {
                    CreateTextNode(Node, "Idle", Idle.ToString());

                    CreateTextNode(Node, "LX", LX.ToString());
                    CreateTextNode(Node, "LY", LY.ToString());
                    CreateTextNode(Node, "RX", RX.ToString());
                    CreateTextNode(Node, "RY", RY.ToString());

                    CreateTextNode(Node, "LED", LED.ToString());
                    CreateTextNode(Node, "Rumble", Rumble.ToString());
                    CreateTextNode(Node, "Triggers", Triggers.ToString());

                    CreateTextNode(Node, "Latency", Latency.ToString());
                    CreateTextNode(Node, "DeadL", DeadL.ToString());
                    CreateTextNode(Node, "DeadR", DeadR.ToString());

                    CreateTextNode(Node, "Native", Native.ToString());
                    CreateTextNode(Node, "SSP", SSP.ToString());

                    CreateTextNode(Node, "Brightness", Brightness.ToString());
                    CreateTextNode(Node, "Bus", Bus.ToString());
                    CreateTextNode(Node, "Force", Repair.ToString());
                }
                m_Doc.AppendChild(Node);

                m_Doc.Save(m_File);
            }
            catch { Saved = false; }

            return(Saved);
        }
Esempio n. 2
0
        public Boolean Save()
        {
            Boolean Saved = true;

            try
            {
                XmlNode Node, Entry;

                m_Xdoc.RemoveAll();

                Node = m_Xdoc.CreateXmlDeclaration("1.0", "utf-8", String.Empty);
                m_Xdoc.AppendChild(Node);

                Node = m_Xdoc.CreateComment(String.Format(" ScpControl Configuration Data. {0} ", DateTime.Now));
                m_Xdoc.AppendChild(Node);

                Node = m_Xdoc.CreateWhitespace("\r\n");
                m_Xdoc.AppendChild(Node);

                Node = m_Xdoc.CreateNode(XmlNodeType.Element, "ScpControl", null);

                Entry = m_Xdoc.CreateNode(XmlNodeType.Element, "Idle", null); Entry.InnerText = Idle.ToString(); Node.AppendChild(Entry);

                Entry = m_Xdoc.CreateNode(XmlNodeType.Element, "LX", null); Entry.InnerText = LX.ToString(); Node.AppendChild(Entry);
                Entry = m_Xdoc.CreateNode(XmlNodeType.Element, "LY", null); Entry.InnerText = LY.ToString(); Node.AppendChild(Entry);
                Entry = m_Xdoc.CreateNode(XmlNodeType.Element, "RX", null); Entry.InnerText = RX.ToString(); Node.AppendChild(Entry);
                Entry = m_Xdoc.CreateNode(XmlNodeType.Element, "RY", null); Entry.InnerText = RY.ToString(); Node.AppendChild(Entry);

                Entry = m_Xdoc.CreateNode(XmlNodeType.Element, "LED", null); Entry.InnerText = LED.ToString(); Node.AppendChild(Entry);

                m_Xdoc.AppendChild(Node);

                m_Xdoc.Save(m_File);
            }
            catch { Saved = false; }

            return(Saved);
        }