示例#1
0
        public async Task ImportAsync(string path)
        {
            if (scores == null)
            {
                //we want to contact a remote osu! to handle the import.
                await SendMessageAsync(new ScoreImportMessage { Path = path });

                return;
            }

            scores.ReadReplayFile(path);
        }
示例#2
0
        private void dragDrop(DragEventArgs e)
        {
            // this method will only be executed if e.Effect in dragEnter gets set to something other that None.
            var dropData  = (object[])e.Data.GetData(DataFormats.FileDrop);
            var filePaths = dropData.Select(f => f.ToString()).ToArray();

            if (filePaths.All(f => Path.GetExtension(f) == @".osz"))
            {
                Task.Run(() => BeatmapDatabase.Import(filePaths));
            }
            else if (filePaths.All(f => Path.GetExtension(f) == @".osr"))
            {
                Task.Run(() =>
                {
                    var score = ScoreDatabase.ReadReplayFile(filePaths.First());
                    Schedule(() => LoadScore(score));
                });
            }
        }