コード例 #1
0
        public GodClassResults(Func <string, int, string> pathProcessor, TypeConstraints typeRelations, string results_directory = "results")
        {
            _pathProcessor   = pathProcessor;
            _typeRelations   = typeRelations;
            MiningResults    = new List <SubTreeResults>();
            ResultsDirectory = results_directory + "/";

            try
            {
                if (!Directory.Exists(results_directory))
                {
                    Directory.CreateDirectory(results_directory);
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.ToString());
                System.Environment.Exit(-1);
            }

            System.IO.DirectoryInfo di = new DirectoryInfo(results_directory);

            foreach (FileInfo file in di.GetFiles())
            {
                file.Delete();
            }
            foreach (DirectoryInfo dir in di.GetDirectories())
            {
                dir.Delete(true);
            }
        }
コード例 #2
0
 public bool IsAssignableTo(string pattern, bool useRegularExpressions = false)
 {
     return(pattern != null && TypeConstraints.All(type => type.IsAssignableTo(pattern, useRegularExpressions)));
 }
コード例 #3
0
 public bool IsAssignableTo(IType assignableToType)
 {
     return(TypeConstraints.All(type => type.IsAssignableTo(assignableToType)));
 }
コード例 #4
0
 private TypeConstraint(TypeConstraints tag)
 {
     Tag = tag;
 }