/// <summary>
        /// 获取所有操作
        /// </summary>
        /// <returns></returns>
        public DEObjectOperationActionCollection GetActions()
        {
            DEObjectOperationActionCollection actions = new DEObjectOperationActionCollection();

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

            return(actions);
        }
예제 #2
0
        private void ExecuteWithActions(DEOperationType operationType, Action action)
        {
            DEDataOperationLockContext.Current.DoAddLockAction(this._AddLock, EnumItemDescriptionAttribute.GetDescription(operationType), () =>
            {
                if (this._NeedExecuteActions && action != null)
                {
                    DEObjectOperationActionCollection actions = DEObjectOperationActionSettings.GetConfig().GetActions();

                    actions.BeforeExecute(operationType);

                    action();

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