Aspose.Cells.Examples.CSharp.RunExamples.GetDataDir C# (CSharp) Method

GetDataDir() public static method

public static GetDataDir ( Type t ) : string
t System.Type
return string
        public static string GetDataDir(Type t)
        {
            string c = t.FullName;
            c = c.Replace("Aspose.Cells.Examples.CSharp.", "");
            c = c.Replace('.', Path.DirectorySeparatorChar);
            string p = Path.GetFullPath(Path.Combine(Directory.GetCurrentDirectory(), "..", "..", "..", "Data", c));
            p += Path.DirectorySeparatorChar;

            if (Directory.Exists(p))
            {
                Console.WriteLine("Using Data Dir {0}", p);
            }
            else
            {
                Directory.CreateDirectory(p);
                Console.WriteLine("Created Data Dir {0}", p);
            }

            return p;
        }
    }