Код: Выделить всё
public event Action Output1;
Я хотел бы определить эти классы в F#. Итак, я попробовал официальный эквивалент
Код: Выделить всё
let output1 = Event()
[]
member __.Output1 = output1.Publish
Код: Выделить всё
public event Action Output1;
Код: Выделить всё
[CLIEvent]
public event FSharpHandler Output1
{
add
{
if (init@16 < 1)
{
LanguagePrimitives.IntrinsicFunctions.FailInit();
}
output1.Publish.AddHandler(value);
}
remove
{
if (init@16 < 1)
{
LanguagePrimitives.IntrinsicFunctions.FailInit();
}
output1.Publish.RemoveHandler(value);
}
}
Отсюда и мой вопрос:
Есть ли способ определить член в F#, чтобы он был построен ТОЧНО как элемент C#?
Подробнее здесь: https://stackoverflow.com/questions/793 ... vents-in-f
Мобильная версия