Example #1
0
        public void NormalizeSchema(PSMSchema schema)
        {
            modelVerifier = new ModelVerifier();
            //Controller.BeginMacro();

            FinalReport = new NestedCommandReport();

            bool somethingFound = false;

            while (!modelVerifier.TestSchemaNormalized(schema))
            {
                somethingFound = true;
                StackedCommand command = GetNormalizationCommand(schema);
                command.Execute();
                if (command is MacroCommand)
                {
                    NestedCommandReport commandReport = ((MacroCommand)command).GetReport();
                    ((NestedCommandReport)FinalReport).NestedReports.Add(commandReport);
                }
            }

            if (!somethingFound)
            {
                FinalReport = new CommandReport("Schema is already normalized. ");
            }
            //Controller.CommitMacro();
        }
Example #2
0
 public void ExecuteCommands(IEnumerable <CommandBase> commands)
 {
     foreach (CommandBase command in commands)
     {
         StackedCommand stackedCommand = command as StackedCommand;
         if (stackedCommand != null)
         {
             stackedCommand.Controller = this;
         }
         command.Execute();
     }
 }