There isn't any way of making the app open .txt files by default.
Using the File>Open solution works but is very tedious. It would be really nice if we were able to set this app as the default to open .txt files. I've tried everything but to my knowledge there is no way of doing it in the app's current state. Could you please add this? Not being able to start this app instead of the Notepad app really defeats the whole purpose of this app. Maybe you could release your app as a .exe, so that we can select it in the "Right Click">"Open With" menu. Thanks in advance!
I also want to know how can I set it as my default Notepad.
I'd like to be able to associate BlackNotepad with another extension, let's say ".bn1" , but I can't find the executable, so can't convince Windows to do it. Is it a DLL, an EXE - or what? (Patience please; I'm really new here.) But I really love the program! It's perfect otherwise!
I have a solution, even though im not a C# developer.
In the file 'MainWindow.xaml.cs' in 'src/views' in the 'OnLoaded' function, after '_viewModel.FocusRequested += OnFocusRequested;' add this:
string folder = Directory.GetCurrentDirectory();
string[] args = Environment.GetCommandLineArgs();
if (args.Length > 1)
{
string file = args[1];
string fileAb = System.IO.Path.GetFullPath(file);
string[] words = file.Split(' ');
char[] chars = file.ToCharArray();
if (chars.Length > 2 && chars[1] == ':' && chars[2] == '\\' && System.IO.Path.IsPathRooted(fileAb) && File.Exists(fileAb))
{
await _viewModel.Open(fileAb);
}
else if (System.IO.Path.IsPathRooted(fileAb) && File.Exists(fileAb))
{
await _viewModel.Open(fileAb);
}
else if (System.IO.Path.IsPathRooted(folder + "\\" + file) && File.Exists(folder + "\\" + file))
{
await _viewModel.Open(folder + "\\" + file);
}
}
I have gotten the program to open the file when i ran it through a console, so should work. Fell free to alter the code, if i have made an error.