I'm creating a library with some functions that I occasionally use ;) and was wondering if anyone can help me with a minor problem.
I have some file operations that I cba to write code for every time so I made 2 classes (one for Files and one for Directories). Then I realized they share 2-3 functions. Here's part of the code:
Is it possible to hide the class Shared somehow? I know I'm not supposed etc but if I really want to is it possible? Without having to write the code twice in each class?
I have some file operations that I cba to write code for every time so I made 2 classes (one for Files and one for Directories). Then I realized they share 2-3 functions. Here's part of the code:
Code:
namespace Something.IO
{
public abstract class Shared
{
public static String GetShortName(String Fullname)
{
...
}
}
public class File : Shared
{
...
}
public class Directory : Shared
{
...
}
}
Comment