public void Test_GetFormatHandler() { var handler = new OpenChartFormatHandler(); var manager = new FormatManager(); Assert.Null(manager.GetFormatHandler(handler.FileExtension)); manager.AddFormat(handler); Assert.AreSame(handler, manager.GetFormatHandler(handler.FileExtension)); }
/// <summary> /// Initializes the app. /// </summary> public static void Init() { // Get the path to the folder where the executable is. AppFolder = Path.GetDirectoryName( Assembly.GetExecutingAssembly().Location ); Directory.SetCurrentDirectory(AppFolder); // Initialize libbass if (!Bass.Init()) { Console.WriteLine("Failed to initialize libbass"); App.Quit(); } Gtk.Application.Init(); Formats = new FormatManager(); Formats.AddFormat(new OpenChartFormatHandler()); NoteSkins = new NoteSkinManager(); NoteSkins.LoadAll(); }