Exemplo n.º 1
0
        public override void Execute()
        {
            gOut.WriteLine();

            gEngine.PrintTitle(Title, true);

            if (ClearSkipNameList)
            {
                SkipNameList.Clear();
            }

            ValidateHelper.Clear();

            ModifyFlag = false;

            ExitFlag = false;

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

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

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

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

                    foreach (var name in nameList)
                    {
                        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);
        }