示例#1
0
            protected override Java.Lang.Void RunInBackground(params string[] @params)
            {
                try
                {
                    int count = @params.Length;
                    if (count == 4)
                    {
                        PKey = @params[1];
                        // Retrieve storage account from connection-string.
                        CloudStorageAccount storageAccount = CloudStorageAccount.Parse(@params[3]);
                        // Create the table client.
                        CloudTableClient tableClient = storageAccount.CreateCloudTableClient();
                        // Create a cloud table object for the table.
                        CloudTable cloudTable = tableClient.GetTableReference(@params[0]);
                        // Create an operation to retrieve
                        TableOperation retrieveEntity = TableOperation.Retrieve<AzureTableEntity>(@params[1], @params[2]);
                        TableResult retrievedResult = cloudTable.ExecuteAsync(retrieveEntity).Result;
                        local_return_var = (AzureTableEntity)retrievedResult.Result;
                    }
                }
                catch (System.Exception e)
                {
                    System.Diagnostics.Debug.WriteLine("RetrieveSingleTableEntry" + e.Message);
                }

                return null;
            }
示例#2
0
            protected override Java.Lang.Void RunInBackground(params string[] @params)
            {
                try
                {
                    int count = @params.Length;
                    if (count == 5)
                    {
                        //Add a band readings Table for the new user:
                        // Retrieve storage account from connection-string.
                        CloudStorageAccount storageAccount =
                                CloudStorageAccount.Parse(@params[4]);
                        // Create the table client.
                        CloudTableClient tableClient = storageAccount.CreateCloudTableClient();

                        // Create a cloud table object for the table.
                        CloudTable cloudTable = tableClient.GetTableReference(@params[0]);

                        // Create an operation to retrieve

                        AzureTableEntity tableEntry = new AzureTableEntity(@params[1], @params[2], @params[3]);
                        tableEntry.Value = @params[1];
                        TableOperation insertEntry = TableOperation.InsertOrReplace(tableEntry);
                        cloudTable.ExecuteAsync(insertEntry);
                    }
                }
                catch (System.Exception e)
                {
                    System.Diagnostics.Debug.WriteLine(e.Message);
                }
                return null;
            }