diff --git a/WazeWP7/App.xaml b/WazeWP7/App.xaml index 3b0c239..56c84d7 100644 --- a/WazeWP7/App.xaml +++ b/WazeWP7/App.xaml @@ -1,419 +1,393 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Visible - - - - - - - Collapsed - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Visible + + + + + + + Collapsed + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/WazeWP7/App_Readme/Content/CloudBlobInterfaces.png b/WazeWP7/App_Readme/Content/CloudBlobInterfaces.png new file mode 100644 index 0000000..1d19eb1 Binary files /dev/null and b/WazeWP7/App_Readme/Content/CloudBlobInterfaces.png differ diff --git a/WazeWP7/App_Readme/Content/CloudQueueInterfaces.png b/WazeWP7/App_Readme/Content/CloudQueueInterfaces.png new file mode 100644 index 0000000..f07bd09 Binary files /dev/null and b/WazeWP7/App_Readme/Content/CloudQueueInterfaces.png differ diff --git a/WazeWP7/App_Readme/Content/CloudStorageClientResolver.png b/WazeWP7/App_Readme/Content/CloudStorageClientResolver.png new file mode 100644 index 0000000..c658297 Binary files /dev/null and b/WazeWP7/App_Readme/Content/CloudStorageClientResolver.png differ diff --git a/WazeWP7/App_Readme/Content/CloudTableInterfaces.png b/WazeWP7/App_Readme/Content/CloudTableInterfaces.png new file mode 100644 index 0000000..c6f3b16 Binary files /dev/null and b/WazeWP7/App_Readme/Content/CloudTableInterfaces.png differ diff --git a/WazeWP7/App_Readme/Content/Site.css b/WazeWP7/App_Readme/Content/Site.css new file mode 100644 index 0000000..75495ba --- /dev/null +++ b/WazeWP7/App_Readme/Content/Site.css @@ -0,0 +1,329 @@ +/*---------------------------------------------------------- +The base color for this template is #5c87b2. If you'd like +to use a different color start by replacing all instances of +#5c87b2 with your new color. +----------------------------------------------------------*/ +body +{ + background-color: #ffffff; + font-weight: normal; + font-size: 15px; + font-family: "Segoe UI" , "Helvetica" , "Tahoma" , "Arial"; + margin: 0; + padding: 0; + color: #696969; +} + +a +{ + color: #3387dd; +} + +a:link +{ + color: #3387dd; + text-decoration: none; +} + +a:visited +{ + color: #3387dd; + text-decoration: none; +} + +a:hover +{ + color: #1d60ff; + text-decoration: none; +} + +p, ul +{ + margin-bottom: 20px; + line-height: 1.6em; +} + +/* HEADINGS +----------------------------------------------------------*/ +h1, h2, h3, h4, h5, h6 +{ + font-size: 1.5em; + color: #000; +} + +h1 +{ + font-size: 2em; + padding-bottom: 0; + margin-bottom: 0; +} + +h2 +{ + padding: 0 0 10px 0; + font-size: 2.8em; + font-weight: lighter; + color: #6cbd45; + margin-top: 0px; + margin-bottom: 0px; + padding-bottom: 0px; +} + +h3 +{ + font-size: 22px; + font-weight: normal; + color: #939896; + margin-bottom: 4px; +} + +h4 +{ + font-size: 1.1em; +} + +h5, h6 +{ + font-size: 1em; +} + +/* this rule styles

tags that are the +first child of the left and right table columns */ +.rightColumn > h1, .rightColumn > h2, .leftColumn > h1, .leftColumn > h2 +{ + margin-top: 0; +} + +/* PRIMARY LAYOUT ELEMENTS +----------------------------------------------------------*/ + +/* you can specify a greater or lesser percentage for the +page width. Or, you can specify an exact pixel width. */ +.page +{ + width: 90%; + margin-left: auto; + margin-right: auto; +} + +#header +{ + position: relative; + margin-bottom: 0px; + color: #000; + padding: 0; +} + +#header h1 +{ + font-weight: normal; + padding: 5px 0px 0px 47px; + margin: 0; + color: #000; + border: none; + line-height: 2em; + font-size: 24px !important; +} + +#main +{ + padding: 0px 0px 0px 0px; + background-color: #fff; + margin-top: 0px; + margin-bottom: 10px; +} + +#footer +{ + color: #999; + padding: 10px 0; + text-align: center; + line-height: normal; + margin: 0; + font-size: .9em; +} + +/* TAB MENU +----------------------------------------------------------*/ +ul#menu +{ + padding: 0 0 2px; + position: relative; + margin: 0; + text-align: left; +} + +ul#menu li +{ + display: inline; + list-style: none; +} + +ul#menu li a +{ + font-weight: normal; + font-size: 19px; + text-decoration: none; + color: #939896; + margin-right: 15px; +} + +ul#menu li a:hover +{ + color: #202020; + text-decoration: none; +} + +ul#menu li.selected a +{ + color: #202020; + color: #000; +} + +/* FORM LAYOUT ELEMENTS +----------------------------------------------------------*/ + +fieldset +{ + padding: 1em; + border: none; + background-color: #eeeeee; +} + +fieldset.group:after +{ + content: "."; + display: block; + height: 0; + clear: both; + visibility: hidden; +} + +fieldset p +{ + margin: 2px 12px 10px 10px; +} + +fieldset div.user +{ + float: left; + width: 200px; + margin: 5px; +} + +label +{ + color: #202020; + font-size: 15px; +} + +input[type="text"] +{ + width: 200px; + height: 20px; + border: none; +} + +/* TABLE +----------------------------------------------------------*/ + +table +{ + border: none; + border-collapse: collapse; +} + +table td +{ + padding: 10px 12px; + border: none; + border-right: 2px solid white; + text-align: center; + min-width: 100px; +} + +table th +{ + padding: 10px 5px; + text-align: center; + background-color: #fff; + color: #939896; + font-size: 22px; + font-weight: normal; + border: none; + min-width: 100px; +} + +table tr +{ + min-height: 32px; +} + +table tr.d0 +{ + background-color: #eeeeee; +} + +table tr.d1 +{ + background-color: #e0e1e1; +} + +table tr td +{ + color: #202020; +} + +table td p +{ + margin: 0px; + font-size: 15px; + font-weight: normal; +} + +.left-aligned +{ + text-align: left; + min-width: 150px; +} + +/* MISC +----------------------------------------------------------*/ +.clear +{ + clear: both; +} + +#menucontainer +{ + margin-top: 10px; +} + +div#title +{ + display: block; + float: left; + text-align: left; +} + +.hidden +{ + display: none; +} + +.code +{ + background-color: #F7F7F7; + padding: 10px; + margin: 10px 10px 10px 0px; + border: #696969 2px solid; + max-width: 1000px; + min-width: 1000px; + color:#383838; + font-size: 90%; +} + +.note +{ + font-size: 85%; +} \ No newline at end of file diff --git a/WazeWP7/App_Readme/Content/StorageInitializer.png b/WazeWP7/App_Readme/Content/StorageInitializer.png new file mode 100644 index 0000000..7fb6005 Binary files /dev/null and b/WazeWP7/App_Readme/Content/StorageInitializer.png differ diff --git a/WazeWP7/App_Readme/Phone.Storage.Readme.htm b/WazeWP7/App_Readme/Phone.Storage.Readme.htm new file mode 100644 index 0000000..fd1c4e5 --- /dev/null +++ b/WazeWP7/App_Readme/Phone.Storage.Readme.htm @@ -0,0 +1,223 @@ + + + + + Windows Azure Storage Client Library for Windows Phone + + + + +
+
+ +
+
+

Introduction

+

+ The Windows Azure Storage Client library for Windows Phone + contains a set of classes to provide client access for Windows + Azure storage services such as Blobs, Tables and Queues.

+

Prerequisites

+ + +

Configuration

+

Configuring your Windows Azure Storage settings

+
    +
  1. The Windows Azure Storage Client library for Windows Phone works against any of the following + services: + +
  2. + +
  3. By default, this package is configured to access the Windows Azure Storage Emulator + directly. If you wish to change this, modify the App_Start\StorageInitializer.cs file, and set + the account type you desire for your application.

  4. +
    +
+ + +

How to use it

+

Storage Context Resolver

+

+ This library provides an ICloudStorageClientResolver + interface to create the clients for Blobs, Tables and Queues according to the Windows Azure + storage settings configured. There are two implementations for this interface: +

+
    +
  • CloudStorageClientResolverAccountAndKey: Lets you configure + your Windows Azure storage account settings (account name, account key, blob + service endpoint, queue service endpoint and table service endpoint) so your + phone application can + access them directly.
  • +
  • CloudStorageClientResolverProxies: Lets you configure your + Windows Azure storage proxy cloud services' settings (custom authorization + header, shared access signature service endpoint, queue proxy service endpoint + and table proxy service endpoint) so your phone application can access the + Queues and Tables services indirectly through the proxies, and using shared + access signatures for Blobs.
  • +
+
+ + +

Cloud Queues

+

+ After creating a + cloud queue client using the resolver, you can get a queue reference and operate with it using the following interface. +

+

+

Queues Sample

+

+ The following sample code shows how to create a new queue and immediately add a message + to it. +

+
+var queueClient = CloudStorageContext.Current.Resolver.CreateCloudQueueClient();
+var queue = queueClient.GetQueueReference("queuename");
+queue.Create(
+   r => queue.AddMessage(
+            new CloudQueueMessage { AsBytes = Encoding.UTF8.GetBytes("Message content") },
+            c =>
+            {
+                // Some logic here.
+            }));
+
+ + + +

Cloud Tables

+

+ After creating a + cloud table client using the resolver, you can create and delete tables or get the + TableServiceContext (which inherits from + DataServiceContext) to work with rows within a single table. +

+

+

Tables Sample

+

In order to operate with rows on a table, you need to first create a class that + inherits from TableServiceEntity to define the table structure. + Make sure to add the DataServiceEntity and EntitySet + attributes to the class definition, passing the table name as constructor + parameter for the latter.

+
+using System;
+using System.Globalization;
+using Microsoft.WindowsAzure.Samples.Data.Services.Client;
+using Microsoft.WindowsAzure.Samples.Phone.Storage;
+
+[DataServiceEntity]
+[EntitySet("SampleData")]
+public class SampleData : TableServiceEntity
+{
+    private string name;
+
+    public SampleData()
+        : base(
+              "PartitionKey",
+              string.Format(
+                  CultureInfo.InvariantCulture,
+                  "{0:10}_{1}",
+                  DateTime.MaxValue.Ticks - DateTime.Now.Ticks,
+                  Guid.NewGuid()))
+    {
+    }
+
+    public SampleData(string partitionKey, string rowKey)
+        : base(partitionKey, rowKey)
+    {
+    }
+
+    public string Name
+    {
+        get
+        {
+            return this.name;
+        }
+
+        set
+        {
+            this.name = value;
+            this.OnPropertyChanged("Name");
+        }
+    }
+}
+
+

+ Now + that we have the SampleData class, + you can use the following code to create a new SampleData table and immediately add a row + to it using the TableServiceContext. +

+
+var tableClient = CloudStorageContext.Current.Resolver.CreateCloudTableClient();
+var tableName = "SampleData";
+
+tableClient.CreateTableIfNotExist(
+    tableName,
+    p =>
+    {
+        var context = CloudStorageContext.Current.Resolver.CreateTableServiceContext();
+        var sampleData = new SampleData { Name = "John Doe" };
+
+        context.AddObject(tableName, sampleData);
+        context.BeginSaveChanges(
+            asyncResult =>
+            {
+                var response = context.EndSaveChanges(asyncResult);
+
+                // Some logic here.
+            },
+            null);
+    });
+
+ + + +

Cloud Blobs

+

+ After creating a + cloud blob client using the resolver, you can get a container reference and operate with it and + its contained blobs using the following interfaces. +

+

+

Blobs Sample

+

+ The following sample shows how to create a new public container with sample metadata and immediately add a blob + to it. +

+
+var blobClient = CloudStorageContext.Current.Resolver.CreateCloudBlobClient();
+var container = blobClient.GetContainerReference("sample-container");
+container.Metadata.Add("samplekey", "samplevalue");
+
+container.CreateIfNotExist(
+    BlobContainerPublicAccessType.Container,
+    response =>
+    {
+        var blob = container.GetBlobReference("sample-blob");
+        var sampleStream = new MemoryStream(Encoding.UTF8.GetBytes("sample content"));
+
+        blob.UploadFromStream(
+            sampleStream,
+            response2 =>
+            {
+                // Some logic here.
+            });
+    });
+
+ + +
+
+ + diff --git a/WazeWP7/App_Start/StorageInitializer.cs b/WazeWP7/App_Start/StorageInitializer.cs new file mode 100644 index 0000000..8352791 --- /dev/null +++ b/WazeWP7/App_Start/StorageInitializer.cs @@ -0,0 +1,39 @@ +[assembly: SilverlightActivator.ApplicationStartupMethod(typeof(WazeWP7.App_Start.StorageInitializer), "ApplicationStartup", Order = 10)] + +namespace WazeWP7.App_Start +{ + using System; + using System.Windows; + using Microsoft.WindowsAzure.Samples.Phone.Storage; + + public class StorageInitializer + { + public static void ApplicationStartup() + { + // By using CloudStorageClientResolverAccountAndKey.DevelopmentStorageAccountResolver you can connect directly + // against the Windows Azure Storage Emulator. + //var resolver = CloudStorageClientResolverAccountAndKey.DevelopmentStorageAccountResolver; + + // By using CloudStorageClientResolverProxies you can connect to a Windows Azure Web Role that contains the + // Windows Azure Storage Proxies. + // Create a new Cloud project with an MVC 3 Web Role and install the WindowsAzure.Storage NuGet package. + // var resolver = new CloudStorageClientResolverProxies( + // new StorageCredentialsAnonymous() /* By default, the proxy services are anonymous */, + // new Uri("http://localhost:81/sas"), + // new Uri("http://localhost:81/queues"), + // new Uri("http://localhost:81/tables"), + // Deployment.Current.Dispatcher); + + // By using CloudStorageClientResolverAccountAndKey you can connect to your Windows Azure Storage Services account directly. + // Just replace your Windows Azure Storage account credentials and endpoints. + var resolver = new CloudStorageClientResolverAccountAndKey( + new StorageCredentialsAccountAndKey("wazewp7", "UNG5ooM4Zbe5kHYKVLFz5y3qaY7d1KJtvfd375rjjgqQt6NhA1C4Vv/usJT2mmyVmaVR7XAA26hYV2OldnJXbg=="), + new Uri("http://wazewp7.blob.core.windows.net"), + new Uri("http://wazewp7.queue.core.windows.net"), + new Uri("http://wazewp7.table.core.windows.net"), + Deployment.Current.Dispatcher); + + CloudStorageContext.Current.Resolver = resolver; + } + } +} \ No newline at end of file diff --git a/WazeWP7/Properties/AssemblyInfo.cs b/WazeWP7/Properties/AssemblyInfo.cs index 15a38ec..abc2af8 100644 --- a/WazeWP7/Properties/AssemblyInfo.cs +++ b/WazeWP7/Properties/AssemblyInfo.cs @@ -32,6 +32,6 @@ // // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("0.9.8.7")] -[assembly: AssemblyFileVersion("0.9.8.7")] +[assembly: AssemblyVersion("0.9.8.8")] +[assembly: AssemblyFileVersion("0.9.8.8")] [assembly: NeutralResourcesLanguageAttribute("en-US")] diff --git a/WazeWP7/WazeWP7.csproj b/WazeWP7/WazeWP7.csproj index 6e93ab9..04b805f 100644 --- a/WazeWP7/WazeWP7.csproj +++ b/WazeWP7/WazeWP7.csproj @@ -51,6 +51,9 @@ ..\converted\cibyl.dll + + ..\packages\Phone.Storage.1.0.1\lib\sl40-wp71\Data.Services.Client.dll + @@ -67,6 +70,12 @@ .\NBidi.dll + + ..\packages\Phone.Storage.1.0.1\lib\sl40-wp71\Phone.Storage.dll + + + ..\packages\SilverlightActivator.1.0.4\lib\sl4-wp71\SilverlightActivator.dll + @@ -89,6 +98,7 @@ GamePage.xaml + @@ -166,6 +176,7 @@ + WelcomePage.xaml @@ -245,6 +256,7 @@ + @@ -742,6 +754,13 @@ Always + + + + + + + Always diff --git a/WazeWP7/WebStats.cs b/WazeWP7/WebStats.cs index 0d2c030..c0c83c6 100644 --- a/WazeWP7/WebStats.cs +++ b/WazeWP7/WebStats.cs @@ -9,26 +9,47 @@ using System.Windows.Media.Animation; using System.Windows.Shapes; +using System.Globalization; +using Microsoft.WindowsAzure.Samples.Data.Services.Client; +using Microsoft.WindowsAzure.Samples.Phone.Storage; + + namespace WazeWP7 { - public class WebStats + + [DataServiceEntity] + [EntitySet("WazeStatLog")] + public class WazeStatLog : TableServiceEntity { - private static string loglineUrl; - static WebStats() + private string name; + + public WazeStatLog() + : base( + "PartitionKey", + string.Format( + CultureInfo.InvariantCulture, + "{0:10}_{1}", + DateTime.MaxValue.Ticks - DateTime.Now.Ticks, + Guid.NewGuid())) { + } - + public WazeStatLog(string partitionKey, string rowKey) + : base(partitionKey, rowKey) + { + } - byte[] deviceIDbyte = (byte[])Microsoft.Phone.Info.DeviceExtendedProperties.GetValue("DeviceUniqueId"); - string DeviceID = Convert.ToBase64String(deviceIDbyte); + public string DeviceID { get; set; } + public string Lang { get; set; } + public string Ver { get; set; } + public string DeviceType { get; set; } + } - loglineUrl = string.Format("http://wazewp7.appspot.com/?DeviceID={0}&lang={1}&ver={2}&DeviceType={3}", - DeviceID, - LanguageResources.Instance.CurrentLanguage, - GamePage.get().GetAppVersion(), - Microsoft.Phone.Info.DeviceStatus.DeviceName - ); + public class WebStats + { + static WebStats() + { } @@ -37,9 +58,47 @@ public static void ReportWebStat() try { - HttpWebRequest wr = WebRequest.CreateHttp(loglineUrl); - wr.Method = "GET"; - wr.BeginGetResponse(new AsyncCallback(GetResult),new object()); + + byte[] deviceIDbyte = (byte[])Microsoft.Phone.Info.DeviceExtendedProperties.GetValue("DeviceUniqueId"); + string deviceID = Convert.ToBase64String(deviceIDbyte); + + WazeWP7.App_Start.StorageInitializer.ApplicationStartup(); + var tableClient = CloudStorageContext.Current.Resolver.CreateCloudTableClient(); + var tableName = "WazeStatLog"; + + tableClient.CreateTableIfNotExist( + tableName, + p => + { + var context = CloudStorageContext.Current.Resolver.CreateTableServiceContext(); + var wazeStatLog = new WazeStatLog { + DeviceID = deviceID, + Lang = LanguageResources.Instance.CurrentLanguage, + Ver = GamePage.get().GetAppVersion(), + DeviceType = Microsoft.Phone.Info.DeviceStatus.DeviceName, + Timestamp = DateTime.Now + }; + + context.AddObject(tableName, wazeStatLog); + context.BeginSaveChanges( + asyncResult => + { + try + { + var response = context.EndSaveChanges(asyncResult); + + } + catch (Exception exc) + { + System.Diagnostics.Debug.WriteLine(exc.ToString()); + + } + + }, + null); + }); + + } @@ -50,10 +109,7 @@ public static void ReportWebStat() } - private static void GetResult(IAsyncResult result) - { - } } } diff --git a/WazeWP7/packages.config b/WazeWP7/packages.config new file mode 100644 index 0000000..a45351a --- /dev/null +++ b/WazeWP7/packages.config @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/packages/Phone.Storage.1.0.1/Phone.Storage.1.0.1.nupkg b/packages/Phone.Storage.1.0.1/Phone.Storage.1.0.1.nupkg new file mode 100644 index 0000000..0b164a7 Binary files /dev/null and b/packages/Phone.Storage.1.0.1/Phone.Storage.1.0.1.nupkg differ diff --git a/packages/Phone.Storage.1.0.1/content/App_Readme/Content/CloudBlobInterfaces.png b/packages/Phone.Storage.1.0.1/content/App_Readme/Content/CloudBlobInterfaces.png new file mode 100644 index 0000000..1d19eb1 Binary files /dev/null and b/packages/Phone.Storage.1.0.1/content/App_Readme/Content/CloudBlobInterfaces.png differ diff --git a/packages/Phone.Storage.1.0.1/content/App_Readme/Content/CloudQueueInterfaces.png b/packages/Phone.Storage.1.0.1/content/App_Readme/Content/CloudQueueInterfaces.png new file mode 100644 index 0000000..f07bd09 Binary files /dev/null and b/packages/Phone.Storage.1.0.1/content/App_Readme/Content/CloudQueueInterfaces.png differ diff --git a/packages/Phone.Storage.1.0.1/content/App_Readme/Content/CloudStorageClientResolver.png b/packages/Phone.Storage.1.0.1/content/App_Readme/Content/CloudStorageClientResolver.png new file mode 100644 index 0000000..c658297 Binary files /dev/null and b/packages/Phone.Storage.1.0.1/content/App_Readme/Content/CloudStorageClientResolver.png differ diff --git a/packages/Phone.Storage.1.0.1/content/App_Readme/Content/CloudTableInterfaces.png b/packages/Phone.Storage.1.0.1/content/App_Readme/Content/CloudTableInterfaces.png new file mode 100644 index 0000000..c6f3b16 Binary files /dev/null and b/packages/Phone.Storage.1.0.1/content/App_Readme/Content/CloudTableInterfaces.png differ diff --git a/packages/Phone.Storage.1.0.1/content/App_Readme/Content/Site.css b/packages/Phone.Storage.1.0.1/content/App_Readme/Content/Site.css new file mode 100644 index 0000000..75495ba --- /dev/null +++ b/packages/Phone.Storage.1.0.1/content/App_Readme/Content/Site.css @@ -0,0 +1,329 @@ +/*---------------------------------------------------------- +The base color for this template is #5c87b2. If you'd like +to use a different color start by replacing all instances of +#5c87b2 with your new color. +----------------------------------------------------------*/ +body +{ + background-color: #ffffff; + font-weight: normal; + font-size: 15px; + font-family: "Segoe UI" , "Helvetica" , "Tahoma" , "Arial"; + margin: 0; + padding: 0; + color: #696969; +} + +a +{ + color: #3387dd; +} + +a:link +{ + color: #3387dd; + text-decoration: none; +} + +a:visited +{ + color: #3387dd; + text-decoration: none; +} + +a:hover +{ + color: #1d60ff; + text-decoration: none; +} + +p, ul +{ + margin-bottom: 20px; + line-height: 1.6em; +} + +/* HEADINGS +----------------------------------------------------------*/ +h1, h2, h3, h4, h5, h6 +{ + font-size: 1.5em; + color: #000; +} + +h1 +{ + font-size: 2em; + padding-bottom: 0; + margin-bottom: 0; +} + +h2 +{ + padding: 0 0 10px 0; + font-size: 2.8em; + font-weight: lighter; + color: #6cbd45; + margin-top: 0px; + margin-bottom: 0px; + padding-bottom: 0px; +} + +h3 +{ + font-size: 22px; + font-weight: normal; + color: #939896; + margin-bottom: 4px; +} + +h4 +{ + font-size: 1.1em; +} + +h5, h6 +{ + font-size: 1em; +} + +/* this rule styles

tags that are the +first child of the left and right table columns */ +.rightColumn > h1, .rightColumn > h2, .leftColumn > h1, .leftColumn > h2 +{ + margin-top: 0; +} + +/* PRIMARY LAYOUT ELEMENTS +----------------------------------------------------------*/ + +/* you can specify a greater or lesser percentage for the +page width. Or, you can specify an exact pixel width. */ +.page +{ + width: 90%; + margin-left: auto; + margin-right: auto; +} + +#header +{ + position: relative; + margin-bottom: 0px; + color: #000; + padding: 0; +} + +#header h1 +{ + font-weight: normal; + padding: 5px 0px 0px 47px; + margin: 0; + color: #000; + border: none; + line-height: 2em; + font-size: 24px !important; +} + +#main +{ + padding: 0px 0px 0px 0px; + background-color: #fff; + margin-top: 0px; + margin-bottom: 10px; +} + +#footer +{ + color: #999; + padding: 10px 0; + text-align: center; + line-height: normal; + margin: 0; + font-size: .9em; +} + +/* TAB MENU +----------------------------------------------------------*/ +ul#menu +{ + padding: 0 0 2px; + position: relative; + margin: 0; + text-align: left; +} + +ul#menu li +{ + display: inline; + list-style: none; +} + +ul#menu li a +{ + font-weight: normal; + font-size: 19px; + text-decoration: none; + color: #939896; + margin-right: 15px; +} + +ul#menu li a:hover +{ + color: #202020; + text-decoration: none; +} + +ul#menu li.selected a +{ + color: #202020; + color: #000; +} + +/* FORM LAYOUT ELEMENTS +----------------------------------------------------------*/ + +fieldset +{ + padding: 1em; + border: none; + background-color: #eeeeee; +} + +fieldset.group:after +{ + content: "."; + display: block; + height: 0; + clear: both; + visibility: hidden; +} + +fieldset p +{ + margin: 2px 12px 10px 10px; +} + +fieldset div.user +{ + float: left; + width: 200px; + margin: 5px; +} + +label +{ + color: #202020; + font-size: 15px; +} + +input[type="text"] +{ + width: 200px; + height: 20px; + border: none; +} + +/* TABLE +----------------------------------------------------------*/ + +table +{ + border: none; + border-collapse: collapse; +} + +table td +{ + padding: 10px 12px; + border: none; + border-right: 2px solid white; + text-align: center; + min-width: 100px; +} + +table th +{ + padding: 10px 5px; + text-align: center; + background-color: #fff; + color: #939896; + font-size: 22px; + font-weight: normal; + border: none; + min-width: 100px; +} + +table tr +{ + min-height: 32px; +} + +table tr.d0 +{ + background-color: #eeeeee; +} + +table tr.d1 +{ + background-color: #e0e1e1; +} + +table tr td +{ + color: #202020; +} + +table td p +{ + margin: 0px; + font-size: 15px; + font-weight: normal; +} + +.left-aligned +{ + text-align: left; + min-width: 150px; +} + +/* MISC +----------------------------------------------------------*/ +.clear +{ + clear: both; +} + +#menucontainer +{ + margin-top: 10px; +} + +div#title +{ + display: block; + float: left; + text-align: left; +} + +.hidden +{ + display: none; +} + +.code +{ + background-color: #F7F7F7; + padding: 10px; + margin: 10px 10px 10px 0px; + border: #696969 2px solid; + max-width: 1000px; + min-width: 1000px; + color:#383838; + font-size: 90%; +} + +.note +{ + font-size: 85%; +} \ No newline at end of file diff --git a/packages/Phone.Storage.1.0.1/content/App_Readme/Content/StorageInitializer.png b/packages/Phone.Storage.1.0.1/content/App_Readme/Content/StorageInitializer.png new file mode 100644 index 0000000..7fb6005 Binary files /dev/null and b/packages/Phone.Storage.1.0.1/content/App_Readme/Content/StorageInitializer.png differ diff --git a/packages/Phone.Storage.1.0.1/content/App_Readme/Phone.Storage.Readme.htm b/packages/Phone.Storage.1.0.1/content/App_Readme/Phone.Storage.Readme.htm new file mode 100644 index 0000000..fd1c4e5 --- /dev/null +++ b/packages/Phone.Storage.1.0.1/content/App_Readme/Phone.Storage.Readme.htm @@ -0,0 +1,223 @@ + + + + + Windows Azure Storage Client Library for Windows Phone + + + + +
+
+ +
+
+

Introduction

+

+ The Windows Azure Storage Client library for Windows Phone + contains a set of classes to provide client access for Windows + Azure storage services such as Blobs, Tables and Queues.

+

Prerequisites

+ + +

Configuration

+

Configuring your Windows Azure Storage settings

+
    +
  1. The Windows Azure Storage Client library for Windows Phone works against any of the following + services: + +
  2. + +
  3. By default, this package is configured to access the Windows Azure Storage Emulator + directly. If you wish to change this, modify the App_Start\StorageInitializer.cs file, and set + the account type you desire for your application.

  4. +
    +
+ + +

How to use it

+

Storage Context Resolver

+

+ This library provides an ICloudStorageClientResolver + interface to create the clients for Blobs, Tables and Queues according to the Windows Azure + storage settings configured. There are two implementations for this interface: +

+
    +
  • CloudStorageClientResolverAccountAndKey: Lets you configure + your Windows Azure storage account settings (account name, account key, blob + service endpoint, queue service endpoint and table service endpoint) so your + phone application can + access them directly.
  • +
  • CloudStorageClientResolverProxies: Lets you configure your + Windows Azure storage proxy cloud services' settings (custom authorization + header, shared access signature service endpoint, queue proxy service endpoint + and table proxy service endpoint) so your phone application can access the + Queues and Tables services indirectly through the proxies, and using shared + access signatures for Blobs.
  • +
+
+ + +

Cloud Queues

+

+ After creating a + cloud queue client using the resolver, you can get a queue reference and operate with it using the following interface. +

+

+

Queues Sample

+

+ The following sample code shows how to create a new queue and immediately add a message + to it. +

+
+var queueClient = CloudStorageContext.Current.Resolver.CreateCloudQueueClient();
+var queue = queueClient.GetQueueReference("queuename");
+queue.Create(
+   r => queue.AddMessage(
+            new CloudQueueMessage { AsBytes = Encoding.UTF8.GetBytes("Message content") },
+            c =>
+            {
+                // Some logic here.
+            }));
+
+ + + +

Cloud Tables

+

+ After creating a + cloud table client using the resolver, you can create and delete tables or get the + TableServiceContext (which inherits from + DataServiceContext) to work with rows within a single table. +

+

+

Tables Sample

+

In order to operate with rows on a table, you need to first create a class that + inherits from TableServiceEntity to define the table structure. + Make sure to add the DataServiceEntity and EntitySet + attributes to the class definition, passing the table name as constructor + parameter for the latter.

+
+using System;
+using System.Globalization;
+using Microsoft.WindowsAzure.Samples.Data.Services.Client;
+using Microsoft.WindowsAzure.Samples.Phone.Storage;
+
+[DataServiceEntity]
+[EntitySet("SampleData")]
+public class SampleData : TableServiceEntity
+{
+    private string name;
+
+    public SampleData()
+        : base(
+              "PartitionKey",
+              string.Format(
+                  CultureInfo.InvariantCulture,
+                  "{0:10}_{1}",
+                  DateTime.MaxValue.Ticks - DateTime.Now.Ticks,
+                  Guid.NewGuid()))
+    {
+    }
+
+    public SampleData(string partitionKey, string rowKey)
+        : base(partitionKey, rowKey)
+    {
+    }
+
+    public string Name
+    {
+        get
+        {
+            return this.name;
+        }
+
+        set
+        {
+            this.name = value;
+            this.OnPropertyChanged("Name");
+        }
+    }
+}
+
+

+ Now + that we have the SampleData class, + you can use the following code to create a new SampleData table and immediately add a row + to it using the TableServiceContext. +

+
+var tableClient = CloudStorageContext.Current.Resolver.CreateCloudTableClient();
+var tableName = "SampleData";
+
+tableClient.CreateTableIfNotExist(
+    tableName,
+    p =>
+    {
+        var context = CloudStorageContext.Current.Resolver.CreateTableServiceContext();
+        var sampleData = new SampleData { Name = "John Doe" };
+
+        context.AddObject(tableName, sampleData);
+        context.BeginSaveChanges(
+            asyncResult =>
+            {
+                var response = context.EndSaveChanges(asyncResult);
+
+                // Some logic here.
+            },
+            null);
+    });
+
+ + + +

Cloud Blobs

+

+ After creating a + cloud blob client using the resolver, you can get a container reference and operate with it and + its contained blobs using the following interfaces. +

+

+

Blobs Sample

+

+ The following sample shows how to create a new public container with sample metadata and immediately add a blob + to it. +

+
+var blobClient = CloudStorageContext.Current.Resolver.CreateCloudBlobClient();
+var container = blobClient.GetContainerReference("sample-container");
+container.Metadata.Add("samplekey", "samplevalue");
+
+container.CreateIfNotExist(
+    BlobContainerPublicAccessType.Container,
+    response =>
+    {
+        var blob = container.GetBlobReference("sample-blob");
+        var sampleStream = new MemoryStream(Encoding.UTF8.GetBytes("sample content"));
+
+        blob.UploadFromStream(
+            sampleStream,
+            response2 =>
+            {
+                // Some logic here.
+            });
+    });
+
+ + +
+
+ + diff --git a/packages/Phone.Storage.1.0.1/content/App_Start/StorageInitializer.cs.pp b/packages/Phone.Storage.1.0.1/content/App_Start/StorageInitializer.cs.pp new file mode 100644 index 0000000..73cd9b4 --- /dev/null +++ b/packages/Phone.Storage.1.0.1/content/App_Start/StorageInitializer.cs.pp @@ -0,0 +1,39 @@ +[assembly: SilverlightActivator.ApplicationStartupMethod(typeof($rootnamespace$.App_Start.StorageInitializer), "ApplicationStartup", Order = 10)] + +namespace $rootnamespace$.App_Start +{ + using System; + using System.Windows; + using Microsoft.WindowsAzure.Samples.Phone.Storage; + + public class StorageInitializer + { + public static void ApplicationStartup() + { + // By using CloudStorageClientResolverAccountAndKey.DevelopmentStorageAccountResolver you can connect directly + // against the Windows Azure Storage Emulator. + var resolver = CloudStorageClientResolverAccountAndKey.DevelopmentStorageAccountResolver; + + // By using CloudStorageClientResolverProxies you can connect to a Windows Azure Web Role that contains the + // Windows Azure Storage Proxies. + // Create a new Cloud project with an MVC 3 Web Role and install the WindowsAzure.Storage NuGet package. + // var resolver = new CloudStorageClientResolverProxies( + // new StorageCredentialsAnonymous() /* By default, the proxy services are anonymous */, + // new Uri("http://localhost:81/sas"), + // new Uri("http://localhost:81/queues"), + // new Uri("http://localhost:81/tables"), + // Deployment.Current.Dispatcher); + + // By using CloudStorageClientResolverAccountAndKey you can connect to your Windows Azure Storage Services account directly. + // Just replace your Windows Azure Storage account credentials and endpoints. + // var resolver = new CloudStorageClientResolverAccountAndKey( + // new StorageCredentialsAccountAndKey("[your account name]", "[your account key]"), + // new Uri("http://[your account name].blob.core.windows.net"), + // new Uri("http://[your account name].queue.core.windows.net"), + // new Uri("http://[your account name].table.core.windows.net"), + // Deployment.Current.Dispatcher); + + CloudStorageContext.Current.Resolver = resolver; + } + } +} \ No newline at end of file diff --git a/packages/Phone.Storage.1.0.1/lib/sl40-wp71/Data.Services.Client.dll b/packages/Phone.Storage.1.0.1/lib/sl40-wp71/Data.Services.Client.dll new file mode 100644 index 0000000..4e72105 Binary files /dev/null and b/packages/Phone.Storage.1.0.1/lib/sl40-wp71/Data.Services.Client.dll differ diff --git a/packages/Phone.Storage.1.0.1/lib/sl40-wp71/Phone.Storage.dll b/packages/Phone.Storage.1.0.1/lib/sl40-wp71/Phone.Storage.dll new file mode 100644 index 0000000..0c78027 Binary files /dev/null and b/packages/Phone.Storage.1.0.1/lib/sl40-wp71/Phone.Storage.dll differ diff --git a/packages/Phone.Storage.1.0.1/tools/Install.ps1 b/packages/Phone.Storage.1.0.1/tools/Install.ps1 new file mode 100644 index 0000000..cb8beaf --- /dev/null +++ b/packages/Phone.Storage.1.0.1/tools/Install.ps1 @@ -0,0 +1,5 @@ +param($installPath, $toolsPath, $package, $project) + +$path = [System.IO.Path] +$readmeFile = $path::Combine($path::GetDirectoryName($project.FileName), "App_Readme\Phone.Storage.Readme.htm") +$DTE.ItemOperations.Navigate($readmeFile, [EnvDTE.vsNavigateOptions]::vsNavigateOptionsNewWindow) diff --git a/packages/SilverlightActivator.1.0.3/SilverlightActivator.1.0.3.nupkg b/packages/SilverlightActivator.1.0.3/SilverlightActivator.1.0.3.nupkg new file mode 100644 index 0000000..bcc782d Binary files /dev/null and b/packages/SilverlightActivator.1.0.3/SilverlightActivator.1.0.3.nupkg differ diff --git a/packages/SilverlightActivator.1.0.3/content/App.xaml.transform b/packages/SilverlightActivator.1.0.3/content/App.xaml.transform new file mode 100644 index 0000000..800f504 --- /dev/null +++ b/packages/SilverlightActivator.1.0.3/content/App.xaml.transform @@ -0,0 +1,14 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/packages/SilverlightActivator.1.0.3/lib/sl4-wp71/SilverlightActivator.dll b/packages/SilverlightActivator.1.0.3/lib/sl4-wp71/SilverlightActivator.dll new file mode 100644 index 0000000..3660376 Binary files /dev/null and b/packages/SilverlightActivator.1.0.3/lib/sl4-wp71/SilverlightActivator.dll differ diff --git a/packages/SilverlightActivator.1.0.4/SilverlightActivator.1.0.4.nupkg b/packages/SilverlightActivator.1.0.4/SilverlightActivator.1.0.4.nupkg new file mode 100644 index 0000000..0fc6b1b Binary files /dev/null and b/packages/SilverlightActivator.1.0.4/SilverlightActivator.1.0.4.nupkg differ diff --git a/packages/SilverlightActivator.1.0.4/content/App.xaml.transform b/packages/SilverlightActivator.1.0.4/content/App.xaml.transform new file mode 100644 index 0000000..7a6ff57 --- /dev/null +++ b/packages/SilverlightActivator.1.0.4/content/App.xaml.transform @@ -0,0 +1,14 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/packages/SilverlightActivator.1.0.4/lib/sl4-wp71/SilverlightActivator.dll b/packages/SilverlightActivator.1.0.4/lib/sl4-wp71/SilverlightActivator.dll new file mode 100644 index 0000000..0dcb340 Binary files /dev/null and b/packages/SilverlightActivator.1.0.4/lib/sl4-wp71/SilverlightActivator.dll differ diff --git a/packages/repositories.config b/packages/repositories.config new file mode 100644 index 0000000..43f4bac --- /dev/null +++ b/packages/repositories.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file