Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

More client Api

  • Loading branch information...
commit 0c2d9ae5a21afb70f8f7620db8e64b380d9275e5 1 parent 14cad0d
Anders Ljusberg authored
Showing with 35,579 additions and 397 deletions.
  1. +11 −1 Source/Entile.TestApp/Entile.TestApp.csproj
  2. +1 −373 Source/Entile.TestApp/Tests/EntileTests.cs
  3. +0 −23 Source/Entile.TestApp/UnitTest.cs
  4. +41 −0 Source/Entile.TestApp/ViewModels/ActionableObject.cs
  5. +64 −0 Source/Entile.TestApp/ViewModels/ApiCommandBase.cs
  6. +110 −0 Source/Entile.TestApp/ViewModels/EntileViewModel.cs
  7. +42 −0 Source/Entile.TestApp/ViewModels/IViewContext.cs
  8. +15 −0 Source/Entile.TestApp/ViewModels/RegisterClientCommand.cs
  9. +35 −0 Source/Entile.TestApp/ViewModels/RootApiCommand.cs
  10. +84 −0 Source/Entile.TestApp/ViewModels/SubscriptionViewModel.cs
  11. +15 −0 Source/Entile.TestApp/ViewModels/UnsubscribeCommand.cs
  12. +1 −0  Source/Entile.TestApp/packages.config
  13. BIN  Source/packages/Newtonsoft.Json.4.0.4/Newtonsoft.Json.4.0.4.nupkg
  14. BIN  Source/packages/Newtonsoft.Json.4.0.4/lib/net20/Newtonsoft.Json.dll
  15. BIN  Source/packages/Newtonsoft.Json.4.0.4/lib/net20/Newtonsoft.Json.pdb
  16. +7,859 −0 Source/packages/Newtonsoft.Json.4.0.4/lib/net20/Newtonsoft.Json.xml
  17. BIN  Source/packages/Newtonsoft.Json.4.0.4/lib/net35/Newtonsoft.Json.dll
  18. BIN  Source/packages/Newtonsoft.Json.4.0.4/lib/net35/Newtonsoft.Json.pdb
  19. +6,982 −0 Source/packages/Newtonsoft.Json.4.0.4/lib/net35/Newtonsoft.Json.xml
  20. BIN  Source/packages/Newtonsoft.Json.4.0.4/lib/net40/Newtonsoft.Json.dll
  21. BIN  Source/packages/Newtonsoft.Json.4.0.4/lib/net40/Newtonsoft.Json.pdb
  22. +7,141 −0 Source/packages/Newtonsoft.Json.4.0.4/lib/net40/Newtonsoft.Json.xml
  23. BIN  Source/packages/Newtonsoft.Json.4.0.4/lib/sl3-wp/Newtonsoft.Json.dll
  24. BIN  Source/packages/Newtonsoft.Json.4.0.4/lib/sl3-wp/Newtonsoft.Json.pdb
  25. +6,574 −0 Source/packages/Newtonsoft.Json.4.0.4/lib/sl3-wp/Newtonsoft.Json.xml
  26. BIN  Source/packages/Newtonsoft.Json.4.0.4/lib/sl4/Newtonsoft.Json.dll
  27. BIN  Source/packages/Newtonsoft.Json.4.0.4/lib/sl4/Newtonsoft.Json.pdb
  28. +6,604 −0 Source/packages/Newtonsoft.Json.4.0.4/lib/sl4/Newtonsoft.Json.xml
