C# Class BeatMachine.Model.DataModel

Inheritance: ViewModelBase
Show file Open project: yavorg/Beat-Machine Class Usage Examples

Public Methods

Method Description
AnalyzeSongs ( object state ) : void
AnalyzeSongs_CatalogUpdateCompleted ( object sender, BeatMachine.EchoNest.EchoNestApiEventArgs e ) : void
DataModel ( ) : System
DiffSongs ( object state ) : void
DownloadAnalyzedSongs ( object state ) : void
DownloadAnalyzedSongsAlreadyInRemoteCatalog ( object state ) : void
DownloadAnalyzedSongsAlreadyInRemoteCatalog_CatalogReadCompleted ( object sender, BeatMachine.EchoNest.EchoNestApiEventArgs e ) : void
DownloadAnalyzedSongs_CatalogReadCompleted ( object sender, BeatMachine.EchoNest.EchoNestApiEventArgs e ) : void
GetAnalyzedSongs ( object state ) : void
GetSongsOnDevice ( object state ) : void
Initialize ( ) : void
LoadCatalogId ( object state ) : void

Ensures Model.CatalogId is populated. Will try the following: 1. Try loading it from the "CatalogId" setting in storage 2. If (1) is successful, it will try reading 1 song from the catalog to make sure it is there on the web service 3. If (1) or (2) fails, it will create a new catalog on the web service

LoadCatalogIdNeedsToCheckCatalogId_CatalogUpdateCompleted ( object sender, BeatMachine.EchoNest.EchoNestApiEventArgs e ) : void
LoadCatalogIdNeedsToCreateCatalog_CatalogCreateCompleted ( object sender, BeatMachine.EchoNest.EchoNestApiEventArgs e ) : void
RunWorkflow ( string eventPropertyName ) : void

This method will look at the state of this object and run the remaining steps in the workflow to make sure the data is fully loaded. This is useful in situaltions where the model may get serialized and stored, and then needs to be able to resume loading based on its state.

Private Methods

Method Description
AnalyzeSongsNeedsToRunAgain ( ) : void
CreateApiInstance ( ) : BeatMachine.EchoNest.EchoNestApi
DownloadAnalyzedSongsAlreadyInRemoteCatalogNeedsToRunAgain ( ) : void
DownloadAnalyzedSongsNeedsToRunAgain ( ) : void
LoadCatalogIdNeedsToCheckCatalogId ( string id ) : void
LoadCatalogIdNeedsToCreateCatalog ( ) : void
LoadCatalogIdNeedsToRunAgain ( ) : void
PropertyNameMatchesEventName ( string propertyName, string eventPropertyName ) : bool
StoreDownloadedSongs ( BeatMachine.EchoNest.Model.Catalog cat ) : void

Method Details

AnalyzeSongs() public method

public AnalyzeSongs ( object state ) : void
state object
return void

AnalyzeSongs_CatalogUpdateCompleted() public method

public AnalyzeSongs_CatalogUpdateCompleted ( object sender, BeatMachine.EchoNest.EchoNestApiEventArgs e ) : void
sender object
e BeatMachine.EchoNest.EchoNestApiEventArgs
return void

DataModel() public method

public DataModel ( ) : System
return System

DiffSongs() public method

public DiffSongs ( object state ) : void
state object
return void

DownloadAnalyzedSongs() public method

public DownloadAnalyzedSongs ( object state ) : void
state object
return void

DownloadAnalyzedSongsAlreadyInRemoteCatalog() public method

public DownloadAnalyzedSongsAlreadyInRemoteCatalog ( object state ) : void
state object
return void

DownloadAnalyzedSongsAlreadyInRemoteCatalog_CatalogReadCompleted() public method

public DownloadAnalyzedSongsAlreadyInRemoteCatalog_CatalogReadCompleted ( object sender, BeatMachine.EchoNest.EchoNestApiEventArgs e ) : void
sender object
e BeatMachine.EchoNest.EchoNestApiEventArgs
return void

DownloadAnalyzedSongs_CatalogReadCompleted() public method

public DownloadAnalyzedSongs_CatalogReadCompleted ( object sender, BeatMachine.EchoNest.EchoNestApiEventArgs e ) : void
sender object
e BeatMachine.EchoNest.EchoNestApiEventArgs
return void

GetAnalyzedSongs() public method

public GetAnalyzedSongs ( object state ) : void
state object
return void

GetSongsOnDevice() public method

public GetSongsOnDevice ( object state ) : void
state object
return void

Initialize() public method

public Initialize ( ) : void
return void

LoadCatalogId() public method

Ensures Model.CatalogId is populated. Will try the following: 1. Try loading it from the "CatalogId" setting in storage 2. If (1) is successful, it will try reading 1 song from the catalog to make sure it is there on the web service 3. If (1) or (2) fails, it will create a new catalog on the web service
public LoadCatalogId ( object state ) : void
state object
return void

LoadCatalogIdNeedsToCheckCatalogId_CatalogUpdateCompleted() public method

public LoadCatalogIdNeedsToCheckCatalogId_CatalogUpdateCompleted ( object sender, BeatMachine.EchoNest.EchoNestApiEventArgs e ) : void
sender object
e BeatMachine.EchoNest.EchoNestApiEventArgs
return void

LoadCatalogIdNeedsToCreateCatalog_CatalogCreateCompleted() public method

public LoadCatalogIdNeedsToCreateCatalog_CatalogCreateCompleted ( object sender, BeatMachine.EchoNest.EchoNestApiEventArgs e ) : void
sender object
e BeatMachine.EchoNest.EchoNestApiEventArgs
return void

RunWorkflow() public method

This method will look at the state of this object and run the remaining steps in the workflow to make sure the data is fully loaded. This is useful in situaltions where the model may get serialized and stored, and then needs to be able to resume loading based on its state.
public RunWorkflow ( string eventPropertyName ) : void
eventPropertyName string An optional eventPropertyName, /// to be used if this is attached as part of a property /// changed handler. If not used as part of the handler, /// set this to null.
return void