AcManager.Controls.Converters.TrackIdToTrackWrapperConverter.Convert C# (CSharp) Метод

Convert() публичный Метод

public Convert ( object value, Type targetType, object parameter, CultureInfo culture ) : object
value object
targetType System.Type
parameter object
culture System.Globalization.CultureInfo
Результат object
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture) {
            var id = value?.ToString();
            if (id == null) return null;

            var delimiter = id.IndexOf('/');
            if (delimiter != -1) {
                id = id.Substring(0, delimiter);
            }

            var wrapper = TracksManager.Instance.GetWrapperById(id);
            if (wrapper == null) return null;

            if (!wrapper.IsLoaded) wrapper.LoadedAsync().Forget();
            return wrapper;
        }
TrackIdToTrackWrapperConverter