public void ImportXml() { var rulePath = Assembly.GetExecutingAssembly().Location.Replace("RosReestrImp.dll", "rule.xml"); var wRm = new Rule.RuleManager(rulePath); var openFileDialog1 = new OpenFileDialog { Filter = FilterString }; if (openFileDialog1.ShowDialog() != DialogResult.OK) { return; } wRm.LoadData(openFileDialog1.FileName).ForEach(DrawLayer); }
public void ImportXML() { string RulePath = Assembly.GetExecutingAssembly().Location.Replace("RosReestrImp.dll", "rule.xml"); Rule.RuleManager wRM = new Rule.RuleManager(RulePath); OpenFileDialog openFileDialog1 = new OpenFileDialog(); openFileDialog1.Filter = "xml files (*.xml)|*.xml"; if (openFileDialog1.ShowDialog() == DialogResult.OK) { List <Data.DataLayer> res = wRM.LoadData(openFileDialog1.FileName); if (res != null) { res.ForEach(l => DrawLayer(l)); } } }
public void ImportXmLwithRule() { var openFileDialog1 = new OpenFileDialog { Filter = FilterString }; if (openFileDialog1.ShowDialog() != DialogResult.OK) { return; } var wRm = new Rule.RuleManager(openFileDialog1.FileName); if (openFileDialog1.ShowDialog() != DialogResult.OK) { return; } wRm.LoadData(openFileDialog1.FileName).ForEach(DrawLayer); }
public void ImportXMLwithRule() { OpenFileDialog openFileDialog1 = new OpenFileDialog(); openFileDialog1.Filter = "xml files (*.xml)|*.xml"; if (openFileDialog1.ShowDialog() == DialogResult.OK) { Rule.RuleManager wRM = new Rule.RuleManager(openFileDialog1.FileName); if (openFileDialog1.ShowDialog() == DialogResult.OK) { List <Data.DataLayer> res = wRM.LoadData(openFileDialog1.FileName); if (res != null) { res.ForEach(l => DrawLayer(l)); } } } }
/// <summary> /// Загрузка данных из файла /// </summary> /// <param name="filename"> xml-файл с данными </param> /// <returns> Список данных слоёв </returns> public List <Data.DataLayer> LoadData(string filename) { return(this.LoadData(RuleManager.LoadXML(filename))); }
/// <summary> /// Конструктор /// </summary> /// <param name="filename"> xml-файл правил </param> /// <exception cref="RuleLoadException"> Ошибка xml-файла правил </exception> public RuleManager(string filename) : this(RuleManager.LoadXML(filename)) { }