public void SetDiagram(IDiagramView diagram)//, bool Ap, bool Bp, bool Cp) { { if (Control4DiagramView != null) { Control4DiagramView.ParNum = 0;// ParNum; Control4DiagramView.CurrentFunction = CurrentFunction.Clone(); if (Control4DiagramView.CurrentFunction is HenonFunction) { Control4DiagramView.DiagramStopParameter = 0; } else { Control4DiagramView.DiagramStopParameter = CurrentFunction.DiagramStop; } Control4DiagramView.DiagramStartParameter = CurrentFunction.DiagramStart; Control4DiagramView.SetDiagram(diagram); } }
/// <summary> /// Gets a list of IR nodes representing ERD tables /// </summary> /// <param name="diagram">ERD Diagram to get data from</param> /// <returns>List of created IR nodes</returns> internal List <IR.Table> GetErdTables(IUMLClassDiagram diagram) { List <IR.Table> result = new List <IR.Table>(); IDiagramView diagramView = diagram.DiagramView; if (diagramView != null) { int nbOfElems = diagramView.GetOwnedViewCount(); for (int i = 0; i < nbOfElems; i++) { try { IUMLClass umlClass = null; IView view = diagramView.GetOwnedViewAt(i); if (view != null) { umlClass = view.Model as IUMLClass; } if (umlClass != null) { // Collect only ERD tables if ( (umlClass.StereotypeProfile == Symbols.ERD_PROFILE_NAME) && (umlClass.StereotypeName == Symbols.ERD_STEREOTYPE_TABLE) ) { IR.Table irTable = new IR.Table(); irTable.TableName = umlClass.Name; irTable.Attribues = BuildIRTableAttributes(umlClass); result.Add(irTable); } } } catch (System.Exception) { } // Ignore offending model elements } } return(result); }
public void SetDiagram(IDiagramView diagram) { PlotForm = diagram; if (plotForm.FormImage != null) { try { using Graphics g = Graphics.FromImage(plotForm.FormImage); g.Clear(Color.White); } catch { } } if (PlotForm.SetFunctionImage != null) { try { using Graphics g = Graphics.FromImage(PlotForm.SetFunctionImage); g.Clear(Color.White); } catch { } } GC.Collect(); }