I have the following method / function and I need to call the method / function criaTimerTendencia
that is within the class TagAnalogicaAtiva
.
private static void VerificaEnvioDeMensagensSignalR(object sender, EventArgs e)
{
if (ExisteTendenciaParaTag)
{
TagAnalogicaAtiva.criaTimerTendencia();//preciso chamar este metodo/função
}
}
Below is the code for the criaTimerTendencia()
class TagAnalogicaAtiva : TagAtiva
{
public void criaTimerTendencia()
{
var tendencia = Processamento.PegaTendencia(IdTag);
timer = new System.Timers.Timer(tendencia.TempoDeColeta);
timer.Elapsed += insereTendenciaDB;
timer.AutoReset = true;
timer.Enabled = true;
}
}
Only the following error is occurring:
An object reference is required for the non-static field, method, or property 'TagAnalogicaAtiva.criaTimerTendencia ()'
How do I solve this problem?