/// <summary/> public ScopeTransactionAdapter( Scope scope ) : this(scope, scope.Variables) { // we create a transaction for the complete scope // -> setup a rollback action which removes all variables which were not // known before the transaction started myRollbackActions.Add( () => { var newVariables = myScope.Variables.Except( myVariables ).ToList(); newVariables.Foreach( var => myScope.RemoveVariable( var ) ); } ); }
/// <summary/> public ScopeTransactionAdapter( Scope scope, IEnumerable<string> variables ) { myScope = scope; myVariables = variables.ToList(); myRollbackActions = new List<Action>(); }
/// <summary/> public ScopeTransactionAdapter( Scope scope, params string[] variables ) : this(scope, (IEnumerable<string>)variables) { }
public Scope( Scope parent ) { Parent = parent; myVariables = new Dictionary<string, object>(); }