public virtual void Execute()
        {
            var database = Factory.GetDatabase(this.Database);

            using (new UserSwitcher(this.User))
            {
                foreach (ScopeExecuteConfiguration scopeConfiguration in this.ScopeConfigurations)
                {
                    ScopeManager.Execute(database, scopeConfiguration, this.ScopeAction);
                }
            }
        }
Example #2
0
        /// <summary>
        /// Query State
        /// </summary>
        /// <param name="context">
        /// The command context.
        /// </param>
        /// <returns>
        /// Command State
        /// </returns>
        protected virtual void Run(CommandContext context)
        {
            Assert.ArgumentNotNull(context, "context");
            Assert.ArgumentNotNull(context.CustomData, "context.CustomData");

            var    accountItem = context.CustomData as Item;
            string scope       = context.Parameters["scope"];

            if (accountItem != null && !string.IsNullOrEmpty(scope))
            {
                ScopeManager.Execute(accountItem.Database, scope, this.Action, new[] { accountItem.ID });
            }
        }