コード例 #1
0
 public BroadcastInfoViewModel(PeerCastStation.UI.BroadcastInfo model)
 {
     streamType  = model.StreamType;
     streamUrl   = model.StreamUrl;
     bitrate     = model.Bitrate;
     contentType = model.ContentType;
     yellowPage  = model.YellowPage;
     channelName = model.ChannelName;
     genre       = model.Genre;
     description = model.Description;
     comment     = model.Comment;
     contactUrl  = model.ContactUrl;
     trackTitle  = model.TrackTitle;
     trackAlbum  = model.TrackAlbum;
     trackArtist = model.TrackArtist;
     trackGenre  = model.TrackGenre;
     trackUrl    = model.TrackUrl;
     favorite    = model.Favorite;
 }
コード例 #2
0
ファイル: APIHost.cs プロジェクト: kumaryu/peercaststation
 public void AddBroadcastHistory(JObject info)
 {
   var obj = new PeerCastStation.UI.BroadcastInfo();
   info.TryGetThen("streamType",  v => obj.StreamType  = v);
   info.TryGetThen("streamUrl",   v => obj.StreamUrl   = v);
   info.TryGetThen("bitrate",     v => obj.Bitrate     = v);
   info.TryGetThen("contentType", v => obj.ContentType = v);
   info.TryGetThen("yellowPage",  v => obj.YellowPage  = v);
   info.TryGetThen("channelName", v => obj.ChannelName = v);
   info.TryGetThen("genre",       v => obj.Genre       = v);
   info.TryGetThen("description", v => obj.Description = v);
   info.TryGetThen("comment",     v => obj.Comment     = v);
   info.TryGetThen("contactUrl",  v => obj.ContactUrl  = v);
   info.TryGetThen("trackTitle",  v => obj.TrackTitle  = v);
   info.TryGetThen("trackAlbum",  v => obj.TrackAlbum  = v);
   info.TryGetThen("trackArtist", v => obj.TrackArtist = v);
   info.TryGetThen("trackGenre",  v => obj.TrackGenre  = v);
   info.TryGetThen("trackUrl",    v => obj.TrackUrl    = v);
   info.TryGetThen("favorite",    v => obj.Favorite    = v);
   var settings = PeerCastApplication.Current.Settings.Get<UISettings>();
   var item = settings.FindBroadcastHistroryItem(obj);
   if (item!=null) {
     info.TryGetThen("favorite", v => item.Favorite = v);
   }
   else {
     settings.AddBroadcastHistory(obj);
   }
 }