Add constructor to SerializableAction to make creation from an action easier.
This commit is contained in:
@@ -76,5 +76,17 @@ namespace SerializableFunc
|
|||||||
{
|
{
|
||||||
return serializableAction?.GetAction();
|
return serializableAction?.GetAction();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public SerializableAction()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public SerializableAction(Action action)
|
||||||
|
{
|
||||||
|
if (action == null) throw new ArgumentNullException(nameof(action));
|
||||||
|
targetObject = action.Target as Object;
|
||||||
|
methodName = action.Method.Name;
|
||||||
|
cachedAction = action;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user