/// <summary> /// /// </summary> public Database() { Setting = new SettingDoc(); Security = new SecurityDocument() { Name = this.Name }; }
/// <summary> /// /// </summary> /// <param name="path"></param> public SecurityDocument Load(string path) { SecurityDocument db = new SecurityDocument(); if (System.IO.File.Exists(path)) { XElement xe = XElement.Load(path); db.Name = xe.Attribute("Name").Value; db.Version = xe.Attribute("Version").Value; if (xe.Element("User") != null) { db.User = LoadUsers(xe.Element("User")); } if (xe.Element("Permissions") != null) { db.Permission = LoadPermission(xe.Element("Permissions")); } } this.Document = db; return(db); }