11using System ;
22using System . Linq ;
3+ using InEngine . Core . Exceptions ;
34using InEngine . Core . IO ;
45using InEngine . Core . Scheduling ;
56using Konsole ;
67using Quartz ;
8+ using RestSharp ;
79
810namespace InEngine . Core
911{
1012 abstract public class AbstractCommand : ICommand , IFailed , IJob , IWrite
1113 {
12- public LifecycleActions LifecycleActions { get ; set ; }
14+ public ExecutionLifeCycle ExecutionLifeCycle { get ; set ; }
1315 public Write Write { get ; set ; }
1416 public ProgressBar ProgressBar { get ; internal set ; }
1517 public string Name { get ; set ; }
@@ -22,7 +24,7 @@ protected AbstractCommand()
2224 Name = GetType ( ) . FullName ;
2325 SchedulerGroup = GetType ( ) . AssemblyQualifiedName ;
2426 Write = new Write ( ) ;
25- LifecycleActions = new LifecycleActions ( ) ;
27+ ExecutionLifeCycle = new ExecutionLifeCycle ( ) ;
2628 }
2729
2830 public virtual void Run ( )
@@ -57,9 +59,9 @@ public void Execute(IJobExecutionContext context)
5759
5860 try
5961 {
60- LifecycleActions . BeforeAction ? . Invoke ( this ) ;
62+ ExecutionLifeCycle . FirePreActions ( this ) ;
6163 Run ( ) ;
62- LifecycleActions . AfterAction ? . Invoke ( this ) ;
64+ ExecutionLifeCycle . FirePostActions ( this ) ;
6365 }
6466 catch ( Exception exception )
6567 {
@@ -124,6 +126,16 @@ public IWrite Newline(int count = 1)
124126 {
125127 return Write . Newline ( count ) ;
126128 }
129+
130+ public string FlushBuffer ( )
131+ {
132+ return Write . FlushBuffer ( ) ;
133+ }
134+
135+ public void ToFile ( string path , string text , bool shouldAppend = false )
136+ {
137+ Write . ToFile ( path , text , shouldAppend ) ;
138+ }
127139 #endregion
128140 }
129141}
0 commit comments