В моем проекте WindowsForms у меня есть класс с CellEditor (строка IGridDataRow), я хочу взять значение выбранного элемента и передать его другому классу.
namespace Projects.test.Gui
{
[AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Field | AttributeTargets.Property)]
public class testAttribute : Attribute, IEditorAttribute
{
public CellEditor GetEditor(IGridDataRow row)
{
try
{
List<string> Names = new List<string>();
Helper Helper = new Helper();
Namesdata[] mNames = Helper.FindAllNames();
if (mNames != null)
{
Names = mNames.Select(mName => mName.Name).ToList();
}
return new ButtonEditor(Names);
}
catch (Exception ex)
{
LogService.LogError(ex.Message);
return null;
}
}