protected override async Task <bool> InitializeInternal() { await base.InitializeInternal(); SetInitializationState(ScenarioInitializationValue.Initializing); try { var instanceManager = Singleton.Resolve <IInstanceManager>(); foreach (var action in TargetAction.GetAllActionsFlat()) { if (action != null) { instanceManager.PrepareInstance(action, this); action.Initialize(); } } SetIsAvailable(true); return(true); } catch (Exception e) { Log.ErrorFormat(e, "Во время инициализации сценария [{0}] возникла ошибка", Name); SetIsAvailable(false); return(false); } finally { SetInitializationState(ScenarioInitializationValue.Initialized); } }
public override IAction[] GetAllActionsFlat() { return(TargetAction.GetAllActionsFlat()); }
public override Type[] GetAllUsedActionTypes() { return(TargetAction.GetAllActionsFlat().Select(x => x.GetType()).Distinct().ToArray()); }