Example #1
0
        public override void Execute()
        {
            gOut.WriteLine();

            gEngine.PrintTitle(Title, true);

            if (ClearSkipNames)
            {
                SkipNames.Clear();
            }

            ValidateHelper.Clear();

            ModifyFlag = false;

            ExitFlag = false;

            while (true)
            {
                ErrorRecord = default(T);

                foreach (var record in RecordTable.Records)
                {
                    ValidateHelper.Record = record;

                    var names = ValidateHelper.GetNames((n) =>
                    {
                        var uniqueName = string.Format("{0}_{1}_{2}", typeof(T).Name, record.Uid, n);

                        return(!SkipNames.Contains(uniqueName));
                    });

                    foreach (var name in names)
                    {
                        ValidateHelper.Clear();

                        if (!ValidateHelper.ValidateFieldInterdependencies(ValidateHelper.GetFieldName(name)))
                        {
                            ErrorRecord = record;

                            goto ProcessError;
                        }
                    }
                }

ProcessError:

                if (ErrorRecord != null)
                {
                    ValidateHelper.ShowDesc = Globals.Config.ShowDesc;

                    ProcessInterdependency();

                    if (ExitFlag)
                    {
                        break;
                    }
                }
                else
                {
                    break;
                }
            }

            gOut.Print("Done analysing {0} records.", RecordTypeName);
        }