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(); }
public void ExecutedCommand(CommandBase command, bool ispartofmacro, CommandBase macrocommand) { if (ispartofmacro) { return; } //step = 2 //command.Execute(); //step = 3; //Tests.ModelIntegrity.ModelConsistency.CheckProject(project); //step = 4; //SaveModifiedProject(project); //step = 5; //ddlAvailableOperations.SelectedIndex = 0; //ClearParamsPanel(true); //lCommandResult.Text = string.Format("Operation '{0}' executed succesfully. ", operationHumanFriendlyName); //lCommandResult.Visible = true; if (command is MacroCommand) { NestedCommandReport commandReports = ((MacroCommand)command).GetReport(); //repResult.DataSource = commandReports; //repResult.Visible = true; //repResult.DataBind(); DisplayReport(commandReports); } else { //reportDisplay.Visible = false; //repResult.Visible = false; } //else //{ // lCommandResult.Text = "Command can not execute. " + command.ErrorDescription; // lCommandResult.Visible = true; // lCommandResult.ForeColor = Color.Red; // lCommandResult.Font.Bold = true; }
public void ExecutedCommand(CommandBase command, bool ispartofmacro, CommandBase macrocommand, bool isUndo, bool isRedo) { if (ispartofmacro) { return; } //step = 2 //command.Execute(); //step = 3; //Tests.ModelIntegrity.ModelConsistency.CheckProject(project); //step = 4; //SaveModifiedProject(project); //step = 5; //ddlAvailableOperations.SelectedIndex = 0; //ClearParamsPanel(true); //lCommandResult.Text = string.Format("Operation '{0}' executed succesfully. ", operationHumanFriendlyName); //lCommandResult.Visible = true; CommandReportBase finalReport; if (command is MacroCommand) { NestedCommandReport commandReports = ((MacroCommand)command).GetReport(); Type commandType = command.GetType(); if (Controller.Commands.Reflection.PublicCommandsHelper.IsPublicCommand(commandType)) { if (command.Report == null) { commandReports.Contents = "Executed: " + Controller.Commands.Reflection.PublicCommandsHelper.GetCommandDescriptor(commandType).CommandDescription; } else { commandReports.Contents = command.Report.Contents; } } else { commandReports.Contents = "Executed: " + commandType.Name; } //repResult.DataSource = commandReports; //repResult.Visible = true; //repResult.DataBind(); finalReport = commandReports; } else { //reportDisplay.Visible = false; //repResult.Visible = false; if (isUndo || isRedo) { NestedCommandReport r = new NestedCommandReport(); if (isUndo) { r.Contents = "Undone command"; } else { r.Contents = "Redone command"; } r.NestedReports.Add(command.Report); finalReport = r; } else { finalReport = command.Report; } } DisplayReport(finalReport); //else //{ // lCommandResult.Text = "Command can not execute. " + command.ErrorDescription; // lCommandResult.Visible = true; // lCommandResult.ForeColor = Color.Red; // lCommandResult.Font.Bold = true; }