Exemple #1
0
 public void paymentQueueUpdatedDownloads(string json)
 {
     if (paymentQueueUpdatedDownloadsEvent != null)
     {
         paymentQueueUpdatedDownloadsEvent(StoreKitDownload.downloadsFromJson(json));
     }
 }
    public static StoreKitDownload downloadFromHashtable( Hashtable ht )
    {
        var download = new StoreKitDownload();
		
		if( ht.ContainsKey( "downloadState" ) )
        	download.downloadState = (StoreKitDownloadState)int.Parse( ht["downloadState"].ToString() );
		
		if( ht.ContainsKey( "contentLength" ) )
        	download.contentLength = double.Parse( ht["contentLength"].ToString() );
		
		if( ht.ContainsKey( "contentIdentifier" ) )
        	download.contentIdentifier = ht["contentIdentifier"].ToString();
		
		if( ht.ContainsKey( "contentURL" ) )
        	download.contentURL = ht["contentURL"].ToString();
		
		if( ht.ContainsKey( "contentVersion" ) )
			download.contentVersion = ht["contentVersion"].ToString();
		
		if( ht.ContainsKey( "error" ) )
			download.error = ht["error"].ToString();
		
		if( ht.ContainsKey( "progress" ) )
			download.progress = float.Parse( ht["progress"].ToString() );
		
		if( ht.ContainsKey( "timeRemaining" ) )
        	download.timeRemaining = double.Parse( ht["timeRemaining"].ToString() );
		
		if( ht.ContainsKey( "transaction" ) )
        	download.transaction = StoreKitTransaction.transactionFromHashtable( ht["transaction"] as Hashtable );

        return download;
    }
Exemple #3
0
    public static StoreKitDownload downloadFromDictionary( Dictionary<string,object> dict )
    {
        var download = new StoreKitDownload();
		
		if( dict.ContainsKey( "downloadState" ) )
        	download.downloadState = (StoreKitDownloadState)int.Parse( dict["downloadState"].ToString() );
		
		if( dict.ContainsKey( "contentLength" ) )
        	download.contentLength = double.Parse( dict["contentLength"].ToString() );
		
		if( dict.ContainsKey( "contentIdentifier" ) )
        	download.contentIdentifier = dict["contentIdentifier"].ToString();
		
		if( dict.ContainsKey( "contentURL" ) )
        	download.contentURL = dict["contentURL"].ToString();
		
		if( dict.ContainsKey( "contentVersion" ) )
			download.contentVersion = dict["contentVersion"].ToString();
		
		if( dict.ContainsKey( "error" ) )
			download.error = dict["error"].ToString();
		
		if( dict.ContainsKey( "progress" ) )
			download.progress = float.Parse( dict["progress"].ToString() );
		
		if( dict.ContainsKey( "timeRemaining" ) )
        	download.timeRemaining = double.Parse( dict["timeRemaining"].ToString() );
		
		if( dict.ContainsKey( "transaction" ) )
        	download.transaction = StoreKitTransaction.transactionFromDictionary( dict["transaction"] as Dictionary<string,object> );

        return download;
    }
Exemple #4
0
    public static StoreKitDownload downloadFromDictionary(Dictionary <string, object> dict)
    {
        var download = new StoreKitDownload();

        if (dict.ContainsKey("downloadState"))
        {
            download.downloadState = (StoreKitDownloadState)int.Parse(dict["downloadState"].ToString());
        }

        if (dict.ContainsKey("contentLength"))
        {
            download.contentLength = double.Parse(dict["contentLength"].ToString());
        }

        if (dict.ContainsKey("contentIdentifier"))
        {
            download.contentIdentifier = dict["contentIdentifier"].ToString();
        }

        if (dict.ContainsKey("contentURL"))
        {
            download.contentURL = dict["contentURL"].ToString();
        }

        if (dict.ContainsKey("contentVersion"))
        {
            download.contentVersion = dict["contentVersion"].ToString();
        }

        if (dict.ContainsKey("error"))
        {
            download.error = dict["error"].ToString();
        }

        if (dict.ContainsKey("progress"))
        {
            download.progress = float.Parse(dict["progress"].ToString());
        }

        if (dict.ContainsKey("timeRemaining"))
        {
            download.timeRemaining = double.Parse(dict["timeRemaining"].ToString());
        }

        if (dict.ContainsKey("transaction"))
        {
            download.transaction = StoreKitTransaction.transactionFromDictionary(dict["transaction"] as Dictionary <string, object>);
        }

        return(download);
    }
Exemple #5
0
    public static StoreKitDownload downloadFromHashtable(Hashtable ht)
    {
        var download = new StoreKitDownload();

        if (ht.ContainsKey("downloadState"))
        {
            download.downloadState = (StoreKitDownloadState)int.Parse(ht["downloadState"].ToString());
        }

        if (ht.ContainsKey("contentLength"))
        {
            download.contentLength = double.Parse(ht["contentLength"].ToString());
        }

        if (ht.ContainsKey("contentIdentifier"))
        {
            download.contentIdentifier = ht["contentIdentifier"].ToString();
        }

        if (ht.ContainsKey("contentURL"))
        {
            download.contentURL = ht["contentURL"].ToString();
        }

        if (ht.ContainsKey("contentVersion"))
        {
            download.contentVersion = ht["contentVersion"].ToString();
        }

        if (ht.ContainsKey("error"))
        {
            download.error = ht["error"].ToString();
        }

        if (ht.ContainsKey("progress"))
        {
            download.progress = float.Parse(ht["progress"].ToString());
        }

        if (ht.ContainsKey("timeRemaining"))
        {
            download.timeRemaining = double.Parse(ht["timeRemaining"].ToString());
        }

        if (ht.ContainsKey("transaction"))
        {
            download.transaction = StoreKitTransaction.transactionFromHashtable(ht["transaction"] as Hashtable);
        }

        return(download);
    }