var array = new List<int>();
foreach (var item in myListBox.Items)
{
array.Add(int.Parse(item.ToString()));
}
var sum = array.Sum(x => Math.Pow(x, 2));
myTextBox.Text = sum.ToString();
var array = new[] {6, 8, 12};
var sum = array.Sum(x => Math.Pow(x, 2));
public void MainMethod()
{
Func<string> method = MyMethod;
var methodName = method.GetMethodInfo().Name;
var type = method.Target.GetType();
var attrs = type.GetMethod(methodName).GetCustomAttributes(typeof(MyAttribute), true);
}
public void MainMethod()
{
var method = typeof(myclass).GetMethod("MyMethod");
var attrs = method.GetCustomAttributes(typeof(MyAttribute), true);
}