public SCObjectOperationActionCollection GetActions()
        {
            SCObjectOperationActionCollection actions = new SCObjectOperationActionCollection();

            foreach (SCObjectOperationActionConfigurationElement actionElem in Actions)
            {
                try
                {
                    actions.Add((ISCObjectOperationAction)actionElem.CreateInstance());
                }
                catch (Exception ex)
                {
                    WriteToLog(ex);
                }
            }

            return(actions);
        }
Exemple #2
0
        private void ExecuteWithActions(SCOperationType operationType, Action action)
        {
            SCDataOperationLockContext.Current.DoAddLockAction(this._AddLock, EnumItemDescriptionAttribute.GetDescription(operationType), () =>
            {
                if (this._NeedExecuteActions && action != null)
                {
                    SCObjectOperationActionCollection actions = SCObjectOperationActionSettings.GetConfig().GetActions();

                    actions.BeforeExecute(operationType);

                    action();

                    actions.AfterExecute(operationType);
                }
                else
                {
                    action();
                }
            });
        }