Hi, sometimes we need to know the name of the current method or better the calling method ( i need this to put that in the log) So the easiest way to get the name of the current method is
MethodInfo.GetCurrentMethod().Name.
But if you need to know the name of your calling method?
Easy:)
// Jump up the stack frame one level and locate the calling method.
StackFrame stackFrame = new StackFrame(1); //the "1" one level up
MethodBase callingMethod = stackFrame.GetMethod();
// Build a string containing the namespace and method name
string caller = callingMethod.DeclaringType.FullName + '.' + callingMethod.Name;
That's it:)
Very Easy in .net Framework
Friday, January 22, 2010
Thursday, January 21, 2010
Promoções e Novidades de Produtos
Deixo aqui este post off-topic que apresentara diversos produtos consoante as campanhas(dia da mãe,dia dos namorados etc)
Monday, January 4, 2010
Clube Rockrider
Um dos meus desportos favoritos é o BTT.
Já o pratiquei a muitos anos depois parei. Agora comprei um boa bike para voltar a este magnífico desporto.
Uma Rockrider 9.2 modelo 2009 e com juntamente com uns amigos criamos um clube.
O Clube Rockrider que pretente juntar os amantes desta marca que ainda tem sofre o preconceito de ser uma marca de "supermercado" visto ser apenas vendida na Decatlhon.
Visitem o site do clube aqui
Já o pratiquei a muitos anos depois parei. Agora comprei um boa bike para voltar a este magnífico desporto.
Uma Rockrider 9.2 modelo 2009 e com juntamente com uns amigos criamos um clube.
O Clube Rockrider que pretente juntar os amantes desta marca que ainda tem sofre o preconceito de ser uma marca de "supermercado" visto ser apenas vendida na Decatlhon.
Visitem o site do clube aqui
Subscribe to:
Posts (Atom)