コード例 #1
0
ファイル: Routines.cs プロジェクト: xlfdll/LyricOrganizer
        public static void Generate_DoWork(object sender, DoWorkEventArgs e)
        {
            BackgroundWorker worker = sender as BackgroundWorker;

            Object[]  arguments = e.Argument as Object[];
            LyricItem item      = arguments[0] as LyricItem;
            String    fileName  = arguments[1] as String;

            worker.ReportProgress(0, item.Provider.Name);

            LyricContent lyricContent = item.Provider.Retrieve(item);

            switch (Path.GetExtension(fileName))
            {
            case ".txt":
                TextLyricWriter writer = new TextLyricWriter(lyricContent);

                writer.WriteTo(fileName);

                break;

            default:
                break;
            }

            e.Result = fileName;
        }
コード例 #2
0
        public TextLyricWriter(LyricContent lyricContent)
        {
            this.LyricContent = lyricContent;

            this.Encoding = Encoding.UTF8;
            this.WriteAdditionalInformation = true;
        }