private void ConfigInit() { this.ConfigPath = this.EnumEditorID == EnumEditorIDE.Animation ? this.AnimationExprotConfigPath : this.UIExprotConfigPath; if (File.Exists(this.ConfigPath)) { try { XmlNode node1 = XmlAnalysis.GetNode((XmlNode)XmlAnalysis.ReaderXmlFile(this.ConfigPath), "ExprotConfig"); this.MaxSourceWidth = int.Parse(XmlAnalysis.GetNode(node1, "MaxSourceWidth").InnerText); this.MaxSourceHeight = int.Parse(XmlAnalysis.GetNode(node1, "MaxSourceHeight").InnerText); this.PaddingPixel = int.Parse(XmlAnalysis.GetNode(node1, "PaddingPixel").InnerText); this.Cilp = Convert.ToBoolean(XmlAnalysis.GetNode(node1, "Cilp").InnerText); this.SortForm = (SortFormat)Enum.Parse(typeof(SortFormat), XmlAnalysis.GetNode(node1, "SortForm").InnerText); this.ImageForm = (ImageFileFormat)Enum.Parse(typeof(ImageFileFormat), XmlAnalysis.GetNode(node1, "ImageForm").InnerText); this.ExprotPath = XmlAnalysis.GetNode(node1, "ExprotPath").InnerText; this.ExportJsonPath = XmlAnalysis.GetNode(node1, "ExportJsonPath").InnerText; this.ExprotResouces = int.Parse(XmlAnalysis.GetNode(node1, "ExprotResouces").InnerText); this.ExprotCanvas = int.Parse(XmlAnalysis.GetNode(node1, "ExprotCanvas").InnerText); this.ResourceScale = float.Parse(XmlAnalysis.GetNode(node1, "ResourceScale").InnerText); XmlNode node2 = XmlAnalysis.GetNode(node1, "FormatExport"); this.FormatExport = node2 != null && Convert.ToBoolean(node2.InnerText); } catch (Exception) { this.Init(); File.Delete(this.ConfigPath); } } else { this.Init(); } }
private void ConfigInit() { if (File.Exists(this.LoginInfoConfigPath)) { try { XmlNode node = XmlAnalysis.GetNode((XmlNode)XmlAnalysis.ReaderXmlFile(this.LoginInfoConfigPath), "LoginInfoConfig"); this.IsRememberPassWord = Convert.ToBoolean(XmlAnalysis.GetNode(node, "IsRememberPassWord").InnerText); this.UserName = XmlAnalysis.GetNode(node, "UserName").InnerText; string innerText = XmlAnalysis.GetNode(node, "UserPassword").InnerText; this.IsAutoLogin = Convert.ToBoolean(XmlAnalysis.GetNode(node, "IsAutoLogin").InnerText); this.UserPassword = LoginEncrypt.Decrypt(innerText, "E99F9354-BC29-48A2-9839-F3D0DD83CCE5", Encoding.Default); } catch (Exception) { this.Init(); File.Delete(this.LoginInfoConfigPath); } } else { this.Init(); } }