/// <summary> /// Инициализация переменных. /// </summary> public void Init() { Version = Assembly.GetExecutingAssembly().GetName().Version.ToString(); string fileName = Path.GetFileNameWithoutExtension(System.Reflection.Assembly.GetEntryAssembly().Location); varXml = new VarXml(string.Format("{0}.xml", fileName)); varXml.LoadFromXML(); //varXml.SaveToXML(); }
/// <summary> /// Загрузить данные из XML-файла. /// </summary> /// <returns></returns> 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(); AnalyseUri = obj.AnalyseUri; DownloadPath = obj.DownloadPath; ThreadCount = obj.ThreadCount; } }