Exemplo n.º 1
0
        public void ScanDeviceForContent()
        {
            EntryObjectDAO = new EntryObjectDAO();
            GetDevice();

            EntryManager EntryManager = new EntryManager(Device);

            EntryManager.FoundNewMusicEntryEvent += new EntryManager.FoundTrackEntryDelegate(FoundEntryObject);
            EntryManager.BeginFetchContent();
        }
Exemplo n.º 2
0
        public void InitializeHistoryTracksTab()
        {
            EntryObjectDAO entryDAO = new EntryObjectDAO();

            try
            {
                main_HistoryContentView.BindData(entryDAO.FetchSubmitted(), false);
            }
            catch (Exception ex)
            {
                Console.WriteLine("Initialize error: " + ex);
            }
        }
Exemplo n.º 3
0
        public void InitializeIgnoredTracksTab()
        {
            EntryObjectDAO entryDAO = new EntryObjectDAO();

            try
            {
                main_IgnoredTracksContentView.BindData(entryDAO.FetchIgnored(), true);
            }
            catch (Exception ex)
            {
                Console.WriteLine("Initialize error: " + ex);
            }
        }
Exemplo n.º 4
0
        public void InitializeScrobbleTracksTab()
        {
            if (ConfigurationManager.AppSettings["Scrobble_LastDate"] == "Never")
            {
                main_SubmitDate.Value = DateTime.UtcNow;
            }
            EntryObjectDAO entryDAO = new EntryObjectDAO();

            try
            {
                main_SubmitContentView.BindData(entryDAO.FetchNotSubmitted(), true);
            }
            catch (Exception ex)
            {
                Console.WriteLine("Initialize error: " + ex);
            }
        }
Exemplo n.º 5
0
        public void InitializeSummaryTab()
        {
            // Information
            EntryObjectDAO = new EntryObjectDAO();
            try
            {
                int TotalTracksStored = EntryObjectDAO.FetchAll() != null?EntryObjectDAO.FetchAll().Count : 0;

                lbl_TotalTracksStored.Text = "Total tracks stored: " + TotalTracksStored;

                int TracksScrobbled = EntryObjectDAO.FetchSubmitted() != null?EntryObjectDAO.FetchSubmitted().Count : 0;

                lbl_TracksScrobbled.Text = "Tracks scrobbled: " + TracksScrobbled;

                int TracksToScrobble = EntryObjectDAO.FetchNotSubmitted() != null?EntryObjectDAO.FetchNotSubmitted().Count : 0;

                lbl_TracksToScrobble.Text = "Tracks to scrobble: " + TracksToScrobble;

                int IgnoredTracks = EntryObjectDAO.FetchIgnored() != null?EntryObjectDAO.FetchIgnored().Count : 0;

                lbl_IgnoredTracks.Text = "Ignored tracks: " + IgnoredTracks;
            }
            catch
            {
                ToolBarStatusText = "There is nothing in your database, please fetch content from your device.";
            }

            // Device
            GetDevice();
            if (Device != null)
            {
                lbl_DevStatus.Text       = "Status: Connected";
                lbl_DevName.Text         = "Name: " + Device.FriendlyName;
                lbl_DevModel.Text        = "Model: " + Device.Model;
                lbl_DevManufacturer.Text = "Manufacturer: " + Device.Manufacturer;

                if (Device.BatteryLevel > 0)
                {
                    lbl_DevBatteryLevel.Text = "Battery level: " + Device.BatteryLevel + "%";
                }
                else
                {
                    lbl_DevBatteryLevel.Text = "Battery level: Not supported";
                }
            }
            else
            {
                lbl_DevStatus.Text       = "Status: Not connected";
                lbl_DevName.Text         = "Name: ";
                lbl_DevModel.Text        = "Model: ";
                lbl_DevManufacturer.Text = "Manufacturer: ";
                lbl_DevBatteryLevel.Text = "Battery level: ";
            }

            // Last.fm
            if (ConfigurationManager.AppSettings["LastFM_Username"] == "")
            {
                lbl_FMUsername.Text = "Username: None";
            }
            else
            {
                lbl_FMUsername.Text = "Username: "******"LastFM_Username"];
            }

            if (ConfigurationManager.AppSettings["Scrobble_LastDate"] == "")
            {
                lbl_FMLastScrobble.Text = "Last scrobble: Never";
            }
            else
            {
                lbl_FMLastScrobble.Text = "Last scrobble: " + ConfigurationManager.AppSettings["Scrobble_LastDate"];
            }
        }