private void buildFromSubschemaToolStripMenuItem_Click(object sender, EventArgs e)
{
DialogResult res = this.openFileDialogExpress.ShowDialog();
if (res != System.Windows.Forms.DialogResult.OK)
return;
DocModelView docView = (DocModelView)this.treeView.SelectedNode.Tag;
// for now, we don't actually import EXPRESS, we just do dumb lookup of strings to see if they are included in model view
using (System.IO.StreamReader reader = new System.IO.StreamReader(this.openFileDialogExpress.FileName))
{
string express = reader.ReadToEnd();
foreach (DocSection docSection in this.m_project.Sections)
{
foreach (DocSchema docSchema in docSection.Schemas)
{
foreach (DocEntity docEntity in docSchema.Entities)
{
string search1 = "ENTITY " + docEntity.Name + ";";
string search2 = "ENTITY " + docEntity.Name + "\r\n";
if (express.Contains(search1) || express.Contains(search2))
{
// check for existing
DocConceptRoot root = null;
foreach (DocConceptRoot exist in docView.ConceptRoots)
{
if (exist.ApplicableEntity == docEntity)
{
root = exist;
break;
}
}
if (root == null)
{
root = new DocConceptRoot();
root.ApplicableEntity = docEntity;
docView.ConceptRoots.Add(root);
}
}
}
}
}
}
this.LoadTree();
}