コード例 #1
0
ファイル: Serializer.cs プロジェクト: stargatepit/ChanSort
        public override void Save(string tvOutputFile)
        {
            if (tvOutputFile != FileName)
            {
                File.Copy(FileName, tvOutputFile);
                FileName = tvOutputFile;
            }

            using var file = new StreamWriter(tvOutputFile);
            foreach (var channel in allChannels.GetChannelsByNewOrder())
            {
                // when a reference list was applied, the list may contain proxy entries for deleted channels, which must be ignored
                if (channel is Channels vdrChannel && !channel.IsDeleted)
                {
                    file.WriteLine(vdrChannel.confLine);
                }
            }
        }