Esempio n. 1
0
        public static void CleanKBAsMuchAsPossible()
        {
            IKBService     kbserv  = UIServices.KB;
            IOutputService output  = CommonServices.Output;
            string         mensaje = "Do you have a backup?. Are you sure you want to clean the KB? Some objects will be modified and deleted.";
            DialogResult   dr      = MessageBox.Show(mensaje, "Clean KB", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

            if (dr == DialogResult.Yes)
            {
                ObjectsHelper.CleanVarsNotUsed();
                CleanKBHelper.RemoveAttributeWithoutTable();
                ObjectsHelper.Unreachables();

                KBCategory UnreachableCategory = KBCategory.Get(kbserv.CurrentModel, "KBDoctor.UnReachable");
                foreach (KBObject obj in UnreachableCategory.AllMembers)
                {
                    KBDoctorCore.Sources.API.CleanKBObject(obj, output);
                }

                ProcessObjectsInCategory(output, UnreachableCategory);
                output.AddLine("Finish");
            }
        }