-
Notifications
You must be signed in to change notification settings - Fork 276
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
271 changed files
with
93,702 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
using System; | ||
using System.Globalization; | ||
using System.Windows; | ||
using System.Windows.Data; | ||
|
||
namespace FishMusic.Converter | ||
{ | ||
public class BytesSizeConverter : IValueConverter | ||
{ | ||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) | ||
{ | ||
if (value == null) | ||
{ | ||
return ""; | ||
} | ||
var size = (long)value; | ||
var kb = size / 1024.0; | ||
if (kb < 1000) | ||
{ | ||
return Math.Round(kb, 0) + "K"; | ||
} | ||
|
||
var mb = kb / 1024.0; | ||
return Math.Round(mb, 1) + "M"; | ||
} | ||
|
||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) | ||
{ | ||
return null; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
using System; | ||
using System.Globalization; | ||
using System.Windows; | ||
using System.Windows.Data; | ||
|
||
namespace FishMusic.Converter | ||
{ | ||
public class DateConverter : IValueConverter | ||
{ | ||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) | ||
{ | ||
if (value == null || parameter == null) | ||
{ | ||
return Visibility.Collapsed; | ||
} | ||
|
||
if (Boolean.Parse(parameter.ToString())) | ||
{ | ||
return ((DateTime) value).ToString("yyyy-MM-dd HH:mm:ss"); | ||
} | ||
else | ||
{ | ||
return ((DateTime)value).ToString("yyyy-MM-dd"); | ||
} | ||
} | ||
|
||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) | ||
{ | ||
return null; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
using System; | ||
using AnyListen.Models; | ||
using GalaSoft.MvvmLight; | ||
|
||
namespace FishMusic.Download | ||
{ | ||
public class DownloadInfo : ViewModelBase | ||
{ | ||
public SongResult SongInfo { get; set; } | ||
|
||
private int _progress; | ||
|
||
public int Progress | ||
{ | ||
get => _progress; | ||
set | ||
{ | ||
_progress = value; | ||
RaisePropertyChanged("Progress"); | ||
} | ||
} | ||
|
||
public string DownLink { get; set; } | ||
public string FilePath { get; set; } | ||
|
||
public string Id { get; set; } | ||
|
||
private DownStatus _status; | ||
|
||
public DownStatus Status | ||
{ | ||
get => _status; | ||
set | ||
{ | ||
_status = value; | ||
RaisePropertyChanged("Status"); | ||
} | ||
} | ||
|
||
private long _megaBytesDownloaded; | ||
|
||
public long MegaBytesDownloaded | ||
{ | ||
get => _megaBytesDownloaded; | ||
set | ||
{ | ||
_megaBytesDownloaded = value; | ||
RaisePropertyChanged("MegaBytesDownloaded"); | ||
} | ||
} | ||
|
||
private long _totalBytesToDownload; | ||
|
||
public long TotalBytesToDownload | ||
{ | ||
get => _totalBytesToDownload; | ||
set | ||
{ | ||
_totalBytesToDownload = value; | ||
RaisePropertyChanged("TotalBytesToDownload"); | ||
} | ||
} | ||
|
||
private long _downloadSpeed; | ||
|
||
public long DownloadSpeed | ||
{ | ||
get => _downloadSpeed; | ||
set | ||
{ | ||
_downloadSpeed = value; | ||
RaisePropertyChanged("DownloadSpeed"); | ||
} | ||
} | ||
|
||
public DateTime SuccessTime { get; set; } | ||
public DateTime CreateTime { get; set; } | ||
} | ||
|
||
public enum DownStatus | ||
{ | ||
WAITING, | ||
RUNNING, | ||
PAUSE, | ||
CANCLE, | ||
ERROR, | ||
SUCCESS, | ||
UNKNOWN | ||
} | ||
} |
Oops, something went wrong.