public void LoadFile(string fileName) { using (FileStream fs = new FileStream(fileName, FileMode.Open)) { _root = SectionLoaderManager.Instance.LoadFromStream(fs); if (FileLoadedEvent != null) { FileLoadedEvent(this, new EventArgs()); } } }
private void LoadModel(string fileName) { if (!File.Exists(fileName)) { throw new Exception(String.Format("File '{0}' not exists", fileName)); } else { using (FileStream fs = new FileStream(fileName, FileMode.Open)) { this.Root = SectionLoaderManager.Instance.LoadFromStream(fs) as RootSection; } } }