Code:
using Eplan.EplApi.Base;
using Eplan.EplApi.DataModel;
using Eplan.EplApi.EServices;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;namespace EplAddin.Verification
{
public class AddinVerifiaction : IVerification,IMessage
{
public void DoHelp()
{
throw new NotImplementedException();
}
public void Execute(StorableObject oObject1)
{
if (oObject1 is Connection)
{
System.Collections.ArrayList colFunctions = new System.Collections.ArrayList();
Connection connection1 = oObject1 as Connection;
{
int i = connection1.Properties.CONNECTION_KINDOFWIRE;
string n = connection1.Properties.CONNECTION_WIRECROSSSECTION;//Verbindungsquerschnitt
int d = connection1.Properties.POTENTIAL_TYPE; //31006 <0> Undefiniert,<1> L,<2> N,<3> PE,<4> +,<5> M,<6> -,<7> SH,<8> PEN
MultiLangString e = connection1.Properties.FUNC_COMPONENTTYPE;//Funktionsdefinition
if (e.GetString(ISOCode.Language.L_de_DE)=="Ader / Draht")
{
if (d == 0)
{
}
if (string.IsNullOrEmpty(n))
{
if (d == 1)
{
}
}
}
}
}
}
public string GetMessageText()
{
return "Funktion fehlerhaft.";
}
public void OnEndInspection()
{
throw new NotImplementedException();
}
public void OnRegister(ref string strName, ref int iOrdinal)
{
strName = "Verification1";
iOrdinal = 30;
}
public void OnRegister(ref string strCreator, ref IMessage.Region eRegion, ref int iMessageId, ref IMessage.Classification eClassification, ref int iOrdinal)
{
strCreator = "API";
eRegion = IMessage.Region.Externals;
iMessageId = m_iMessageId;
eClassification = IMessage.Classification.Error;
iOrdinal = 20;
}
public void OnStartInspection(bool bOnline)
{
throw new NotImplementedException();
}
}
}