Page 1 of 1

Generic Method For Text Library

Posted: Tue Feb 03, 2015 9:22 am
by daoa80
In the past, I got a generic method to access or get Tags as seen below,

public GlobalDataItem GetGlobalDataItem(string propertyName)
{
PropertyInfo tagProperty = typeof(Neo.ApplicationFramework.Generated.Tags).GetProperty(propertyName);

if(tagProperty == null)
{
return null;
}
else
{
return tagProperty.GetValue(Globals.Tags, null) as GlobalDataItem;
}
}



Now I want to do the same but this time using the TextLibrary, in where I pass the name of the group so I can do the following comparisoon


for(int m = 0; m < Globals.TextLibrary.XXX.Messages.Count; m++)
{
if((xValue >= Globals.TextLibrary.XXX.Messages[m].StartValue) && (xValue <= Globals.TextLibrary.XXX.Messages[m].EndValue))
{
xMessage = Globals.TextLibrary.XXX.Messages[m].Message;
break;
}
else
{
xMessage = "Unrecognized -" + xValue;
}

}

Re: Generic Method For Text Library

Posted: Wed Jan 22, 2020 12:30 pm
by Jae V
Hello,
We understand that this is a very old post. If there is anyone who is still experiencing this or similar issues and require assistance, please visit us at https://www.beijerelectronics.us/en-US/ ... ___support or give us call at 801.708.6690. Thank you.