ExoModel.ModelEventScope.Perform C# (CSharp) 메소드

Perform() 공개 정적인 메소드

Performs the specified action inside a ModelEventScope.
public static Perform ( System.Action action ) : void
action System.Action
리턴 void
        public static void Perform(Action action)
        {
            new ModelEventScope().PerformAction(action);
        }

Same methods

ModelEventScope::Perform ( ModelEvent @event, System.Action action ) : void

Usage Example

예제 #1
0
        void ITransactedModelEvent.Rollback(ModelTransaction transaction)
        {
            Prepare(transaction);

            ModelEventScope.Perform(() =>
            {
                ModelContext context   = Instance.Type.Context;
                ModelInstanceList list = Instance.GetList(Property);

                if (Added != null)
                {
                    foreach (ModelInstance item in Added)
                    {
                        list.Remove(item);
                    }
                }
                if (Removed != null)
                {
                    foreach (ModelInstance item in Removed)
                    {
                        list.Add(item);
                    }
                }
            });
        }
All Usage Examples Of ExoModel.ModelEventScope::Perform