public IEADiagram[] GetDiagrams() { string sql = @"Select t_diagramobjects.Diagram_ID FROM t_diagramobjects WHERE t_diagramobjects.Object_ID = " + ID + ";"; IEARepository repository = EARepository.Instance; var document = new XmlDocument(); document.LoadXml(repository.Query(sql)); XmlNodeList diagramIDs = document.GetElementsByTagName(@"Diagram_ID"); return((from XmlNode diagramId in diagramIDs select EAUtilities.ParseToInt32(diagramId.InnerText, -1) into id where id > 0 select repository.GetDiagramByID(id)).ToArray()); }
public override bool OnPreDeleteDiagram(IEAVolatileDiagram volatileDiagram) { IEARepository repository = EAMain.Repository; IEADiagram diagram = repository.GetDiagramByID(volatileDiagram.DiagramID); if (!diagram.IsForcesView()) { return(true); } if (_controllers.ContainsKey(diagram.GUID)) { if (repository.IsTabOpen(ForcesModel.CreateForcesTabName(diagram.Name)) > 0) { repository.RemoveTab(ForcesModel.CreateForcesTabName(diagram.Name)); } _controllers.Remove(diagram.GUID); } return(true); }