From 5c80d2eb17e3f4542cb8247ba15b047cba835ecc Mon Sep 17 00:00:00 2001 From: mjkkirschner Date: Wed, 6 Dec 2023 18:17:33 -0500 Subject: [PATCH] remove obsolete events --- DSIronPython/IronPythonEvaluator.cs | 38 ++++------------------------- 1 file changed, 5 insertions(+), 33 deletions(-) diff --git a/DSIronPython/IronPythonEvaluator.cs b/DSIronPython/IronPythonEvaluator.cs index ce1cd40..366647f 100644 --- a/DSIronPython/IronPythonEvaluator.cs +++ b/DSIronPython/IronPythonEvaluator.cs @@ -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); - + /// /// Evaluates a Python script in the Dynamo context. /// @@ -311,26 +300,14 @@ public override object OutputDataMarshaler #region Evaluation events - /// - /// Emitted immediately before execution begins - /// - [SupressImportIntoVM] - [Obsolete("Deprecated. Please use EvaluationStarted instead.")] - public static event EvaluationEventHandler EvaluationBegin; - + /// /// Emitted immediately before execution begins /// [SupressImportIntoVM] public override event EvaluationStartedEventHandler EvaluationStarted; - /// - /// Emitted immediately after execution ends or fails - /// - [SupressImportIntoVM] - [Obsolete("Deprecated. Please use EvaluationFinished instead.")] - public static event EvaluationEventHandler EvaluationEnd; - + /// /// Emitted immediately after execution ends or fails /// @@ -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)); }); @@ -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,