public static void Startup() { ExportManager.Load(); TileList = new TileList(); TileEditor = new TileEditor(); MapList = new MapList(); MapEditor = new MapEditor(); LoadLayout(); var args = Environment.GetCommandLineArgs(); if (args.Length > 1) { if (File.Exists(args[1])) { FileTransfer.LoadFile(args[1], true, true); Globals.CurrentFilename = args[1]; Globals.MainWindow.Text = $"{Path.GetFileName(args[1])} - {ApplicationName}"; Globals.FileLoaded = true; Globals.FileChanged = false; } } else { NewFile(); } }
protected void LoadBook(ScoreBook book) { ScoreBook = book; OperationManager.Clear(); ExportManager.Load(book); NoteView.Initialize(book.Score); NoteViewScrollBar.Value = NoteViewScrollBar.GetMaximumValue(); NoteViewScrollBar.Minimum = -Math.Max(NoteView.UnitBeatTick * 4 * 20, NoteView.Notes.GetLastTick()); NoteViewScrollBar.SmallChange = NoteView.UnitBeatTick; UpdateThumbHeight(); SetText(book.Path); CurrentMusicSource = new SoundSource(); if (!string.IsNullOrEmpty(book.Path)) { SoundSettings.Default.ScoreSound.TryGetValue(book.Path, out SoundSource src); if (src != null) { CurrentMusicSource = src; } } }