Skip to content

Commit

Permalink
remove obsolete events
Browse files Browse the repository at this point in the history
  • Loading branch information
mjkkirschner committed Dec 6, 2023
1 parent b0623e0 commit 5c80d2e
Showing 1 changed file with 5 additions and 33 deletions.
38 changes: 5 additions & 33 deletions DSIronPython/IronPythonEvaluator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,7 @@

namespace DSIronPython
{
[SupressImportIntoVM]
[Obsolete("Deprecated. Please use Dynamo.PythonServices.EvaluationState instead.")]
public enum EvaluationState { Begin, Success, Failed }

[SupressImportIntoVM]
[Obsolete("Deprecated. Please use evaluation handlers from Dynamo.PythonServices instead.")]
public delegate void EvaluationEventHandler(EvaluationState state,
ScriptEngine engine,
ScriptScope scope,
string code,
IList bindingValues);


/// <summary>
/// Evaluates a Python script in the Dynamo context.
/// </summary>
Expand Down Expand Up @@ -311,26 +300,14 @@ public override object OutputDataMarshaler

#region Evaluation events

/// <summary>
/// Emitted immediately before execution begins
/// </summary>
[SupressImportIntoVM]
[Obsolete("Deprecated. Please use EvaluationStarted instead.")]
public static event EvaluationEventHandler EvaluationBegin;


/// <summary>
/// Emitted immediately before execution begins
/// </summary>
[SupressImportIntoVM]
public override event EvaluationStartedEventHandler EvaluationStarted;

/// <summary>
/// Emitted immediately after execution ends or fails
/// </summary>
[SupressImportIntoVM]
[Obsolete("Deprecated. Please use EvaluationFinished instead.")]
public static event EvaluationEventHandler EvaluationEnd;


/// <summary>
/// Emitted immediately after execution ends or fails
/// </summary>
Expand All @@ -349,9 +326,7 @@ private void OnEvaluationBegin( ScriptEngine engine,
string code,
IList bindingValues )
{
// Call deprecated events until they are completely removed.
EvaluationBegin?.Invoke(EvaluationState.Begin, engine, scope, code, bindingValues);


if (EvaluationStarted != null)
{
EvaluationStarted(code, bindingValues, (n, v) => { scope.SetVariable(n, InputMarshaler.Marshal(v)); });
Expand All @@ -376,10 +351,7 @@ private void OnEvaluationEnd( bool isSuccessful,
string code,
IList bindingValues)
{
// Call deprecated events until they are completely removed.
EvaluationEnd?.Invoke(isSuccessful ? EvaluationState.Success : EvaluationState.Failed,
engine, scope, code, bindingValues);


if (EvaluationFinished != null)
{
EvaluationFinished( isSuccessful ? Dynamo.PythonServices.EvaluationState.Success : Dynamo.PythonServices.EvaluationState.Failed,
Expand Down

0 comments on commit 5c80d2e

Please sign in to comment.