Skip to content

Commit

Permalink
Some style updates
Browse files Browse the repository at this point in the history
  • Loading branch information
philippn committed Sep 21, 2014
1 parent c619fc0 commit 4bcf999
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 19 deletions.
13 changes: 3 additions & 10 deletions NowPlayingKiosk/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
using System;
using System.ComponentModel;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Net;
using System.Runtime.Serialization;
using System.Runtime.Serialization.Json;
using System.Security.Cryptography;
using System.Text;
using System.Threading;
using System.Windows;
using System.Windows.Controls;
Expand Down Expand Up @@ -162,9 +155,9 @@ private void Window_KeyDown(object sender, KeyEventArgs e)
private void LoadSkin()
{
string SkinPath = System.IO.Path.Combine(Directory.GetCurrentDirectory(), "Skin", "skin.xaml");
FileStream Fs = new FileStream(@SkinPath, FileMode.Open);
Grid Grid = System.Windows.Markup.XamlReader.Load(Fs) as Grid;
this.Content = Grid;
FileStream fs = new FileStream(@SkinPath, FileMode.Open);
Grid grid = System.Windows.Markup.XamlReader.Load(fs) as Grid;
Content = grid;
}

private void StartPoller()
Expand Down
3 changes: 2 additions & 1 deletion NowPlayingKiosk/NowPlayingTrackInfoProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@ public TrackInfo(string artist, string title)
public override bool Equals(Object obj)
{
if (obj == null || GetType() != obj.GetType()) return false;
TrackInfo o = (TrackInfo)obj;
TrackInfo o = (TrackInfo) obj;
// Use Equals to compare instance variables.
return Artist.Equals(o.Artist) && Title.Equals(o.Title);
}

public override int GetHashCode()
{
return Artist.GetHashCode() ^ Title.GetHashCode();
Expand Down
12 changes: 4 additions & 8 deletions NowPlayingKiosk/SpotifyNowPlayingTrackInfoProvider.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace NowPlayingKiosk
{
Expand All @@ -28,11 +24,11 @@ public TrackInfo WhatIsNowPlaying()
if (windowTitle != null)
{
// For example "Foo Fighters – Monkey Wrench"
int Idx = windowTitle.IndexOf('–');
if (Idx != -1)
int idx = windowTitle.IndexOf('–');
if (idx != -1)
{
string artist = windowTitle.Substring(0, Idx).Trim();
string title = windowTitle.Substring(Idx + 1).Trim();
string artist = windowTitle.Substring(0, idx).Trim();
string title = windowTitle.Substring(idx + 1).Trim();
nowPlaying = new TrackInfo(artist, title);
}
}
Expand Down

0 comments on commit 4bcf999

Please sign in to comment.