Exemplo n.º 1
0
        public void Init()
        {
            Version = "v1.0.2";

            string fileName = Path.GetFileNameWithoutExtension(System.Reflection.Assembly.GetEntryAssembly().Location);

            varXml = new VarXml(string.Format("{0}.xml", fileName));
            varXml.LoadFromXML();
            //varXml.SaveToXML();
        }
Exemplo n.º 2
0
        /// <summary>
        /// Загрузить данные из XML-файла.
        /// </summary>
        public void LoadFromXML()
        {
            if (File.Exists(FilePath))
            {
                XmlSerializer deserializer = new XmlSerializer(typeof(VarXml));
                TextReader    textReader   = new StreamReader(FilePath);
                VarXml        obj          = (VarXml)deserializer.Deserialize(textReader);
                textReader.Close();

                Connection.ServerIP = obj.Connection.ServerIP;
                Connection.Port     = obj.Connection.Port;

                HotKey.Cntr  = obj.HotKey.Cntr;
                HotKey.Alt   = obj.HotKey.Alt;
                HotKey.Shift = obj.HotKey.Shift;
                HotKey.Key   = obj.HotKey.Key;
            }
        }