12 Source/Entile.TestApp/Entile.TestApp.csproj
View
@@ -62,6 +62,9 @@
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight">
<HintPath>..\packages\silverlight.unittest.wp7.3.0.40609.1000\lib\sl4-wp71\Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight.dll</HintPath>
</Reference>
+ <Reference Include="Newtonsoft.Json">
+ <HintPath>..\packages\Newtonsoft.Json.4.0.4\lib\sl3-wp\Newtonsoft.Json.dll</HintPath>
+ </Reference>
<Reference Include="System.Windows" />
<Reference Include="system" />
<Reference Include="System.Core" />
@@ -79,7 +82,14 @@
<Compile Include="MainWindowExtensions.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Tests\EntileTests.cs" />
- <Compile Include="UnitTest.cs" />
+ <Compile Include="ViewModels\ActionableObject.cs" />
+ <Compile Include="ViewModels\ApiCommandBase.cs" />
+ <Compile Include="ViewModels\EntileViewModel.cs" />
+ <Compile Include="ViewModels\IViewContext.cs" />
+ <Compile Include="ViewModels\RegisterClientCommand.cs" />
+ <Compile Include="ViewModels\RootApiCommand.cs" />
+ <Compile Include="ViewModels\SubscriptionViewModel.cs" />
+ <Compile Include="ViewModels\UnsubscribeCommand.cs" />
</ItemGroup>
<ItemGroup>
<ApplicationDefinition Include="App.xaml">
374 Source/Entile.TestApp/Tests/EntileTests.cs
View
@@ -1,382 +1,10 @@
-using System;
-using System.Collections.Generic;
-using System.Collections.ObjectModel;
-using System.IO;
-using System.Linq;
-using System.Net;
-using System.Text.RegularExpressions;
-using System.Windows.Input;
-using AgFx;
+using Entile.TestApp.ViewModels;
using Microsoft.Silverlight.Testing;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace Entile.TestApp.Tests
{
- public enum SubscriptionKind
- {
- Toast,
- Tile,
- Raw
- }
-
- public class ApiCommandBase : ICommand
- {
- private static readonly Regex ParametersRegex = new Regex(@"\{(?<param>\w+)\}");
-
- private IViewContext _viewContext;
- private string _uri;
- private string _method;
- private string[] _params;
-
- public ApiCommandBase(IViewContext viewContext, string uri, string method)
- {
- _viewContext = viewContext;
- _uri = uri;
- _method = method;
- _params = ParametersRegex.Matches(_uri).Cast<Match>().Select(m => m.Groups["param"].Value).ToArray();
- }
-
- public bool CanExecute(object parameter)
- {
- return _params.All(p => _viewContext.GetValue(p) != null);
- }
-
- public void Execute(object parameter)
- {
- var actualUri = ParametersRegex.Replace(_uri, m => _viewContext.GetValue(m.Groups["param"].Value).ToString());
-
- HttpWebRequest request = WebRequest.CreateHttp(actualUri);
- request.Accept = "application/json";
- request.Method = _method;
- if (request.Method != "GET")
- request.ContentType = "application/json";
-
- request.BeginGetResponse(ReadCallback, request);
- }
-
- private void ReadCallback(IAsyncResult asynchronousResult)
- {
- var request = (HttpWebRequest)asynchronousResult.AsyncState;
-
- var response = (HttpWebResponse)request.EndGetResponse(asynchronousResult);
-
- string content;
- using (var streamReader = new StreamReader(response.GetResponseStream()))
- {
- content = streamReader.ReadToEnd();
- }
-
- OnResponse((int)response.StatusCode, content);
- }
-
- public event EventHandler CanExecuteChanged;
-
- protected virtual void OnResponse(int statusCode, string response)
- {
-
- }
- }
-
- public class RootApiCommand : ApiCommandBase
- {
- private readonly EntileViewModel _viewModel;
-
- public RootApiCommand(EntileViewModel viewModel, string uri, string method)
- : base(viewModel.ViewContext, uri, method)
- {
- _viewModel = viewModel;
- }
-
- protected override void OnResponse(int statusCode, string response)
- {
- _viewModel.LoadLinks(new[]{new LinkModel() {Rel = "register", Uri = "http://localhost:4250", Method = "PUT" }});
- }
- }
-
- public class RegisterClientCommand : ApiCommandBase
- {
- public RegisterClientCommand(EntileViewModel viewModel, string uri, string method) :
- base(viewModel.ViewContext, uri, method)
- {
- }
-
- protected override void OnResponse(int statusCode, string response)
- {
-
- }
- }
-
- public class UnsubscribeCommand : ApiCommandBase
- {
- public UnsubscribeCommand(SubscriptionViewModel subscription, string uri, string method)
- : base(subscription.ViewContext, uri, method)
- {
- }
-
- protected override void OnResponse(int statusCode, string response)
- {
-
- }
- }
-
- public class SubscriptionViewModel : ActionableObject
- {
- private readonly EntileViewContext _viewContext;
-
- public SubscriptionViewModel(IViewContext clientViewContext, Guid subscriptionId, SubscriptionKind kind, string paramUri)
- {
- _viewContext = new EntileViewContext(clientViewContext);
-
- _subscriptionId = subscriptionId;
- ViewContext.SetValue("SubscriptionId", _subscriptionId);
- _kind = kind;
- _paramUri = paramUri;
- }
-
- protected override ICommand BuildCommand(string rel, string uri, string method)
- {
- switch(rel)
- {
- case "unsubscribe":
- return UnsubscribeCommand = new UnsubscribeCommand(this, uri, method);
- }
- return null;
- }
-
- protected override void RemoveCommand(string rel)
- {
- switch (rel)
- {
- case "unsubscribe":
- UnsubscribeCommand = null;
- break;
- }
- }
-
- private Guid _subscriptionId;
- public Guid SubscriptionId
- {
- get { return _subscriptionId; }
- }
-
- private SubscriptionKind _kind;
- public SubscriptionKind Kind
- {
- get { return _kind; }
- }
-
- private string _paramUri;
- public string ParamUri
- {
- get { return _paramUri; }
- }
-
- public EntileViewContext ViewContext
- {
- get { return _viewContext; }
- }
-
- private ICommand _unsubscribeCommand;
- public ICommand UnsubscribeCommand
- {
- get { return _unsubscribeCommand; }
- set
- {
- if (_unsubscribeCommand != value)
- {
- _unsubscribeCommand = value;
- RaisePropertyChanged("UnsubscribeCommand");
- }
- }
- }
- }
-
- public class EntileViewModel : ActionableObject
- {
- private readonly EntileViewContext _viewContext = new EntileViewContext();
-
- public EntileViewModel()
- {
- _clientId = Guid.NewGuid();
- ViewContext.SetValue("ClientId", _clientId);
- _rootApiCommand = new RootApiCommand(this, "http://localhost:4250/api", "GET");
- }
-
- protected override ICommand BuildCommand(string rel, string uri, string method)
- {
- switch (rel)
- {
- case "register":
- return RegisterClientCommand = new RegisterClientCommand(this, uri, method);
- }
- return null;
- }
-
- protected override void RemoveCommand(string rel)
- {
- switch (rel)
- {
- case "register":
- RegisterClientCommand = null;
- break;
- }
- }
-
- private bool _activated;
- public bool Activated
- {
- get { return _activated; }
- set
- {
- if (_activated != value)
- {
- _activated = value;
- RaisePropertyChanged("Activated");
- }
- }
- }
-
- private Guid _clientId;
- public Guid ClientId
- {
- get { return _clientId; }
- }
-
- private RegisterClientCommand _registerClientCommand;
- public RegisterClientCommand RegisterClientCommand
- {
- get { return _registerClientCommand; }
- set
- {
- if (_registerClientCommand != value)
- {
- _registerClientCommand = value;
- RaisePropertyChanged("RegisterClientCommand");
- }
- }
- }
-
- private RootApiCommand _rootApiCommand;
- public RootApiCommand RootApiCommand
- {
- get { return _rootApiCommand; }
- set
- {
- if (_rootApiCommand!= value)
- {
- _rootApiCommand = value;
- RaisePropertyChanged("RootApiCommand");
- }
- }
- }
-
- private ObservableCollection<SubscriptionViewModel> _subscriptions = new ObservableCollection<SubscriptionViewModel>();
- public ObservableCollection<SubscriptionViewModel> Subscriptions
- {
- get { return _subscriptions; }
- set
- {
- if (value == null)
- throw new ArgumentNullException("value");
-
- _subscriptions.Clear();
- foreach (var sub in value)
- {
- _subscriptions.Add(sub);
- }
-
- // RaisePropertyChanged("Subscriptions");
- }
- }
-
- public EntileViewContext ViewContext
- {
- get { return _viewContext; }
- }
- }
-
- public class ActionDefinition
- {
- private string _name;
- public string Name { get { return _name; } }
-
- }
-
- public interface IViewContext
- {
- object GetValue(string key);
- }
-
- public class EntileViewContext : IViewContext
- {
- private readonly IViewContext _parentContext;
-
- public EntileViewContext()
- {
- }
-
- public EntileViewContext(IViewContext parentContext)
- {
- _parentContext = parentContext;
- }
-
- private Dictionary<string, object> _lookup = new Dictionary<string, object>();
-
- public object GetValue(string key)
- {
- object val;
- if (_lookup.TryGetValue(key, out val))
- return val;
- if (_parentContext != null)
- return _parentContext.GetValue(key);
-
- return null;
- }
-
- public void SetValue(string key, object value)
- {
- _lookup[key] = value;
- }
- }
-
- public class LinkModel
- {
- public string Rel;
- public string Uri;
- public string Method;
- }
-
- public abstract class ActionableObject : NotifyPropertyChangedBase
- {
- private ObservableCollection<ICommand> _availableCommands = new ObservableCollection<ICommand>();
- private IEnumerable<LinkModel> _linkModels = new LinkModel[0];
-
- public void LoadLinks(IEnumerable<LinkModel> linkModels)
- {
- // Remove all old commands
- foreach(var linkmodel in _linkModels)
- {
- RemoveCommand(linkmodel.Rel);
- }
-
- // Replace with new
- _linkModels = linkModels.ToArray();
- foreach (var linkModel in _linkModels)
- {
- BuildCommand(linkModel.Rel, linkModel.Uri, linkModel.Method);
- }
- }
-
- protected abstract ICommand BuildCommand(string rel, string uri, string method);
- protected abstract void RemoveCommand(string rel);
-
- }
-
- public interface IDataFetcher
- {
-
- }
[TestClass]
public class EntileTests : SilverlightTest
23 Source/Entile.TestApp/UnitTest.cs
View
@@ -1,23 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using Microsoft.Silverlight.Testing;
-using Microsoft.VisualStudio.TestTools.UnitTesting;
-
-namespace Entile.TestApp
-{
- [TestClass]
- public class UnitTest : SilverlightTest
- {
- [TestInitialize]
- public void Initialize()
- {
- }
-
- [TestMethod]
- public void YourTestsHere()
- {
- Assert.Fail("Write your tests here.");
- }
- }
-}
41 Source/Entile.TestApp/ViewModels/ActionableObject.cs
View
@@ -0,0 +1,41 @@
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Linq;
+using System.Windows.Input;
+using AgFx;
+
+namespace Entile.TestApp.ViewModels
+{
+
+ public class LinkModel
+ {
+ public string Rel;
+ public string Uri;
+ }
+
+ public abstract class ActionableObject : NotifyPropertyChangedBase
+ {
+ private ObservableCollection<ICommand> _availableCommands = new ObservableCollection<ICommand>();
+ private IEnumerable<LinkModel> _linkModels = new LinkModel[0];
+
+ public void LoadLinks(IEnumerable<LinkModel> linkModels)
+ {
+ // Remove all old commands
+ foreach(var linkmodel in _linkModels)
+ {
+ RemoveCommand(linkmodel.Rel);
+ }
+
+ // Replace with new
+ _linkModels = linkModels.ToArray();
+ foreach (var linkModel in _linkModels)
+ {
+ BuildCommand(linkModel.Rel, linkModel.Uri);
+ }
+ }
+
+ protected abstract ICommand BuildCommand(string rel, string uri);
+ protected abstract void RemoveCommand(string rel);
+
+ }
+}
64 Source/Entile.TestApp/ViewModels/ApiCommandBase.cs
View
@@ -0,0 +1,64 @@
+using System;
+using System.IO;
+using System.Linq;
+using System.Net;
+using System.Text.RegularExpressions;
+using System.Windows.Input;
+
+namespace Entile.TestApp.ViewModels
+{
+ public class ApiCommandBase : ICommand
+ {
+ private static readonly Regex ParametersRegex = new Regex(@"\{(?<param>\w+)\}");
+
+ private IViewContext _viewContext;
+ private string _uri;
+ private string[] _params;
+
+ public ApiCommandBase(IViewContext viewContext, string uri)
+ {
+ _viewContext = viewContext;
+ _uri = uri;
+ _params = ParametersRegex.Matches(_uri).Cast<Match>().Select(m => m.Groups["param"].Value).ToArray();
+ }
+
+ public bool CanExecute(object parameter)
+ {
+ return _params.All(p => _viewContext.GetValue(p) != null);
+ }
+
+ public void Execute(object parameter)
+ {
+ var actualUri = ParametersRegex.Replace(_uri, m => _viewContext.GetValue(m.Groups["param"].Value).ToString());
+
+ HttpWebRequest request = WebRequest.CreateHttp(actualUri);
+ request.Accept = "application/json";
+ // if (request.Method != "GET")
+ // request.ContentType = "application/json";
+
+ request.BeginGetResponse(ReadCallback, request);
+ }
+
+ private void ReadCallback(IAsyncResult asynchronousResult)
+ {
+ var request = (HttpWebRequest)asynchronousResult.AsyncState;
+
+ var response = (HttpWebResponse)request.EndGetResponse(asynchronousResult);
+
+ string content;
+ using (var streamReader = new StreamReader(response.GetResponseStream()))
+ {
+ content = streamReader.ReadToEnd();
+ }
+
+ OnResponse((int)response.StatusCode, content);
+ }
+
+ public event EventHandler CanExecuteChanged;
+
+ protected virtual void OnResponse(int statusCode, string response)
+ {
+
+ }
+ }
+}
110 Source/Entile.TestApp/ViewModels/EntileViewModel.cs
View
@@ -0,0 +1,110 @@
+using System;
+using System.Collections.ObjectModel;
+using System.Windows.Input;
+
+namespace Entile.TestApp.ViewModels
+{
+ public class EntileViewModel : ActionableObject
+ {
+ private readonly EntileViewContext _viewContext = new EntileViewContext();
+
+ public EntileViewModel()
+ {
+ _clientId = Guid.NewGuid();
+ ViewContext.SetValue("ClientId", _clientId);
+ _rootApiCommand = new RootApiCommand(this, "http://localhost:4250/api");
+ }
+
+ protected override ICommand BuildCommand(string rel, string uri)
+ {
+ switch (rel)
+ {
+ case "Register":
+ return RegisterClientCommand = new RegisterClientCommand(this, uri);
+ }
+ return null;
+ }
+
+ protected override void RemoveCommand(string rel)
+ {
+ switch (rel)
+ {
+ case "Register":
+ RegisterClientCommand = null;
+ break;
+ }
+ }
+
+ private bool _activated;
+ public bool Activated
+ {
+ get { return _activated; }
+ set
+ {
+ if (_activated != value)
+ {
+ _activated = value;
+ RaisePropertyChanged("Activated");
+ }
+ }
+ }
+
+ private Guid _clientId;
+ public Guid ClientId
+ {
+ get { return _clientId; }
+ }
+
+ private RegisterClientCommand _registerClientCommand;
+ public RegisterClientCommand RegisterClientCommand
+ {
+ get { return _registerClientCommand; }
+ set
+ {
+ if (_registerClientCommand != value)
+ {
+ _registerClientCommand = value;
+ RaisePropertyChanged("RegisterClientCommand");
+ }
+ }
+ }
+
+ private RootApiCommand _rootApiCommand;
+ public RootApiCommand RootApiCommand
+ {
+ get { return _rootApiCommand; }
+ set
+ {
+ if (_rootApiCommand!= value)
+ {
+ _rootApiCommand = value;
+ RaisePropertyChanged("RootApiCommand");
+ }
+ }
+ }
+
+ private ObservableCollection<SubscriptionViewModel> _subscriptions = new ObservableCollection<SubscriptionViewModel>();
+ public ObservableCollection<SubscriptionViewModel> Subscriptions
+ {
+ get { return _subscriptions; }
+ set
+ {
+ if (value == null)
+ throw new ArgumentNullException("value");
+
+ _subscriptions.Clear();
+ foreach (var sub in value)
+ {
+ _subscriptions.Add(sub);
+ }
+
+ // RaisePropertyChanged("Subscriptions");
+ }
+ }
+
+ public EntileViewContext ViewContext
+ {
+ get { return _viewContext; }
+ }
+ }
+}
42 Source/Entile.TestApp/ViewModels/IViewContext.cs
View
@@ -0,0 +1,42 @@
+using System.Collections.Generic;
+
+namespace Entile.TestApp.ViewModels
+{
+ public interface IViewContext
+ {
+ object GetValue(string key);
+ }
+
+ public class EntileViewContext : IViewContext
+ {
+ private readonly IViewContext _parentContext;
+
+ public EntileViewContext()
+ {
+ }
+
+ public EntileViewContext(IViewContext parentContext)
+ {
+ _parentContext = parentContext;
+ }
+
+ private Dictionary<string, object> _lookup = new Dictionary<string, object>();
+
+ public object GetValue(string key)
+ {
+ object val;
+ if (_lookup.TryGetValue(key, out val))
+ return val;
+ if (_parentContext != null)
+ return _parentContext.GetValue(key);
+
+ return null;
+ }
+
+ public void SetValue(string key, object value)
+ {
+ _lookup[key] = value;
+ }
+ }
+
+}
15 Source/Entile.TestApp/ViewModels/RegisterClientCommand.cs
View
@@ -0,0 +1,15 @@
+namespace Entile.TestApp.ViewModels
+{
+ public class RegisterClientCommand : ApiCommandBase
+ {
+ public RegisterClientCommand(EntileViewModel viewModel, string uri) :
+ base(viewModel.ViewContext, uri)
+ {
+ }
+
+ protected override void OnResponse(int statusCode, string response)
+ {
+
+ }
+ }
+}
35 Source/Entile.TestApp/ViewModels/RootApiCommand.cs
View
@@ -0,0 +1,35 @@
+using System.IO;
+using Newtonsoft.Json;
+
+namespace Entile.TestApp.ViewModels
+{
+ public class RootApiCommand : ApiCommandBase
+ {
+ private readonly EntileViewModel _viewModel;
+
+ public RootApiCommand(EntileViewModel viewModel, string uri)
+ : base(viewModel.ViewContext, uri)
+ {
+ _viewModel = viewModel;
+ }
+
+ protected override void OnResponse(int statusCode, string response)
+ {
+ var jsonSerializer = new JsonSerializer();
+ using (var reader = new JsonTextReader(new StringReader(response)))
+ {
+ // Read to Links
+ while (reader.Read())
+ {
+ if (reader.TokenType == JsonToken.PropertyName && reader.Value.ToString() == "Links")
+ {
+ reader.Read();
+ break;
+ }
+ }
+ var links = jsonSerializer.Deserialize<LinkModel[]>(reader);
+ _viewModel.LoadLinks(links);
+ }
+ }
+ }
+}
84 Source/Entile.TestApp/ViewModels/SubscriptionViewModel.cs
View
@@ -0,0 +1,84 @@
+using System;
+using System.Windows.Input;
+
+namespace Entile.TestApp.ViewModels
+{
+ public enum SubscriptionKind
+ {
+ Toast,
+ Tile,
+ Raw
+ }
+
+ public class SubscriptionViewModel : ActionableObject
+ {
+ private readonly EntileViewContext _viewContext;
+
+ public SubscriptionViewModel(IViewContext clientViewContext, Guid subscriptionId, SubscriptionKind kind, string paramUri)
+ {
+ _viewContext = new EntileViewContext(clientViewContext);
+
+ _subscriptionId = subscriptionId;
+ ViewContext.SetValue("SubscriptionId", _subscriptionId);
+ _kind = kind;
+ _paramUri = paramUri;
+ }
+
+ protected override ICommand BuildCommand(string rel, string uri)
+ {
+ switch(rel)
+ {
+ case "Unsubscribe":
+ return UnsubscribeCommand = new UnsubscribeCommand(this, uri);
+ }
+ return null;
+ }
+
+ protected override void RemoveCommand(string rel)
+ {
+ switch (rel)
+ {
+ case "Unsubscribe":
+ UnsubscribeCommand = null;
+ break;
+ }
+ }
+
+ private Guid _subscriptionId;
+ public Guid SubscriptionId
+ {
+ get { return _subscriptionId; }
+ }
+
+ private SubscriptionKind _kind;
+ public SubscriptionKind Kind
+ {
+ get { return _kind; }
+ }
+
+ private string _paramUri;
+ public string ParamUri
+ {
+ get { return _paramUri; }
+ }
+
+ public EntileViewContext ViewContext
+ {
+ get { return _viewContext; }
+ }
+
+ private ICommand _unsubscribeCommand;
+ public ICommand UnsubscribeCommand
+ {
+ get { return _unsubscribeCommand; }
+ set
+ {
+ if (_unsubscribeCommand != value)
+ {
+ _unsubscribeCommand = value;
+ RaisePropertyChanged("UnsubscribeCommand");
+ }
+ }
+ }
+ }
+}
15 Source/Entile.TestApp/ViewModels/UnsubscribeCommand.cs
View
@@ -0,0 +1,15 @@
+namespace Entile.TestApp.ViewModels
+{
+ public class UnsubscribeCommand : ApiCommandBase
+ {
+ public UnsubscribeCommand(SubscriptionViewModel subscription, string uri)
+ : base(subscription.ViewContext, uri)
+ {
+ }
+
+ protected override void OnResponse(int statusCode, string response)
+ {
+
+ }
+ }
+}
1  Source/Entile.TestApp/packages.config
View
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="AgFx" version="1.1.0.1101" />
+ <package id="Newtonsoft.Json" version="4.0.4" />
<package id="silverlight.unittest.wp7" version="3.0.40609.1000" />
</packages>
BIN  Source/packages/Newtonsoft.Json.4.0.4/Newtonsoft.Json.4.0.4.nupkg
View
Binary file not shown
BIN  Source/packages/Newtonsoft.Json.4.0.4/lib/net20/Newtonsoft.Json.dll
View
Binary file not shown
BIN  Source/packages/Newtonsoft.Json.4.0.4/lib/net20/Newtonsoft.Json.pdb
View
Binary file not shown
7,859 Source/packages/Newtonsoft.Json.4.0.4/lib/net20/Newtonsoft.Json.xml
View
7,859 additions, 0 deletions not shown
BIN  Source/packages/Newtonsoft.Json.4.0.4/lib/net35/Newtonsoft.Json.dll
View
Binary file not shown
BIN  Source/packages/Newtonsoft.Json.4.0.4/lib/net35/Newtonsoft.Json.pdb
View
Binary file not shown
6,982 Source/packages/Newtonsoft.Json.4.0.4/lib/net35/Newtonsoft.Json.xml
View
6,982 additions, 0 deletions not shown
BIN  Source/packages/Newtonsoft.Json.4.0.4/lib/net40/Newtonsoft.Json.dll
View
Binary file not shown
BIN  Source/packages/Newtonsoft.Json.4.0.4/lib/net40/Newtonsoft.Json.pdb
View
Binary file not shown
7,141 Source/packages/Newtonsoft.Json.4.0.4/lib/net40/Newtonsoft.Json.xml
View
7,141 additions, 0 deletions not shown
BIN  Source/packages/Newtonsoft.Json.4.0.4/lib/sl3-wp/Newtonsoft.Json.dll
View
Binary file not shown
BIN  Source/packages/Newtonsoft.Json.4.0.4/lib/sl3-wp/Newtonsoft.Json.pdb
View
Binary file not shown
6,574 Source/packages/Newtonsoft.Json.4.0.4/lib/sl3-wp/Newtonsoft.Json.xml
View
6,574 additions, 0 deletions not shown
BIN  Source/packages/Newtonsoft.Json.4.0.4/lib/sl4/Newtonsoft.Json.dll
View
Binary file not shown
BIN  Source/packages/Newtonsoft.Json.4.0.4/lib/sl4/Newtonsoft.Json.pdb
View
Binary file not shown
6,604 Source/packages/Newtonsoft.Json.4.0.4/lib/sl4/Newtonsoft.Json.xml
View
6,604 additions, 0 deletions not shown
Please sign in to comment.
Something went wrong with that request. Please try again.