1
Automation Interface, Add-Ins and Tools / Re: Help with deploying add-ins
« on: April 13, 2018, 04:16:46 am »
@Uffe: Please don't forget to notify us somehow after release :-)
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
bool EA_OnPreNewElement(IDualRepository repository, EventProperties info)
The EventProperties parameter is a class that contains a list of arbitrary data that can be accessed by EventProperties.Get(object Index)
This class is used as parameter in several of EA's broadcast events.Are you able to open the same file from an non-Japanese version of Access?Yeah, I used already MDB Viewer Plus to look into the database to find something suspicious, but with no success. My english EA, however, does not allow me to open the file. It's funny that an XMI Export of the same project (exported from Japanese version) followed by an XMI Import in my English version works.
var profilesProject = "profiles.eap";
const string iconFolder = "\\icons";
try
{
OleDbConnection conn = new OleDbConnection("Provider=Microsoft.Jet.OleDb.4.0;"
+ "Data Source=" + profilesProject);
conn.Open();
using (DataTable dt = new DataTable())
{
using (OleDbDataAdapter adapter = new OleDbDataAdapter(@"SELECT [Default],ID FROM t_attribute WHERE Name='Icon'", conn))
{
adapter.Fill(dt);
}
List<string> queries = new List<string>();
foreach (DataRow row in dt.Rows)
{
string toolboxIconPath = row["Default"].ToString();
if (!toolboxIconPath.StartsWith(executingFolder))
{
int index = toolboxIconPath.IndexOf(iconFolder);
if (index > 0)
{
string newPath = executingFolder + toolboxIconPath.Substring(index);
Console.WriteLine("\tReplacement: " + toolboxIconPath + " -> " + newPath);
queries.Add("UPDATE [t_attribute] SET [Default]='"+newPath+"' WHERE [ID]="+row["ID"]);
}
}
}
if (queries.Any())
{
Console.WriteLine("\nAre the replaced paths correct? Go on with 'y'");
ConsoleKeyInfo pressedChar = Console.ReadKey();
if (pressedChar.KeyChar == 'y')
{
foreach (string query in queries)
{
using (OleDbCommand cmd = new OleDbCommand(query, conn))
{
cmd.ExecuteNonQuery();
}
}
Console.WriteLine("\nToolbox Icon Paths updated successfully :-)");
}
}
}
}
catch (Exception e)
{
Console.WriteLine("\nAn error occured during updating the toolbox icon image paths. Are you sure that you have the SVN lock on the profiles.eap file?");
}
Console.WriteLine("\n\nPress any key to exit...");
Console.ReadKey();
public void changeConnectorLayout(IDualConnector conn, int diagramID, IEnumerable<Point> bendPoints = null)
{
string diagramLinkAvailableQuery = "SELECT ConnectorID FROM t_diagramlinks WHERE ConnectorID=" + conn.ConnectorID + " AND DiagramID=" + diagramID;
string linkAvailable = EAFacade.RetrievalCore.getFieldByQuery(diagramLinkAvailableQuery, "ConnectorID");
if (linkAvailable == null)
{
string insertDiagramLinkSQL = "INSERT INTO t_diagramlinks(DiagramID, ConnectorID, Geometry, Style, Hidden) " +
"VALUES(" + diagramID + "," + conn.ConnectorID + @",'EDGE=1;$LLB=;LLT=;LMT=;LMB=;LRT=;LRB=;IRHS=;ILHS=;','Mode=3;Color=-1;LWidth=0;Tree=OR;',False)";
EAFacade.rep.Execute(insertDiagramLinkSQL);
changeConnectorLayout(conn, diagramID, bendPoints);
}
else
{
ConnectorLayout layout = new ConnectorLayout(conn.ConnectorID, diagramID);
layout.Create();
string newStyleSQL = layout.GetStyleDBString();
string newGeometrySQL = layout.GetGeometryDBString();
string newBendPoints = layout.SetBendPoints(bendPoints.ToList());
string setBendPointsSQL = "UPDATE t_diagramlinks SET Style='" + newStyleSQL + "', Geometry='" + newGeometrySQL + "', Path='" + newBendPoints + "' WHERE DiagramID=" + diagramID + " AND ConnectorID=" + conn.ConnectorID;
EAFacade.rep.Execute(setBendPointsSQL);
}
}
Project.layoutDiagramEx(string DiagramGUID, long LayoutStyle, long Iterations, long LayerSpacing, long ColumnSpacing, boolean SaveToDiagram)