Пример #1
0
        public FullTrackDataModel Parse(string fullTrack)
        {
            TrackOneModel track1          = null;
            TrackTwoModel track2          = null;
            bool          isTrackOneValid = false;
            bool          isTrackTwoValid = false;

            try
            {
                isTrackOneValid = _ValidateTrackOne(fullTrack);
                track1          = isTrackOneValid ? ParseTrackOne(fullTrack) : null;
            }
            catch (Exception)
            {
            }

            try
            {
                isTrackTwoValid = _ValidateTrackTwo(fullTrack);
                track2          = isTrackTwoValid ? ParseTrackTwo(fullTrack) : null;
            }
            catch (Exception)
            {
            }

            return(new FullTrackDataModel
            {
                TrackOne = track1,
                TrackTwo = track2,
                IsTrackOneValid = isTrackOneValid,
                IsTrackTwoValid = isTrackTwoValid
            });
        }
Пример #2
0
 public bool TryParseTrackTwo(string fullTrack, out TrackTwoModel trackTwo)
 {
     try
     {
         if (!fullTrack.Contains(_SS2))
         {
             trackTwo = null;
             return(false);
         }
         trackTwo = ParseTrackTwo(fullTrack);
         return(true);
     }
     catch (Exception)
     {
         trackTwo = null;
         return(false);
     }
 }