Skip to content

Commit

Permalink
Modifications in order to make multiple classes become public (#310)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexmustata19 authored May 21, 2024
1 parent 9cfa2e1 commit bfa4a60
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
14 changes: 9 additions & 5 deletions src/UiPath.Workflow.Runtime/Runtime/CallbackWrapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
namespace System.Activities.Runtime;

[DataContract]
internal class CallbackWrapper
public class CallbackWrapper
{
private static readonly BindingFlags bindingFlags = BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.DeclaredOnly | BindingFlags.Static;

Expand All @@ -24,15 +24,19 @@ public CallbackWrapper(Delegate callback, ActivityInstance owningInstance)
_callback = callback;
}

public Delegate Callback
{
get => _callback;
set => _callback = value;
}

public ActivityInstance ActivityInstance
{
get => _activityInstance;
private set => _activityInstance = value;
}

protected bool IsCallbackNull => _callback == null && _callbackName == null;

protected Delegate Callback => _callback;
protected bool IsCallbackNull => Callback == null && _callbackName == null;

[DataMember(Name = "callbackName")]
internal string SerializedCallbackName
Expand Down Expand Up @@ -62,7 +66,7 @@ internal ActivityInstance SerializedActivityInstance
set => ActivityInstance = value;
}

public static bool IsValidCallback(Delegate callback, ActivityInstance owningInstance)
internal static bool IsValidCallback(Delegate callback, ActivityInstance owningInstance)
{
Fx.Assert(callback != null, "This should only be called with non-null callbacks");

Expand Down
6 changes: 3 additions & 3 deletions src/UiPath.Workflow.Runtime/Runtime/FaultCallbackWrapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,22 @@
namespace System.Activities.Runtime;

[DataContract]
internal class FaultCallbackWrapper : CallbackWrapper
public class FaultCallbackWrapper : CallbackWrapper
{
private static readonly Type faultCallbackType = typeof(FaultCallback);
private static readonly Type[] faultCallbackParameters = new Type[] { typeof(NativeActivityFaultContext), typeof(Exception), typeof(ActivityInstance) };

public FaultCallbackWrapper(FaultCallback callback, ActivityInstance owningInstance)
: base(callback, owningInstance) { }

public void Invoke(NativeActivityFaultContext faultContext, Exception propagatedException, ActivityInstance propagatedFrom)
internal void Invoke(NativeActivityFaultContext faultContext, Exception propagatedException, ActivityInstance propagatedFrom)
{
EnsureCallback(faultCallbackType, faultCallbackParameters);
FaultCallback faultCallback = (FaultCallback)Callback;
faultCallback(faultContext, propagatedException, propagatedFrom);
}

public WorkItem CreateWorkItem(Exception propagatedException, ActivityInstance propagatedFrom, ActivityInstanceReference originalExceptionSource)
internal WorkItem CreateWorkItem(Exception propagatedException, ActivityInstance propagatedFrom, ActivityInstanceReference originalExceptionSource)
=> new FaultWorkItem(this, propagatedException, propagatedFrom, originalExceptionSource);

[DataContract]
Expand Down

0 comments on commit bfa4a60

Please sign in to comment.