mirror of
https://github.com/farcasclaudiu/myfriendsaround.git
synced 2026-06-29 01:01:58 +03:00
push notification helper library
http://windowsteamblog.com/windows_phone/b/wpdev/archive/2011/01/14/windows-push-notification-server-side-helper-library.aspx http://create.msdn.com/en-us/education/catalog/article/pnhelp-wp7
This commit is contained in:
@@ -0,0 +1,69 @@
|
||||
<Application xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone" xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone" xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit" xmlns:toolkitPrimitives="clr-namespace:Microsoft.Phone.Controls.Primitives;assembly=Microsoft.Phone.Controls.Toolkit" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d"
|
||||
x:Class="WindowsPhone.Recipes.Push.Client.App"
|
||||
>
|
||||
|
||||
<!--Application Resources-->
|
||||
<Application.Resources>
|
||||
|
||||
<ItemsPanelTemplate x:Key="ItemsPanelTemplate">
|
||||
<StackPanel Orientation="Horizontal"/>
|
||||
</ItemsPanelTemplate>
|
||||
|
||||
<Style x:Key="PatternListBoxItemStyle" TargetType="ListBoxItem">
|
||||
<Setter Property="Background" Value="Transparent"/>
|
||||
<Setter Property="BorderThickness" Value="0"/>
|
||||
<Setter Property="BorderBrush" Value="Transparent"/>
|
||||
<Setter Property="Padding" Value="2"/>
|
||||
<Setter Property="Margin" Value="2"/>
|
||||
<Setter Property="Width" Value="85"/>
|
||||
<Setter Property="Height" Value="60"/>
|
||||
<Setter Property="HorizontalContentAlignment" Value="Center"/>
|
||||
<Setter Property="VerticalContentAlignment" Value="Center"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="ListBoxItem">
|
||||
<Border x:Name="LayoutRoot" HorizontalAlignment="{TemplateBinding HorizontalAlignment}" VerticalAlignment="{TemplateBinding VerticalAlignment}" Background="Transparent">
|
||||
<VisualStateManager.VisualStateGroups>
|
||||
<VisualStateGroup x:Name="CommonStates">
|
||||
<VisualState x:Name="Normal"/>
|
||||
<VisualState x:Name="MouseOver"/>
|
||||
<VisualState x:Name="Disabled">
|
||||
<Storyboard>
|
||||
<DoubleAnimation Duration="0" To=".5" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="ContentContainer"/>
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
<VisualStateGroup x:Name="SelectionStates">
|
||||
<VisualStateGroup.Transitions>
|
||||
<VisualTransition GeneratedDuration="0:0:0.4" To="Selected"/>
|
||||
</VisualStateGroup.Transitions>
|
||||
<VisualState x:Name="Unselected"/>
|
||||
<VisualState x:Name="Selected">
|
||||
<Storyboard>
|
||||
<ColorAnimation Duration="0" To="#FF1BA1E2" Storyboard.TargetProperty="(Border.Background).(SolidColorBrush.Color)" Storyboard.TargetName="LayoutRoot" d:IsOptimized="True"/>
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
</VisualStateManager.VisualStateGroups>
|
||||
<ContentControl x:Name="ContentContainer"
|
||||
ContentTemplate="{TemplateBinding ContentTemplate}"
|
||||
Content="{TemplateBinding Content}"
|
||||
Foreground="{StaticResource PhoneForegroundBrush}"
|
||||
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
Margin="{TemplateBinding Padding}"
|
||||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"/>
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
</Application.Resources>
|
||||
|
||||
<Application.ApplicationLifetimeObjects>
|
||||
<!--Required object that handles lifetime events for the application-->
|
||||
<shell:PhoneApplicationService
|
||||
Launching="Application_Launching" Closing="Application_Closing"
|
||||
Activated="Application_Activated" Deactivated="Application_Deactivated"/>
|
||||
</Application.ApplicationLifetimeObjects>
|
||||
|
||||
</Application>
|
||||
@@ -0,0 +1,137 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Animation;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
using Microsoft.Phone.Controls;
|
||||
using Microsoft.Phone.Shell;
|
||||
|
||||
namespace WindowsPhone.Recipes.Push.Client
|
||||
{
|
||||
public partial class App : Application
|
||||
{
|
||||
internal const string ServerAddress = "http://localhost:8000";
|
||||
|
||||
/// <summary>
|
||||
/// Provides easy access to the root frame of the Phone Application.
|
||||
/// </summary>
|
||||
/// <returns>The root frame of the Phone Application.</returns>
|
||||
public PhoneApplicationFrame RootFrame { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Constructor for the Application object.
|
||||
/// </summary>
|
||||
public App()
|
||||
{
|
||||
// Global handler for uncaught exceptions.
|
||||
UnhandledException += Application_UnhandledException;
|
||||
|
||||
// Show graphics profiling information while debugging.
|
||||
if (System.Diagnostics.Debugger.IsAttached)
|
||||
{
|
||||
// Display the current frame rate counters.
|
||||
Application.Current.Host.Settings.EnableFrameRateCounter = true;
|
||||
|
||||
// Show the areas of the app that are being redrawn in each frame.
|
||||
//Application.Current.Host.Settings.EnableRedrawRegions = true;
|
||||
|
||||
// Enable non-production analysis visualization mode,
|
||||
// which shows areas of a page that are being GPU accelerated with a colored overlay.
|
||||
//Application.Current.Host.Settings.EnableCacheVisualization = true;
|
||||
}
|
||||
|
||||
// Standard Silverlight initialization
|
||||
InitializeComponent();
|
||||
|
||||
// Phone-specific initialization
|
||||
InitializePhoneApplication();
|
||||
}
|
||||
|
||||
// Code to execute when the application is launching (eg, from Start)
|
||||
// This code will not execute when the application is reactivated
|
||||
private void Application_Launching(object sender, LaunchingEventArgs e)
|
||||
{
|
||||
}
|
||||
|
||||
// Code to execute when the application is activated (brought to foreground)
|
||||
// This code will not execute when the application is first launched
|
||||
private void Application_Activated(object sender, ActivatedEventArgs e)
|
||||
{
|
||||
}
|
||||
|
||||
// Code to execute when the application is deactivated (sent to background)
|
||||
// This code will not execute when the application is closing
|
||||
private void Application_Deactivated(object sender, DeactivatedEventArgs e)
|
||||
{
|
||||
}
|
||||
|
||||
// Code to execute when the application is closing (eg, user hit Back)
|
||||
// This code will not execute when the application is deactivated
|
||||
private void Application_Closing(object sender, ClosingEventArgs e)
|
||||
{
|
||||
}
|
||||
|
||||
// Code to execute if a navigation fails
|
||||
private void RootFrame_NavigationFailed(object sender, NavigationFailedEventArgs e)
|
||||
{
|
||||
if (System.Diagnostics.Debugger.IsAttached)
|
||||
{
|
||||
// A navigation has failed; break into the debugger
|
||||
System.Diagnostics.Debugger.Break();
|
||||
}
|
||||
}
|
||||
|
||||
// Code to execute on Unhandled Exceptions
|
||||
private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e)
|
||||
{
|
||||
if (System.Diagnostics.Debugger.IsAttached)
|
||||
{
|
||||
// An unhandled exception has occurred; break into the debugger
|
||||
System.Diagnostics.Debugger.Break();
|
||||
}
|
||||
}
|
||||
|
||||
#region Phone application initialization
|
||||
|
||||
// Avoid double-initialization
|
||||
private bool phoneApplicationInitialized = false;
|
||||
|
||||
// Do not add any additional code to this method
|
||||
private void InitializePhoneApplication()
|
||||
{
|
||||
if (phoneApplicationInitialized)
|
||||
return;
|
||||
|
||||
// Create the frame but don't set it as RootVisual yet; this allows the splash
|
||||
// screen to remain active until the application is ready to render.
|
||||
RootFrame = new PhoneApplicationFrame();
|
||||
RootFrame.Navigated += CompleteInitializePhoneApplication;
|
||||
|
||||
// Handle navigation failures
|
||||
RootFrame.NavigationFailed += RootFrame_NavigationFailed;
|
||||
|
||||
// Ensure we don't initialize again
|
||||
phoneApplicationInitialized = true;
|
||||
}
|
||||
|
||||
// Do not add any additional code to this method
|
||||
private void CompleteInitializePhoneApplication(object sender, NavigationEventArgs e)
|
||||
{
|
||||
// Set the root visual to allow the application to render
|
||||
if (RootVisual != RootFrame)
|
||||
RootVisual = RootFrame;
|
||||
|
||||
// Remove this handler since it is no longer needed
|
||||
RootFrame.Navigated -= CompleteInitializePhoneApplication;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
BIN
Binary file not shown.
|
After Width: | Height: | Size: 1.8 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 3.4 KiB |
+19
@@ -0,0 +1,19 @@
|
||||
<UserControl x:Class="WindowsPhone.Recipes.Push.Client.Controls.NotificationBox"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
mc:Ignorable="d"
|
||||
FontFamily="{StaticResource PhoneFontFamilyNormal}"
|
||||
FontSize="{StaticResource PhoneFontSizeNormal}"
|
||||
Foreground="{StaticResource PhoneForegroundBrush}"
|
||||
d:DesignHeight="189" d:DesignWidth="480">
|
||||
|
||||
<StackPanel Background="Black">
|
||||
<TextBlock Margin="4" Text="{Binding Title}" />
|
||||
<TextBlock Margin="4" Text="{Binding Message}" TextWrapping="Wrap" />
|
||||
<CheckBox IsChecked="{Binding ShowAgain, Mode=TwoWay}" Content="Show this message again" />
|
||||
<Button Margin="4" HorizontalAlignment="Right" Width="200" Content="OK" Click="buttonOk_Click" />
|
||||
</StackPanel>
|
||||
|
||||
</UserControl>
|
||||
+91
@@ -0,0 +1,91 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Animation;
|
||||
using System.Windows.Shapes;
|
||||
using System.IO.IsolatedStorage;
|
||||
using System.Windows.Controls.Primitives;
|
||||
using Microsoft.Phone.Controls;
|
||||
|
||||
namespace WindowsPhone.Recipes.Push.Client.Controls
|
||||
{
|
||||
public partial class NotificationBox : UserControl
|
||||
{
|
||||
#region Fields
|
||||
|
||||
private readonly IsolatedStorageSettings Settings = IsolatedStorageSettings.ApplicationSettings;
|
||||
private static Popup _popup;
|
||||
|
||||
#endregion
|
||||
|
||||
public string Title { get; set; }
|
||||
public string Message { get; set; }
|
||||
|
||||
public bool ShowAgain
|
||||
{
|
||||
get
|
||||
{
|
||||
bool showAgain;
|
||||
if (!Settings.TryGetValue("NotificationBox.ShowAgain", out showAgain))
|
||||
{
|
||||
showAgain = true;
|
||||
ShowAgain = showAgain;
|
||||
}
|
||||
|
||||
return showAgain;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
Settings["NotificationBox.ShowAgain"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
private NotificationBox()
|
||||
{
|
||||
DataContext = this;
|
||||
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
public static void Show(string title, string message)
|
||||
{
|
||||
if (_popup != null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var root = Application.Current.RootVisual as PhoneApplicationFrame;
|
||||
var notificationBox = new NotificationBox
|
||||
{
|
||||
Title = title,
|
||||
Message = message,
|
||||
Width = root.ActualWidth,
|
||||
MaxHeight = root.ActualHeight,
|
||||
HorizontalAlignment = HorizontalAlignment.Center,
|
||||
VerticalAlignment = VerticalAlignment.Center
|
||||
};
|
||||
|
||||
if (!notificationBox.ShowAgain)
|
||||
return;
|
||||
|
||||
_popup = new Popup
|
||||
{
|
||||
Child = notificationBox,
|
||||
IsOpen = true,
|
||||
};
|
||||
}
|
||||
|
||||
private void buttonOk_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
_popup.IsOpen = false;
|
||||
_popup = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
+61
@@ -0,0 +1,61 @@
|
||||
using System;
|
||||
using System.Net;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Ink;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Animation;
|
||||
using System.Windows.Shapes;
|
||||
using System.Windows.Data;
|
||||
using System.Globalization;
|
||||
|
||||
namespace WindowsPhone.Recipes.Push.Client.Controls
|
||||
{
|
||||
public sealed class BooleanToVisibilityConverter : IValueConverter
|
||||
{
|
||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
var flag = false;
|
||||
if (value is bool)
|
||||
{
|
||||
flag = (bool)value;
|
||||
}
|
||||
else if (value is bool?)
|
||||
{
|
||||
var nullable = (bool?)value;
|
||||
flag = nullable.GetValueOrDefault();
|
||||
}
|
||||
if (parameter != null)
|
||||
{
|
||||
if (bool.Parse((string)parameter))
|
||||
{
|
||||
flag = !flag;
|
||||
}
|
||||
}
|
||||
if (flag)
|
||||
{
|
||||
return Visibility.Visible;
|
||||
}
|
||||
else
|
||||
{
|
||||
return Visibility.Collapsed;
|
||||
}
|
||||
}
|
||||
|
||||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
var back = ((value is Visibility) && (((Visibility)value) == Visibility.Visible));
|
||||
if (parameter != null)
|
||||
{
|
||||
if ((bool)parameter)
|
||||
{
|
||||
back = !back;
|
||||
}
|
||||
}
|
||||
return back;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
+161
@@ -0,0 +1,161 @@
|
||||
<UserControl x:Class="WindowsPhone.Recipes.Push.Client.Controls.ProgressBarWithText"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:localHelpers="clr-namespace:WindowsPhone.Recipes.Push.Client.Controls"
|
||||
xmlns:unsupported="clr-namespace:WindowsPhone.Recipes.Push.Client.Controls"
|
||||
mc:Ignorable="d"
|
||||
FontFamily="{StaticResource PhoneFontFamilyNormal}"
|
||||
FontSize="{StaticResource PhoneFontSizeNormal}"
|
||||
Foreground="{StaticResource PhoneForegroundBrush}"
|
||||
d:DesignHeight="480" d:DesignWidth="480"
|
||||
>
|
||||
<UserControl.Resources>
|
||||
<localHelpers:BooleanToVisibilityConverter x:Key="booleanToVisibilityConverter" />
|
||||
|
||||
<Style x:Key="PerformanceProgressBar" TargetType="ProgressBar">
|
||||
<Setter Property="Foreground" Value="{StaticResource PhoneAccentBrush}"/>
|
||||
<Setter Property="Background" Value="{StaticResource PhoneAccentBrush}"/>
|
||||
<Setter Property="Maximum" Value="100"/>
|
||||
<Setter Property="IsHitTestVisible" Value="False"/>
|
||||
<Setter Property="Padding" Value="{StaticResource PhoneHorizontalMargin}"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="ProgressBar">
|
||||
<unsupported:RelativeAnimatingContentControl HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch">
|
||||
<unsupported:RelativeAnimatingContentControl.Resources>
|
||||
<ExponentialEase EasingMode="EaseOut" Exponent="1" x:Key="ProgressBarEaseOut"/>
|
||||
<ExponentialEase EasingMode="EaseOut" Exponent="1" x:Key="ProgressBarEaseIn"/>
|
||||
</unsupported:RelativeAnimatingContentControl.Resources>
|
||||
<VisualStateManager.VisualStateGroups>
|
||||
<VisualStateGroup x:Name="CommonStates">
|
||||
<VisualState x:Name="Determinate"/>
|
||||
<VisualState x:Name="Indeterminate">
|
||||
<Storyboard RepeatBehavior="Forever" Duration="00:00:04.4">
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="IndeterminateRoot">
|
||||
<DiscreteObjectKeyFrame KeyTime="0">
|
||||
<DiscreteObjectKeyFrame.Value>
|
||||
<Visibility>Visible</Visibility>
|
||||
</DiscreteObjectKeyFrame.Value>
|
||||
</DiscreteObjectKeyFrame>
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="DeterminateRoot">
|
||||
<DiscreteObjectKeyFrame KeyTime="0">
|
||||
<DiscreteObjectKeyFrame.Value>
|
||||
<Visibility>Collapsed</Visibility>
|
||||
</DiscreteObjectKeyFrame.Value>
|
||||
</DiscreteObjectKeyFrame>
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00.0" Storyboard.TargetProperty="X" Storyboard.TargetName="R1TT">
|
||||
<LinearDoubleKeyFrame KeyTime="00:00:00.0" Value="0.1"/>
|
||||
<EasingDoubleKeyFrame KeyTime="00:00:00.5" Value="33.1" EasingFunction="{StaticResource ProgressBarEaseOut}"/>
|
||||
<LinearDoubleKeyFrame KeyTime="00:00:02.0" Value="66.1"/>
|
||||
<EasingDoubleKeyFrame KeyTime="00:00:02.5" Value="100.1" EasingFunction="{StaticResource ProgressBarEaseIn}"/>
|
||||
</DoubleAnimationUsingKeyFrames>
|
||||
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00.2" Storyboard.TargetProperty="X" Storyboard.TargetName="R2TT">
|
||||
<LinearDoubleKeyFrame KeyTime="00:00:00.0" Value="0.1"/>
|
||||
<EasingDoubleKeyFrame KeyTime="00:00:00.5" Value="33.1" EasingFunction="{StaticResource ProgressBarEaseOut}"/>
|
||||
<LinearDoubleKeyFrame KeyTime="00:00:02.0" Value="66.1"/>
|
||||
<EasingDoubleKeyFrame KeyTime="00:00:02.5" Value="100.1" EasingFunction="{StaticResource ProgressBarEaseIn}"/>
|
||||
</DoubleAnimationUsingKeyFrames>
|
||||
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00.4" Storyboard.TargetProperty="X" Storyboard.TargetName="R3TT">
|
||||
<LinearDoubleKeyFrame KeyTime="00:00:00.0" Value="0.1"/>
|
||||
<EasingDoubleKeyFrame KeyTime="00:00:00.5" Value="33.1" EasingFunction="{StaticResource ProgressBarEaseOut}"/>
|
||||
<LinearDoubleKeyFrame KeyTime="00:00:02.0" Value="66.1"/>
|
||||
<EasingDoubleKeyFrame KeyTime="00:00:02.5" Value="100.1" EasingFunction="{StaticResource ProgressBarEaseIn}"/>
|
||||
</DoubleAnimationUsingKeyFrames>
|
||||
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00.6" Storyboard.TargetProperty="X" Storyboard.TargetName="R4TT">
|
||||
<LinearDoubleKeyFrame KeyTime="00:00:00.0" Value="0.1"/>
|
||||
<EasingDoubleKeyFrame KeyTime="00:00:00.5" Value="33.1" EasingFunction="{StaticResource ProgressBarEaseOut}"/>
|
||||
<LinearDoubleKeyFrame KeyTime="00:00:02.0" Value="66.1"/>
|
||||
<EasingDoubleKeyFrame KeyTime="00:00:02.5" Value="100.1" EasingFunction="{StaticResource ProgressBarEaseIn}"/>
|
||||
</DoubleAnimationUsingKeyFrames>
|
||||
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00.8" Storyboard.TargetProperty="X" Storyboard.TargetName="R5TT">
|
||||
<LinearDoubleKeyFrame KeyTime="00:00:00.0" Value="0.1"/>
|
||||
<EasingDoubleKeyFrame KeyTime="00:00:00.5" Value="33.1" EasingFunction="{StaticResource ProgressBarEaseOut}"/>
|
||||
<LinearDoubleKeyFrame KeyTime="00:00:02.0" Value="66.1"/>
|
||||
<EasingDoubleKeyFrame KeyTime="00:00:02.5" Value="100.1" EasingFunction="{StaticResource ProgressBarEaseIn}"/>
|
||||
</DoubleAnimationUsingKeyFrames>
|
||||
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00.0" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="R1">
|
||||
<DiscreteDoubleKeyFrame KeyTime="0" Value="1"/>
|
||||
<DiscreteDoubleKeyFrame KeyTime="00:00:02.5" Value="0"/>
|
||||
</DoubleAnimationUsingKeyFrames>
|
||||
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00.2" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="R2">
|
||||
<DiscreteDoubleKeyFrame KeyTime="0" Value="1"/>
|
||||
<DiscreteDoubleKeyFrame KeyTime="00:00:02.5" Value="0"/>
|
||||
</DoubleAnimationUsingKeyFrames>
|
||||
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00.4" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="R3">
|
||||
<DiscreteDoubleKeyFrame KeyTime="0" Value="1"/>
|
||||
<DiscreteDoubleKeyFrame KeyTime="00:00:02.5" Value="0"/>
|
||||
</DoubleAnimationUsingKeyFrames>
|
||||
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00.6" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="R4">
|
||||
<DiscreteDoubleKeyFrame KeyTime="0" Value="1"/>
|
||||
<DiscreteDoubleKeyFrame KeyTime="00:00:02.5" Value="0"/>
|
||||
</DoubleAnimationUsingKeyFrames>
|
||||
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00.8" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="R5">
|
||||
<DiscreteDoubleKeyFrame KeyTime="0" Value="1"/>
|
||||
<DiscreteDoubleKeyFrame KeyTime="00:00:02.5" Value="0"/>
|
||||
</DoubleAnimationUsingKeyFrames>
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
</VisualStateManager.VisualStateGroups>
|
||||
<Grid>
|
||||
<Grid x:Name="DeterminateRoot" Margin="{TemplateBinding Padding}" Visibility="Visible">
|
||||
<Rectangle x:Name="ProgressBarTrack" Fill="{TemplateBinding Background}" Height="4" Opacity="0.1"/>
|
||||
<Rectangle x:Name="ProgressBarIndicator" Fill="{TemplateBinding Foreground}" HorizontalAlignment="Left" Height="4"/>
|
||||
</Grid>
|
||||
<Border x:Name="IndeterminateRoot" Margin="{TemplateBinding Padding}" Visibility="Collapsed">
|
||||
<Grid HorizontalAlignment="Left">
|
||||
<Rectangle Fill="{TemplateBinding Foreground}" Height="4" IsHitTestVisible="False" Width="4" x:Name="R1" Opacity="0" CacheMode="BitmapCache">
|
||||
<Rectangle.RenderTransform>
|
||||
<TranslateTransform x:Name="R1TT"/>
|
||||
</Rectangle.RenderTransform>
|
||||
</Rectangle>
|
||||
<Rectangle Fill="{TemplateBinding Foreground}" Height="4" IsHitTestVisible="False" Width="4" x:Name="R2" Opacity="0" CacheMode="BitmapCache">
|
||||
<Rectangle.RenderTransform>
|
||||
<TranslateTransform x:Name="R2TT"/>
|
||||
</Rectangle.RenderTransform>
|
||||
</Rectangle>
|
||||
<Rectangle Fill="{TemplateBinding Foreground}" Height="4" IsHitTestVisible="False" Width="4" x:Name="R3" Opacity="0" CacheMode="BitmapCache">
|
||||
<Rectangle.RenderTransform>
|
||||
<TranslateTransform x:Name="R3TT"/>
|
||||
</Rectangle.RenderTransform>
|
||||
</Rectangle>
|
||||
<Rectangle Fill="{TemplateBinding Foreground}" Height="4" IsHitTestVisible="False" Width="4" x:Name="R4" Opacity="0" CacheMode="BitmapCache">
|
||||
<Rectangle.RenderTransform>
|
||||
<TranslateTransform x:Name="R4TT"/>
|
||||
</Rectangle.RenderTransform>
|
||||
</Rectangle>
|
||||
<Rectangle Fill="{TemplateBinding Foreground}" Height="4" IsHitTestVisible="False" Width="4" x:Name="R5" Opacity="0" CacheMode="BitmapCache">
|
||||
<Rectangle.RenderTransform>
|
||||
<TranslateTransform x:Name="R5TT"/>
|
||||
</Rectangle.RenderTransform>
|
||||
</Rectangle>
|
||||
</Grid>
|
||||
</Border>
|
||||
</Grid>
|
||||
</unsupported:RelativeAnimatingContentControl>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
</UserControl.Resources>
|
||||
<StackPanel x:Name="stackPanel"
|
||||
Visibility="{Binding ShowProgress, Converter={StaticResource booleanToVisibilityConverter}}"
|
||||
VerticalAlignment="Center"
|
||||
>
|
||||
<TextBlock
|
||||
Text="{Binding Text}"
|
||||
HorizontalAlignment="Center"
|
||||
/>
|
||||
<ProgressBar
|
||||
Foreground="White"
|
||||
IsIndeterminate="{Binding ShowProgress}"
|
||||
Style="{StaticResource PerformanceProgressBar}"
|
||||
Margin="0,5,0,0"
|
||||
/>
|
||||
</StackPanel>
|
||||
</UserControl>
|
||||
+69
@@ -0,0 +1,69 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Animation;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
namespace WindowsPhone.Recipes.Push.Client.Controls
|
||||
{
|
||||
public partial class ProgressBarWithText : UserControl
|
||||
{
|
||||
public ProgressBarWithText()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
stackPanel.DataContext = this;
|
||||
}
|
||||
|
||||
#region ShowProgress
|
||||
|
||||
/// <summary>
|
||||
/// ShowProgress Dependency Property
|
||||
/// </summary>
|
||||
public static readonly DependencyProperty ShowProgressProperty =
|
||||
DependencyProperty.Register("ShowProgress", typeof(bool), typeof(ProgressBarWithText),
|
||||
new PropertyMetadata((bool)false));
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the ShowProgress property. This dependency property
|
||||
/// indicates whether to show the progress bar.
|
||||
/// </summary>
|
||||
public bool ShowProgress
|
||||
{
|
||||
get { return (bool)GetValue(ShowProgressProperty); }
|
||||
set { SetValue(ShowProgressProperty, value); }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Text
|
||||
|
||||
/// <summary>
|
||||
/// Text Dependency Property
|
||||
/// </summary>
|
||||
public static readonly DependencyProperty TextProperty =
|
||||
DependencyProperty.Register("Text", typeof(string), typeof(ProgressBarWithText),
|
||||
new PropertyMetadata((string)""));
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Text property. This dependency property
|
||||
/// indicates what is the text that appears above the progress bar.
|
||||
/// </summary>
|
||||
public string Text
|
||||
{
|
||||
get { return (string)GetValue(TextProperty); }
|
||||
set { SetValue(TextProperty, value); }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
+625
@@ -0,0 +1,625 @@
|
||||
// (c) Copyright Microsoft Corporation.
|
||||
// This source is subject to the Microsoft Public License (Ms-PL).
|
||||
// Please see http://go.microsoft.com/fwlink/?LinkID=131993 for details.
|
||||
// All other rights reserved.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Animation;
|
||||
|
||||
// This is a very special primitive control that works around a limitation in
|
||||
// the core animation subsystem of Silverlight: there is no way to declare in
|
||||
// VSM states relative properties, such as animating from 0 to 33% the width of
|
||||
// the control, using double animations for translation.
|
||||
//
|
||||
// It's a tough problem to solve property, but this primitive, unsupported
|
||||
// control does offer a solution based on magic numbers that still allows a
|
||||
// designer to make alterations to their animation values to present their
|
||||
// vision for custom templates.
|
||||
//
|
||||
// This is instrumental in offering a Windows Phone ProgressBar implementation
|
||||
// that uses the render thread instead of animating UI thread-only properties.
|
||||
//
|
||||
// For questions, please see
|
||||
// http://www.jeff.wilcox.name/performanceprogressbar/
|
||||
//
|
||||
// This control is licensed Ms-PL and as such comes with no warranties or
|
||||
// official support.
|
||||
//
|
||||
// Style Note
|
||||
// - - -
|
||||
// The style that must be used with this is present at the bottom of this file.
|
||||
//
|
||||
|
||||
namespace WindowsPhone.Recipes.Push.Client.Controls
|
||||
{
|
||||
/// <summary>
|
||||
/// A very specialized primitive control that works around a specific visual
|
||||
/// state manager issue. The platform does not support relative sized
|
||||
/// translation values, and this special control walks through visual state
|
||||
/// animation storyboards looking for magic numbers to use as percentages.
|
||||
/// This control is not supported, unofficial, and is a hack in many ways.
|
||||
/// It is used to enable a Windows Phone native platform-style progress bar
|
||||
/// experience in indeterminate mode that remains performant.
|
||||
/// </summary>
|
||||
public class RelativeAnimatingContentControl : ContentControl
|
||||
{
|
||||
/// <summary>
|
||||
/// A simple Epsilon-style value used for trying to determine the magic
|
||||
/// state, if any, of a double.
|
||||
/// </summary>
|
||||
private const double SimpleDoubleComparisonEpsilon = 0.000009;
|
||||
|
||||
/// <summary>
|
||||
/// The last known width of the control.
|
||||
/// </summary>
|
||||
private double _knownWidth;
|
||||
|
||||
/// <summary>
|
||||
/// The last known height of the control.
|
||||
/// </summary>
|
||||
private double _knownHeight;
|
||||
|
||||
/// <summary>
|
||||
/// A set of custom animation adapters used to update the animation
|
||||
/// storyboards when the size of the control changes.
|
||||
/// </summary>
|
||||
private List<AnimationValueAdapter> _specialAnimations;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the RelativeAnimatingContentControl
|
||||
/// type.
|
||||
/// </summary>
|
||||
public RelativeAnimatingContentControl()
|
||||
{
|
||||
SizeChanged += OnSizeChanged;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Handles the size changed event.
|
||||
/// </summary>
|
||||
/// <param name="sender">The source object.</param>
|
||||
/// <param name="e">The event arguments.</param>
|
||||
private void OnSizeChanged(object sender, SizeChangedEventArgs e)
|
||||
{
|
||||
if (e != null && e.NewSize.Height > 0 && e.NewSize.Width > 0)
|
||||
{
|
||||
_knownWidth = e.NewSize.Width;
|
||||
_knownHeight = e.NewSize.Height;
|
||||
|
||||
Clip = new RectangleGeometry { Rect = new Rect(0, 0, _knownWidth, _knownHeight), };
|
||||
|
||||
UpdateAnyAnimationValues();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Walks through the known storyboards in the control's template that
|
||||
/// may contain magic double animation values, storing them for future
|
||||
/// use and updates.
|
||||
/// </summary>
|
||||
private void UpdateAnyAnimationValues()
|
||||
{
|
||||
if (_knownHeight > 0 && _knownWidth > 0)
|
||||
{
|
||||
// Initially, before any special animations have been found,
|
||||
// the visual state groups of the control must be explored.
|
||||
// By definition they must be at the implementation root of the
|
||||
// control, and this is designed to not walk into any other
|
||||
// depth.
|
||||
if (_specialAnimations == null)
|
||||
{
|
||||
_specialAnimations = new List<AnimationValueAdapter>();
|
||||
|
||||
foreach (VisualStateGroup group in VisualStateManager.GetVisualStateGroups(this))
|
||||
{
|
||||
if (group == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
foreach (VisualState state in group.States)
|
||||
{
|
||||
if (state != null)
|
||||
{
|
||||
Storyboard sb = state.Storyboard;
|
||||
if (sb != null)
|
||||
{
|
||||
// Examine all children of the storyboards,
|
||||
// looking for either type of double
|
||||
// animation.
|
||||
foreach (Timeline timeline in sb.Children)
|
||||
{
|
||||
DoubleAnimation da = timeline as DoubleAnimation;
|
||||
DoubleAnimationUsingKeyFrames dakeys = timeline as DoubleAnimationUsingKeyFrames;
|
||||
if (da != null)
|
||||
{
|
||||
ProcessDoubleAnimation(da);
|
||||
}
|
||||
else if (dakeys != null)
|
||||
{
|
||||
ProcessDoubleAnimationWithKeys(dakeys);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Update special animation values relative to the current size.
|
||||
UpdateKnownAnimations();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Walks through all special animations, updating based on the current
|
||||
/// size of the control.
|
||||
/// </summary>
|
||||
private void UpdateKnownAnimations()
|
||||
{
|
||||
foreach (AnimationValueAdapter adapter in _specialAnimations)
|
||||
{
|
||||
adapter.UpdateWithNewDimension(_knownWidth, _knownHeight);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Processes a double animation with keyframes, looking for known
|
||||
/// special values to store with an adapter.
|
||||
/// </summary>
|
||||
/// <param name="da">The double animation using key frames instance.</param>
|
||||
private void ProcessDoubleAnimationWithKeys(DoubleAnimationUsingKeyFrames da)
|
||||
{
|
||||
// Look through all keyframes in the instance.
|
||||
foreach (DoubleKeyFrame frame in da.KeyFrames)
|
||||
{
|
||||
var d = DoubleAnimationFrameAdapter.GetDimensionFromMagicNumber(frame.Value);
|
||||
if (d.HasValue)
|
||||
{
|
||||
_specialAnimations.Add(new DoubleAnimationFrameAdapter(d.Value, frame));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Processes a double animation looking for special values.
|
||||
/// </summary>
|
||||
/// <param name="da">The double animation instance.</param>
|
||||
private void ProcessDoubleAnimation(DoubleAnimation da)
|
||||
{
|
||||
// Look for a special value in the To property.
|
||||
if (da.To.HasValue)
|
||||
{
|
||||
var d = DoubleAnimationToAdapter.GetDimensionFromMagicNumber(da.To.Value);
|
||||
if (d.HasValue)
|
||||
{
|
||||
_specialAnimations.Add(new DoubleAnimationToAdapter(d.Value, da));
|
||||
}
|
||||
}
|
||||
|
||||
// Look for a special value in the From property.
|
||||
if (da.From.HasValue)
|
||||
{
|
||||
var d = DoubleAnimationFromAdapter.GetDimensionFromMagicNumber(da.To.Value);
|
||||
if (d.HasValue)
|
||||
{
|
||||
_specialAnimations.Add(new DoubleAnimationFromAdapter(d.Value, da));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#region Private animation updating system
|
||||
/// <summary>
|
||||
/// A selection of dimensions of interest for updating an animation.
|
||||
/// </summary>
|
||||
private enum DoubleAnimationDimension
|
||||
{
|
||||
/// <summary>
|
||||
/// The width (horizontal) dimension.
|
||||
/// </summary>
|
||||
Width,
|
||||
|
||||
/// <summary>
|
||||
/// The height (vertical) dimension.
|
||||
/// </summary>
|
||||
Height,
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A simple class designed to store information about a specific
|
||||
/// animation instance and its properties. Able to update the values at
|
||||
/// runtime.
|
||||
/// </summary>
|
||||
private abstract class AnimationValueAdapter
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the original double value.
|
||||
/// </summary>
|
||||
protected double OriginalValue { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the AnimationValueAdapter type.
|
||||
/// </summary>
|
||||
/// <param name="dimension">The dimension of interest for updates.</param>
|
||||
public AnimationValueAdapter(DoubleAnimationDimension dimension)
|
||||
{
|
||||
Dimension = dimension;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the dimension of interest for the control.
|
||||
/// </summary>
|
||||
public DoubleAnimationDimension Dimension { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Updates the original instance based on new dimension information
|
||||
/// from the control. Takes both and allows the subclass to make the
|
||||
/// decision on which ratio, values, and dimension to use.
|
||||
/// </summary>
|
||||
/// <param name="width">The width of the control.</param>
|
||||
/// <param name="height">The height of the control.</param>
|
||||
public abstract void UpdateWithNewDimension(double width, double height);
|
||||
}
|
||||
|
||||
private abstract class GeneralAnimationValueAdapter<T> : AnimationValueAdapter
|
||||
{
|
||||
/// <summary>
|
||||
/// Stores the animation instance.
|
||||
/// </summary>
|
||||
protected T Instance { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the value of the underlying property of interest.
|
||||
/// </summary>
|
||||
/// <returns>Returns the value of the property.</returns>
|
||||
protected abstract double GetValue();
|
||||
|
||||
/// <summary>
|
||||
/// Sets the value for the underlying property of interest.
|
||||
/// </summary>
|
||||
/// <param name="newValue">The new value for the property.</param>
|
||||
protected abstract void SetValue(double newValue);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the initial value (minus the magic number portion) that the
|
||||
/// designer stored within the visual state animation property.
|
||||
/// </summary>
|
||||
protected double InitialValue { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// The ratio based on the original magic value, used for computing
|
||||
/// the updated animation property of interest when the size of the
|
||||
/// control changes.
|
||||
/// </summary>
|
||||
private double _ratio;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the GeneralAnimationValueAdapter
|
||||
/// type.
|
||||
/// </summary>
|
||||
/// <param name="d">The dimension of interest.</param>
|
||||
/// <param name="instance">The animation type instance.</param>
|
||||
public GeneralAnimationValueAdapter(DoubleAnimationDimension d, T instance)
|
||||
: base(d)
|
||||
{
|
||||
Instance = instance;
|
||||
|
||||
InitialValue = StripMagicNumberOff(GetValue());
|
||||
_ratio = InitialValue / 100;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Approximately removes the magic number state from a value.
|
||||
/// </summary>
|
||||
/// <param name="number">The initial number.</param>
|
||||
/// <returns>Returns a double with an adjustment for the magic
|
||||
/// portion of the number.</returns>
|
||||
public double StripMagicNumberOff(double number)
|
||||
{
|
||||
return Dimension == DoubleAnimationDimension.Width ? number - .1 : number - .2;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Retrieves the dimension, if any, from the number. If the number
|
||||
/// is not magic, null is returned instead.
|
||||
/// </summary>
|
||||
/// <param name="number">The double value.</param>
|
||||
/// <returns>Returs a double animation dimension, if the number was
|
||||
/// partially magic; otherwise, returns null.</returns>
|
||||
public static DoubleAnimationDimension? GetDimensionFromMagicNumber(double number)
|
||||
{
|
||||
double floor = Math.Floor(number);
|
||||
double remainder = number - floor;
|
||||
|
||||
if (remainder >= .1 - SimpleDoubleComparisonEpsilon && remainder <= .1 + SimpleDoubleComparisonEpsilon)
|
||||
{
|
||||
return DoubleAnimationDimension.Width;
|
||||
}
|
||||
if (remainder >= .2 - SimpleDoubleComparisonEpsilon && remainder <= .2 + SimpleDoubleComparisonEpsilon)
|
||||
{
|
||||
return DoubleAnimationDimension.Height;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Updates the animation instance based on the dimensions of the
|
||||
/// control.
|
||||
/// </summary>
|
||||
/// <param name="width">The width of the control.</param>
|
||||
/// <param name="height">The height of the control.</param>
|
||||
public override void UpdateWithNewDimension(double width, double height)
|
||||
{
|
||||
double size = Dimension == DoubleAnimationDimension.Width ? width : height;
|
||||
UpdateValue(size);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Updates the value of the property.
|
||||
/// </summary>
|
||||
/// <param name="sizeToUse">The size of interest to use with a ratio
|
||||
/// computation.</param>
|
||||
private void UpdateValue(double sizeToUse)
|
||||
{
|
||||
SetValue(sizeToUse * _ratio);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adapter for DoubleAnimation's To property.
|
||||
/// </summary>
|
||||
private class DoubleAnimationToAdapter : GeneralAnimationValueAdapter<DoubleAnimation>
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the value of the underlying property of interest.
|
||||
/// </summary>
|
||||
/// <returns>Returns the value of the property.</returns>
|
||||
protected override double GetValue()
|
||||
{
|
||||
return (double)Instance.To;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets the value for the underlying property of interest.
|
||||
/// </summary>
|
||||
/// <param name="newValue">The new value for the property.</param>
|
||||
protected override void SetValue(double newValue)
|
||||
{
|
||||
Instance.To = newValue;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the DoubleAnimationToAdapter type.
|
||||
/// </summary>
|
||||
/// <param name="dimension">The dimension of interest.</param>
|
||||
/// <param name="instance">The instance of the animation type.</param>
|
||||
public DoubleAnimationToAdapter(DoubleAnimationDimension dimension, DoubleAnimation instance)
|
||||
: base(dimension, instance)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adapter for DoubleAnimation's From property.
|
||||
/// </summary>
|
||||
private class DoubleAnimationFromAdapter : GeneralAnimationValueAdapter<DoubleAnimation>
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the value of the underlying property of interest.
|
||||
/// </summary>
|
||||
/// <returns>Returns the value of the property.</returns>
|
||||
protected override double GetValue()
|
||||
{
|
||||
return (double)Instance.From;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets the value for the underlying property of interest.
|
||||
/// </summary>
|
||||
/// <param name="newValue">The new value for the property.</param>
|
||||
protected override void SetValue(double newValue)
|
||||
{
|
||||
Instance.From = newValue;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the DoubleAnimationFromAdapter
|
||||
/// type.
|
||||
/// </summary>
|
||||
/// <param name="dimension">The dimension of interest.</param>
|
||||
/// <param name="instance">The instance of the animation type.</param>
|
||||
public DoubleAnimationFromAdapter(DoubleAnimationDimension dimension, DoubleAnimation instance)
|
||||
: base(dimension, instance)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adapter for double key frames.
|
||||
/// </summary>
|
||||
private class DoubleAnimationFrameAdapter : GeneralAnimationValueAdapter<DoubleKeyFrame>
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the value of the underlying property of interest.
|
||||
/// </summary>
|
||||
/// <returns>Returns the value of the property.</returns>
|
||||
protected override double GetValue()
|
||||
{
|
||||
return Instance.Value;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets the value for the underlying property of interest.
|
||||
/// </summary>
|
||||
/// <param name="newValue">The new value for the property.</param>
|
||||
protected override void SetValue(double newValue)
|
||||
{
|
||||
Instance.Value = newValue;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the DoubleAnimationFrameAdapter
|
||||
/// type.
|
||||
/// </summary>
|
||||
/// <param name="dimension">The dimension of interest.</param>
|
||||
/// <param name="instance">The instance of the animation type.</param>
|
||||
public DoubleAnimationFrameAdapter(DoubleAnimationDimension dimension, DoubleKeyFrame frame)
|
||||
: base(dimension, frame)
|
||||
{
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
||||
/*
|
||||
This is the style that should be used with the control. Make sure to define
|
||||
the XMLNS at the top of the style file similar to this:
|
||||
xmlns:unsupported="clr-namespace:WindowsPhone.Recipes.Push.Client.Controls"
|
||||
|
||||
<!--
|
||||
// Performance Progress Bar
|
||||
// - - -
|
||||
// To use this progress bar at runtime, make sure to set the Style
|
||||
// value to this key. Since the control visually is identical to control
|
||||
// in the Windows Phone runtime, you will not be able to visually tell
|
||||
// the difference: except this style will not use the UI thread at
|
||||
// runtime when IsIndeterminate=true.
|
||||
//
|
||||
// <ProgressBar Style="{StaticResource PerformanceProgressBar}"
|
||||
// IsIndeterminate="true"/>
|
||||
//
|
||||
-->
|
||||
<Style x:Key="PerformanceProgressBar" TargetType="ProgressBar">
|
||||
<Setter Property="Foreground" Value="{StaticResource PhoneAccentBrush}"/>
|
||||
<Setter Property="Background" Value="{StaticResource PhoneAccentBrush}"/>
|
||||
<Setter Property="Maximum" Value="100"/>
|
||||
<Setter Property="IsHitTestVisible" Value="False"/>
|
||||
<Setter Property="Padding" Value="{StaticResource PhoneHorizontalMargin}"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="ProgressBar">
|
||||
<unsupported:RelativeAnimatingContentControl HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch">
|
||||
<unsupported:RelativeAnimatingContentControl.Resources>
|
||||
<ExponentialEase EasingMode="EaseOut" Exponent="1" x:Key="ProgressBarEaseOut"/>
|
||||
<ExponentialEase EasingMode="EaseOut" Exponent="1" x:Key="ProgressBarEaseIn"/>
|
||||
</unsupported:RelativeAnimatingContentControl.Resources>
|
||||
<VisualStateManager.VisualStateGroups>
|
||||
<VisualStateGroup x:Name="CommonStates">
|
||||
<VisualState x:Name="Determinate"/>
|
||||
<VisualState x:Name="Indeterminate">
|
||||
<Storyboard RepeatBehavior="Forever" Duration="00:00:04.4">
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="IndeterminateRoot">
|
||||
<DiscreteObjectKeyFrame KeyTime="0">
|
||||
<DiscreteObjectKeyFrame.Value>
|
||||
<Visibility>Visible</Visibility>
|
||||
</DiscreteObjectKeyFrame.Value>
|
||||
</DiscreteObjectKeyFrame>
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="DeterminateRoot">
|
||||
<DiscreteObjectKeyFrame KeyTime="0">
|
||||
<DiscreteObjectKeyFrame.Value>
|
||||
<Visibility>Collapsed</Visibility>
|
||||
</DiscreteObjectKeyFrame.Value>
|
||||
</DiscreteObjectKeyFrame>
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00.0" Storyboard.TargetProperty="X" Storyboard.TargetName="R1TT">
|
||||
<LinearDoubleKeyFrame KeyTime="00:00:00.0" Value="0.1"/>
|
||||
<EasingDoubleKeyFrame KeyTime="00:00:00.5" Value="33.1" EasingFunction="{StaticResource ProgressBarEaseOut}"/>
|
||||
<LinearDoubleKeyFrame KeyTime="00:00:02.0" Value="66.1"/>
|
||||
<EasingDoubleKeyFrame KeyTime="00:00:02.5" Value="100.1" EasingFunction="{StaticResource ProgressBarEaseIn}"/>
|
||||
</DoubleAnimationUsingKeyFrames>
|
||||
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00.2" Storyboard.TargetProperty="X" Storyboard.TargetName="R2TT">
|
||||
<LinearDoubleKeyFrame KeyTime="00:00:00.0" Value="0.1"/>
|
||||
<EasingDoubleKeyFrame KeyTime="00:00:00.5" Value="33.1" EasingFunction="{StaticResource ProgressBarEaseOut}"/>
|
||||
<LinearDoubleKeyFrame KeyTime="00:00:02.0" Value="66.1"/>
|
||||
<EasingDoubleKeyFrame KeyTime="00:00:02.5" Value="100.1" EasingFunction="{StaticResource ProgressBarEaseIn}"/>
|
||||
</DoubleAnimationUsingKeyFrames>
|
||||
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00.4" Storyboard.TargetProperty="X" Storyboard.TargetName="R3TT">
|
||||
<LinearDoubleKeyFrame KeyTime="00:00:00.0" Value="0.1"/>
|
||||
<EasingDoubleKeyFrame KeyTime="00:00:00.5" Value="33.1" EasingFunction="{StaticResource ProgressBarEaseOut}"/>
|
||||
<LinearDoubleKeyFrame KeyTime="00:00:02.0" Value="66.1"/>
|
||||
<EasingDoubleKeyFrame KeyTime="00:00:02.5" Value="100.1" EasingFunction="{StaticResource ProgressBarEaseIn}"/>
|
||||
</DoubleAnimationUsingKeyFrames>
|
||||
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00.6" Storyboard.TargetProperty="X" Storyboard.TargetName="R4TT">
|
||||
<LinearDoubleKeyFrame KeyTime="00:00:00.0" Value="0.1"/>
|
||||
<EasingDoubleKeyFrame KeyTime="00:00:00.5" Value="33.1" EasingFunction="{StaticResource ProgressBarEaseOut}"/>
|
||||
<LinearDoubleKeyFrame KeyTime="00:00:02.0" Value="66.1"/>
|
||||
<EasingDoubleKeyFrame KeyTime="00:00:02.5" Value="100.1" EasingFunction="{StaticResource ProgressBarEaseIn}"/>
|
||||
</DoubleAnimationUsingKeyFrames>
|
||||
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00.8" Storyboard.TargetProperty="X" Storyboard.TargetName="R5TT">
|
||||
<LinearDoubleKeyFrame KeyTime="00:00:00.0" Value="0.1"/>
|
||||
<EasingDoubleKeyFrame KeyTime="00:00:00.5" Value="33.1" EasingFunction="{StaticResource ProgressBarEaseOut}"/>
|
||||
<LinearDoubleKeyFrame KeyTime="00:00:02.0" Value="66.1"/>
|
||||
<EasingDoubleKeyFrame KeyTime="00:00:02.5" Value="100.1" EasingFunction="{StaticResource ProgressBarEaseIn}"/>
|
||||
</DoubleAnimationUsingKeyFrames>
|
||||
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00.0" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="R1">
|
||||
<DiscreteDoubleKeyFrame KeyTime="0" Value="1"/>
|
||||
<DiscreteDoubleKeyFrame KeyTime="00:00:02.5" Value="0"/>
|
||||
</DoubleAnimationUsingKeyFrames>
|
||||
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00.2" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="R2">
|
||||
<DiscreteDoubleKeyFrame KeyTime="0" Value="1"/>
|
||||
<DiscreteDoubleKeyFrame KeyTime="00:00:02.5" Value="0"/>
|
||||
</DoubleAnimationUsingKeyFrames>
|
||||
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00.4" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="R3">
|
||||
<DiscreteDoubleKeyFrame KeyTime="0" Value="1"/>
|
||||
<DiscreteDoubleKeyFrame KeyTime="00:00:02.5" Value="0"/>
|
||||
</DoubleAnimationUsingKeyFrames>
|
||||
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00.6" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="R4">
|
||||
<DiscreteDoubleKeyFrame KeyTime="0" Value="1"/>
|
||||
<DiscreteDoubleKeyFrame KeyTime="00:00:02.5" Value="0"/>
|
||||
</DoubleAnimationUsingKeyFrames>
|
||||
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00.8" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="R5">
|
||||
<DiscreteDoubleKeyFrame KeyTime="0" Value="1"/>
|
||||
<DiscreteDoubleKeyFrame KeyTime="00:00:02.5" Value="0"/>
|
||||
</DoubleAnimationUsingKeyFrames>
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
</VisualStateManager.VisualStateGroups>
|
||||
<Grid>
|
||||
<Grid x:Name="DeterminateRoot" Margin="{TemplateBinding Padding}" Visibility="Visible">
|
||||
<Rectangle x:Name="ProgressBarTrack" Fill="{TemplateBinding Background}" Height="4" Opacity="0.1"/>
|
||||
<Rectangle x:Name="ProgressBarIndicator" Fill="{TemplateBinding Foreground}" HorizontalAlignment="Left" Height="4"/>
|
||||
</Grid>
|
||||
<Border x:Name="IndeterminateRoot" Margin="{TemplateBinding Padding}" Visibility="Collapsed">
|
||||
<Grid HorizontalAlignment="Left">
|
||||
<Rectangle Fill="{TemplateBinding Foreground}" Height="4" IsHitTestVisible="False" Width="4" x:Name="R1" Opacity="0" CacheMode="BitmapCache">
|
||||
<Rectangle.RenderTransform>
|
||||
<TranslateTransform x:Name="R1TT"/>
|
||||
</Rectangle.RenderTransform>
|
||||
</Rectangle>
|
||||
<Rectangle Fill="{TemplateBinding Foreground}" Height="4" IsHitTestVisible="False" Width="4" x:Name="R2" Opacity="0" CacheMode="BitmapCache">
|
||||
<Rectangle.RenderTransform>
|
||||
<TranslateTransform x:Name="R2TT"/>
|
||||
</Rectangle.RenderTransform>
|
||||
</Rectangle>
|
||||
<Rectangle Fill="{TemplateBinding Foreground}" Height="4" IsHitTestVisible="False" Width="4" x:Name="R3" Opacity="0" CacheMode="BitmapCache">
|
||||
<Rectangle.RenderTransform>
|
||||
<TranslateTransform x:Name="R3TT"/>
|
||||
</Rectangle.RenderTransform>
|
||||
</Rectangle>
|
||||
<Rectangle Fill="{TemplateBinding Foreground}" Height="4" IsHitTestVisible="False" Width="4" x:Name="R4" Opacity="0" CacheMode="BitmapCache">
|
||||
<Rectangle.RenderTransform>
|
||||
<TranslateTransform x:Name="R4TT"/>
|
||||
</Rectangle.RenderTransform>
|
||||
</Rectangle>
|
||||
<Rectangle Fill="{TemplateBinding Foreground}" Height="4" IsHitTestVisible="False" Width="4" x:Name="R5" Opacity="0" CacheMode="BitmapCache">
|
||||
<Rectangle.RenderTransform>
|
||||
<TranslateTransform x:Name="R5TT"/>
|
||||
</Rectangle.RenderTransform>
|
||||
</Rectangle>
|
||||
</Grid>
|
||||
</Border>
|
||||
</Grid>
|
||||
</unsupported:RelativeAnimatingContentControl>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
*/
|
||||
}
|
||||
+59
@@ -0,0 +1,59 @@
|
||||
<UserControl x:Class="WindowsPhone.Recipes.Push.Client.Controls.PushSettingsControl"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:tk="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
|
||||
xmlns:converters="clr-namespace:WindowsPhone.Recipes.Push.Client.Converters"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
mc:Ignorable="d"
|
||||
FontFamily="{StaticResource PhoneFontFamilyNormal}"
|
||||
FontSize="{StaticResource PhoneFontSizeNormal}"
|
||||
Foreground="{StaticResource PhoneForegroundBrush}"
|
||||
d:DesignHeight="640" d:DesignWidth="480">
|
||||
|
||||
<UserControl.Resources>
|
||||
|
||||
<converters:BoolBrushConverter x:Key="BoolBrushConverter" />
|
||||
|
||||
<Style x:Key="DescTextStyle" TargetType="TextBlock">
|
||||
<Setter Property="FontSize" Value="14" />
|
||||
<Setter Property="Foreground" Value="Silver" />
|
||||
<Setter Property="TextWrapping" Value="Wrap" />
|
||||
<Setter Property="Margin" Value="16,-38,16,24" />
|
||||
</Style>
|
||||
</UserControl.Resources>
|
||||
|
||||
<Grid x:Name="LayoutRoot" Background="{StaticResource PhoneChromeBrush}">
|
||||
|
||||
<StackPanel>
|
||||
<StackPanel>
|
||||
<tk:ToggleSwitch Header="Push Notifications"
|
||||
IsChecked="{Binding IsPushEnabled, Mode=TwoWay}" />
|
||||
<TextBlock Style="{StaticResource DescTextStyle}"
|
||||
Text="Turn on/off push notifications." />
|
||||
</StackPanel>
|
||||
|
||||
<Grid>
|
||||
<StackPanel Margin="16,0,0,0">
|
||||
<tk:ToggleSwitch Header="Tile Notifications"
|
||||
IsChecked="{Binding IsTileEnabled, Mode=TwoWay}" />
|
||||
<TextBlock Style="{StaticResource DescTextStyle}"
|
||||
Text="Tile push notifications update the application's tile displayed in the Start Screen. The application must be pinned by the user first." />
|
||||
|
||||
<tk:ToggleSwitch Header="Toast Notifications"
|
||||
IsChecked="{Binding IsToastEnabled, Mode=TwoWay}" />
|
||||
<TextBlock Style="{StaticResource DescTextStyle}"
|
||||
Text="Toast push notifications are system-wide notifications that do not disrupt the user workflow or require intervention to resolve and are displayed in the top of the screen for ten seconds." />
|
||||
|
||||
<tk:ToggleSwitch Header="Raw Notifications"
|
||||
IsChecked="{Binding IsRawEnabled, Mode=TwoWay}" />
|
||||
<TextBlock Style="{StaticResource DescTextStyle}"
|
||||
Text="Raw push notifications are used to send application specific information. The application must be running first." />
|
||||
</StackPanel>
|
||||
|
||||
<Border Background="{Binding IsPushEnabled, Converter={StaticResource BoolBrushConverter}}" />
|
||||
</Grid>
|
||||
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Animation;
|
||||
using System.Windows.Shapes;
|
||||
using System.IO.IsolatedStorage;
|
||||
using System.Xml.Linq;
|
||||
|
||||
namespace WindowsPhone.Recipes.Push.Client.Controls
|
||||
{
|
||||
public partial class PushSettingsControl : UserControl
|
||||
{
|
||||
public PushSettingsControl()
|
||||
{
|
||||
DataContext = PushContext.Current;
|
||||
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
+43
@@ -0,0 +1,43 @@
|
||||
using System;
|
||||
using System.Net;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Ink;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Animation;
|
||||
using System.Windows.Shapes;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace WindowsPhone.Recipes.Push.Client.Controls
|
||||
{
|
||||
public class ViewTransitions<T>
|
||||
{
|
||||
private class ViewTransition
|
||||
{
|
||||
public T To { get; set; }
|
||||
public Action Action { get; set; }
|
||||
}
|
||||
|
||||
public T _viewState;
|
||||
private readonly Dictionary<T, ViewTransition> _transitions = new Dictionary<T, ViewTransition>();
|
||||
|
||||
public ViewTransitions(T initialState)
|
||||
{
|
||||
_viewState = initialState;
|
||||
}
|
||||
|
||||
public void AddTransition(T from, T to, Action action)
|
||||
{
|
||||
_transitions[from] = new ViewTransition { To = to, Action = action };
|
||||
}
|
||||
|
||||
public void Transition()
|
||||
{
|
||||
var transition = _transitions[_viewState];
|
||||
_viewState = transition.To;
|
||||
transition.Action();
|
||||
}
|
||||
}
|
||||
}
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
using System;
|
||||
using System.Net;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Ink;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Animation;
|
||||
using System.Windows.Shapes;
|
||||
using System.Windows.Data;
|
||||
|
||||
namespace WindowsPhone.Recipes.Push.Client.Converters
|
||||
{
|
||||
public class BoolBrushConverter : IValueConverter
|
||||
{
|
||||
private static readonly Brush DisabledBrush = new SolidColorBrush
|
||||
{
|
||||
Color = Colors.Black,
|
||||
Opacity = 0.4
|
||||
};
|
||||
|
||||
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
|
||||
{
|
||||
return object.Equals(value, true) ? null : DisabledBrush;
|
||||
}
|
||||
|
||||
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
|
||||
{
|
||||
throw new NotSupportedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using System.Net;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Ink;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Animation;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
namespace WindowsPhone.Recipes.Push.Client
|
||||
{
|
||||
public static class ExceptionExtensions
|
||||
{
|
||||
public static void Show(this Exception ex, string title = "Error")
|
||||
{
|
||||
MessageBox.Show(ex.Message, title, MessageBoxButton.OK);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<phone:PhoneApplicationPage x:Class="WindowsPhone.Recipes.Push.Client.MainPage"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
|
||||
xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="768"
|
||||
FontFamily="{StaticResource PhoneFontFamilyNormal}"
|
||||
FontSize="{StaticResource PhoneFontSizeNormal}"
|
||||
Foreground="{StaticResource PhoneForegroundBrush}"
|
||||
SupportedOrientations="Portrait" Orientation="Portrait"
|
||||
shell:SystemTray.IsVisible="True">
|
||||
|
||||
<!--LayoutRoot is the root grid where all page content is placed-->
|
||||
<Grid x:Name="LayoutRoot" Background="Transparent">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!--TitlePanel contains the name of the application and page title-->
|
||||
<StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,28">
|
||||
<TextBlock x:Name="ApplicationTitle" Text="SERVER PUSH PATTERNS" Style="{StaticResource PhoneTextNormalStyle}"/>
|
||||
<TextBlock x:Name="PageTitle" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}"/>
|
||||
</StackPanel>
|
||||
|
||||
<!--ContentPanel - place additional content here-->
|
||||
<Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
|
||||
<Border x:Name="activeView" />
|
||||
<Button Visibility="Collapsed" VerticalAlignment="Bottom" Name="button" Click="button_Click" />
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
||||
</phone:PhoneApplicationPage>
|
||||
@@ -0,0 +1,168 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Animation;
|
||||
using System.Windows.Shapes;
|
||||
using System.IO.IsolatedStorage;
|
||||
using System.Windows.Navigation;
|
||||
|
||||
using Microsoft.Phone.Controls;
|
||||
using WindowsPhone.Recipes.Push.Client.Views;
|
||||
using WindowsPhone.Recipes.Push.Client.Controls;
|
||||
|
||||
namespace WindowsPhone.Recipes.Push.Client
|
||||
{
|
||||
public partial class MainPage : PhoneApplicationPage
|
||||
{
|
||||
#region Fields
|
||||
|
||||
private readonly IsolatedStorageSettings Settings = IsolatedStorageSettings.ApplicationSettings;
|
||||
private const string ChannelName = "OneTimePatternChannel";
|
||||
private const string ServiceName = "WindowsPhone.Recipes.Push.Server.PushService";
|
||||
|
||||
private static readonly Uri[] AllowedDomains =
|
||||
{
|
||||
new Uri(App.ServerAddress)
|
||||
};
|
||||
|
||||
private readonly ViewTransitions<ViewState> _viewTransitions;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Properties
|
||||
|
||||
private UIElement ActiveView
|
||||
{
|
||||
get { return activeView.Child; }
|
||||
set { activeView.Child = value; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Ctor
|
||||
|
||||
public MainPage()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
var viewState = CheckIfFirstTimeLoaded() ? ViewState.FirstInitial : ViewState.Initial;
|
||||
_viewTransitions = new ViewTransitions<ViewState>(viewState);
|
||||
InitializeViewTransitions();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Overrides
|
||||
|
||||
protected override void OnNavigatedTo(NavigationEventArgs e)
|
||||
{
|
||||
var pushContext = new PushContext(ChannelName, ServiceName, AllowedDomains, Dispatcher);
|
||||
|
||||
_viewTransitions.Transition();
|
||||
|
||||
base.OnNavigatedTo(e);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Event Handlers
|
||||
|
||||
private void userLoginView_Login(object sender, LoginEventArgs e)
|
||||
{
|
||||
if (e.Exception != null)
|
||||
{
|
||||
e.Exception.Show("Login");
|
||||
return;
|
||||
}
|
||||
|
||||
var userLoginView = sender as UserLoginView;
|
||||
userLoginView.Login -= userLoginView_Login;
|
||||
|
||||
_viewTransitions.Transition();
|
||||
}
|
||||
|
||||
private void button_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
_viewTransitions.Transition();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Privates
|
||||
|
||||
private bool CheckIfFirstTimeLoaded()
|
||||
{
|
||||
object unused;
|
||||
if (!Settings.TryGetValue("MainPage.Loaded", out unused))
|
||||
{
|
||||
Settings["MainPage.Loaded"] = null;
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private void DisplayUserLoginView()
|
||||
{
|
||||
PageTitle.Text = "registration";
|
||||
button.Visibility = Visibility.Collapsed;
|
||||
var userLoginView = new UserLoginView
|
||||
{
|
||||
UserName = "tomer.shamam"
|
||||
};
|
||||
|
||||
userLoginView.Login += userLoginView_Login;
|
||||
ActiveView = userLoginView;
|
||||
}
|
||||
|
||||
private void DisplayPushSettingsView()
|
||||
{
|
||||
PageTitle.Text = "push settings";
|
||||
button.Content = "OK";
|
||||
button.Visibility = Visibility.Visible;
|
||||
ActiveView = new PushSettingsView();
|
||||
}
|
||||
|
||||
private void DisplayInboxView()
|
||||
{
|
||||
PageTitle.Text = "server status";
|
||||
button.Content = "Settings";
|
||||
button.Visibility = Visibility.Visible;
|
||||
ActiveView = new InboxView();
|
||||
}
|
||||
|
||||
private void InitializeViewTransitions()
|
||||
{
|
||||
_viewTransitions.AddTransition(ViewState.FirstInitial, ViewState.FirstSettings, DisplayPushSettingsView);
|
||||
_viewTransitions.AddTransition(ViewState.Initial, ViewState.Login, DisplayUserLoginView);
|
||||
_viewTransitions.AddTransition(ViewState.FirstSettings, ViewState.Login, DisplayUserLoginView);
|
||||
_viewTransitions.AddTransition(ViewState.Login, ViewState.Inbox, DisplayInboxView);
|
||||
_viewTransitions.AddTransition(ViewState.Settings, ViewState.Inbox, DisplayInboxView);
|
||||
_viewTransitions.AddTransition(ViewState.Inbox, ViewState.Settings, DisplayPushSettingsView);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region ViewState
|
||||
|
||||
[Flags]
|
||||
private enum ViewState
|
||||
{
|
||||
FirstTime = 1,
|
||||
Initial = 2,
|
||||
Settings = 4,
|
||||
Login = 8,
|
||||
Inbox = 16,
|
||||
FirstInitial = FirstTime | Initial,
|
||||
FirstSettings = FirstTime | Settings
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
<Deployment xmlns="http://schemas.microsoft.com/client/2007/deployment"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
>
|
||||
<Deployment.Parts>
|
||||
</Deployment.Parts>
|
||||
</Deployment>
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("WindowsPhone.Recipes.Push.Client")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("Microsoft")]
|
||||
[assembly: AssemblyProduct("WindowsPhone.Recipes.Push.Client")]
|
||||
[assembly: AssemblyCopyright("Copyright © Microsoft 2010")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("499d0817-8efe-4199-b5dc-e397b79dddc0")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Deployment xmlns="http://schemas.microsoft.com/windowsphone/2009/deployment" AppPlatformVersion="7.0">
|
||||
<App xmlns="" ProductID="{e011615c-5d28-4e9c-9b07-0b140647fbfa}" Title="Push Patterns" RuntimeType="Silverlight" Version="1.0.0.0" Genre="apps.normal" Author="Tomer Shamam" Description="Sample description" Publisher="Microsoft">
|
||||
<IconPath IsRelative="true" IsResource="false">ApplicationIcon.png</IconPath>
|
||||
<Capabilities>
|
||||
<Capability Name="ID_CAP_GAMERSERVICES" />
|
||||
<Capability Name="ID_CAP_IDENTITY_DEVICE" />
|
||||
<Capability Name="ID_CAP_IDENTITY_USER" />
|
||||
<Capability Name="ID_CAP_LOCATION" />
|
||||
<Capability Name="ID_CAP_MEDIALIB" />
|
||||
<Capability Name="ID_CAP_MICROPHONE" />
|
||||
<Capability Name="ID_CAP_NETWORKING" />
|
||||
<Capability Name="ID_CAP_PHONEDIALER" />
|
||||
<Capability Name="ID_CAP_PUSH_NOTIFICATION" />
|
||||
<Capability Name="ID_CAP_SENSORS" />
|
||||
<Capability Name="ID_CAP_WEBBROWSERCOMPONENT" />
|
||||
</Capabilities>
|
||||
<Tasks>
|
||||
<DefaultTask Name="_default" NavigationPage="MainPage.xaml" />
|
||||
</Tasks>
|
||||
<Tokens>
|
||||
<PrimaryToken TokenID="WindowsPhone.Recipes.Push.Client" TaskName="_default">
|
||||
<TemplateType5>
|
||||
<BackgroundImageURI IsRelative="true" IsResource="false">Background.png</BackgroundImageURI>
|
||||
<Count>0</Count>
|
||||
<Title>Push Patterns</Title>
|
||||
</TemplateType5>
|
||||
</PrimaryToken>
|
||||
</Tokens>
|
||||
</App>
|
||||
</Deployment>
|
||||
@@ -0,0 +1,360 @@
|
||||
using System;
|
||||
using System.Net;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Ink;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Animation;
|
||||
using System.Windows.Shapes;
|
||||
using Microsoft.Phone.Notification;
|
||||
using System.Windows.Threading;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.IO.IsolatedStorage;
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace WindowsPhone.Recipes.Push.Client
|
||||
{
|
||||
public sealed class PushContext : INotifyPropertyChanged
|
||||
{
|
||||
#region Fields
|
||||
|
||||
private readonly IsolatedStorageSettings Settings = IsolatedStorageSettings.ApplicationSettings;
|
||||
private static PushContext _current;
|
||||
private bool _isConnected;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Properties
|
||||
private Dispatcher Dispatcher { get; set; }
|
||||
|
||||
public string ChannelName { get; private set; }
|
||||
public string ServiceName { get; private set; }
|
||||
public IList<Uri> AllowedDomains { get; private set; }
|
||||
public HttpNotificationChannel NotificationChannel { get; private set; }
|
||||
|
||||
public static PushContext Current
|
||||
{
|
||||
get { return _current; }
|
||||
}
|
||||
|
||||
public bool IsConnected
|
||||
{
|
||||
get { return _isConnected; }
|
||||
set
|
||||
{
|
||||
if (_isConnected != value)
|
||||
{
|
||||
_isConnected = value;
|
||||
NotifyPropertyChanged("IsConnected");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsPushEnabled
|
||||
{
|
||||
get { return GetOrCreate<bool>("PushContext.IsPushEnabled", false); }
|
||||
set
|
||||
{
|
||||
SetOrCreate("PushContext.IsPushEnabled", value);
|
||||
UpdateNotificationBindings();
|
||||
NotifyPropertyChanged("IsPushEnabled");
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsTileEnabled
|
||||
{
|
||||
get { return GetOrCreate<bool>("PushContext.IsTileEnabled", true); }
|
||||
set
|
||||
{
|
||||
SetOrCreate("PushContext.IsTileEnabled", value);
|
||||
UpdateNotificationBindings();
|
||||
NotifyPropertyChanged("IsTileEnabled");
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsToastEnabled
|
||||
{
|
||||
get { return GetOrCreate<bool>("PushContext.IsToastEnabled", true); }
|
||||
set
|
||||
{
|
||||
SetOrCreate("PushContext.IsToastEnabled", value);
|
||||
UpdateNotificationBindings();
|
||||
NotifyPropertyChanged("IsToastEnabled");
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsRawEnabled
|
||||
{
|
||||
get { return GetOrCreate<bool>("PushContext.IsRawEnabled", true); }
|
||||
set
|
||||
{
|
||||
SetOrCreate("PushContext.IsRawEnabled", value);
|
||||
NotifyPropertyChanged("IsRawEnabled");
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Events
|
||||
public event EventHandler<PushContextErrorEventArgs> Error;
|
||||
public event EventHandler<PushContextEventArgs> ChannelPrepared;
|
||||
public event EventHandler<HttpNotificationEventArgs> RawNotification;
|
||||
public event PropertyChangedEventHandler PropertyChanged = delegate { };
|
||||
#endregion
|
||||
|
||||
#region Ctor
|
||||
|
||||
public PushContext(string channelName, string serviceName, IList<Uri> allowedDomains, Dispatcher dispatcher)
|
||||
{
|
||||
if (_current != null)
|
||||
{
|
||||
throw new InvalidOperationException("There should be no more than one push context.");
|
||||
}
|
||||
|
||||
ChannelName = channelName;
|
||||
ServiceName = serviceName;
|
||||
AllowedDomains = allowedDomains;
|
||||
Dispatcher = dispatcher;
|
||||
|
||||
_current = this;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Public Methods
|
||||
public void Connect(Action<HttpNotificationChannel> prepared)
|
||||
{
|
||||
if (IsConnected)
|
||||
{
|
||||
prepared(NotificationChannel);
|
||||
return;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
// First, try to pick up an existing channel.
|
||||
NotificationChannel = HttpNotificationChannel.Find(ChannelName);
|
||||
|
||||
if (NotificationChannel == null)
|
||||
{
|
||||
// Create new channel and subscribe events.
|
||||
CreateChannel(prepared);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Channel exists, no need to create a new one.
|
||||
SubscribeToNotificationEvents();
|
||||
PrepareChannel(prepared);
|
||||
}
|
||||
|
||||
IsConnected = true;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
OnError(ex);
|
||||
}
|
||||
}
|
||||
|
||||
public void Disconnect()
|
||||
{
|
||||
if (!IsConnected)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
if (NotificationChannel != null)
|
||||
{
|
||||
UnbindFromTileNotifications();
|
||||
UnbindFromToastNotifications();
|
||||
NotificationChannel.Close();
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
OnError(ex);
|
||||
}
|
||||
finally
|
||||
{
|
||||
NotificationChannel = null;
|
||||
IsConnected = false;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Privates
|
||||
/// <summary>
|
||||
/// Create channel, subscribe to channel events and open the channel.
|
||||
/// </summary>
|
||||
private void CreateChannel(Action<HttpNotificationChannel> prepared)
|
||||
{
|
||||
// Create a new channel.
|
||||
NotificationChannel = new HttpNotificationChannel(ChannelName, ServiceName);
|
||||
|
||||
// Register to UriUpdated event. This occurs when channel successfully opens.
|
||||
NotificationChannel.ChannelUriUpdated += (s, e) => Dispatcher.BeginInvoke(() => PrepareChannel(prepared));
|
||||
|
||||
SubscribeToNotificationEvents();
|
||||
|
||||
// Trying to Open the channel.
|
||||
NotificationChannel.Open();
|
||||
}
|
||||
|
||||
private void SubscribeToNotificationEvents()
|
||||
{
|
||||
// Register to raw notifications.
|
||||
NotificationChannel.HttpNotificationReceived += (s, e) =>
|
||||
{
|
||||
if (IsPushEnabled & IsRawEnabled)
|
||||
{
|
||||
Dispatcher.BeginInvoke(() => OnRawNotification(e));
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
private void OnRawNotification(HttpNotificationEventArgs e)
|
||||
{
|
||||
if (RawNotification != null)
|
||||
{
|
||||
RawNotification(this, e);
|
||||
}
|
||||
}
|
||||
|
||||
private void PrepareChannel(Action<HttpNotificationChannel> prepared)
|
||||
{
|
||||
try
|
||||
{
|
||||
// OnChannelPrepared(new PushContextEventArgs(NotificationChannel));
|
||||
prepared(NotificationChannel);
|
||||
UpdateNotificationBindings();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
OnError(ex);
|
||||
}
|
||||
}
|
||||
|
||||
private void OnError(Exception exception)
|
||||
{
|
||||
if (Error != null)
|
||||
{
|
||||
Error(this, new PushContextErrorEventArgs(exception));
|
||||
}
|
||||
}
|
||||
|
||||
private void OnChannelPrepared(PushContextEventArgs args)
|
||||
{
|
||||
if (ChannelPrepared != null)
|
||||
{
|
||||
ChannelPrepared(this, args);
|
||||
}
|
||||
}
|
||||
|
||||
private void BindToTileNotifications()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (NotificationChannel != null && !NotificationChannel.IsShellTileBound)
|
||||
{
|
||||
var listOfAllowedDomains = new Collection<Uri>(AllowedDomains);
|
||||
NotificationChannel.BindToShellTile(listOfAllowedDomains);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
OnError(ex);
|
||||
}
|
||||
}
|
||||
|
||||
private void BindToToastNotifications()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (NotificationChannel != null && !NotificationChannel.IsShellToastBound)
|
||||
{
|
||||
NotificationChannel.BindToShellToast();
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
OnError(ex);
|
||||
}
|
||||
}
|
||||
|
||||
private void UnbindFromTileNotifications()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (NotificationChannel.IsShellTileBound)
|
||||
{
|
||||
NotificationChannel.UnbindToShellTile();
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
OnError(ex);
|
||||
}
|
||||
}
|
||||
|
||||
private void UnbindFromToastNotifications()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (NotificationChannel.IsShellToastBound)
|
||||
{
|
||||
NotificationChannel.UnbindToShellToast();
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
OnError(ex);
|
||||
}
|
||||
}
|
||||
|
||||
private void UpdateNotificationBindings()
|
||||
{
|
||||
if (IsPushEnabled && IsTileEnabled)
|
||||
{
|
||||
BindToTileNotifications();
|
||||
}
|
||||
else
|
||||
{
|
||||
UnbindFromTileNotifications();
|
||||
}
|
||||
|
||||
if (IsPushEnabled && IsToastEnabled)
|
||||
{
|
||||
BindToToastNotifications();
|
||||
}
|
||||
else
|
||||
{
|
||||
UnbindFromToastNotifications();
|
||||
}
|
||||
}
|
||||
|
||||
private T GetOrCreate<T>(string key, T defaultValue = default(T))
|
||||
{
|
||||
T value;
|
||||
if (Settings.TryGetValue(key, out value))
|
||||
{
|
||||
return value;
|
||||
}
|
||||
|
||||
return defaultValue;
|
||||
}
|
||||
|
||||
private void SetOrCreate<T>(string key, T value)
|
||||
{
|
||||
Settings[key] = value;
|
||||
}
|
||||
|
||||
private void NotifyPropertyChanged(string propertyName)
|
||||
{
|
||||
PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace WindowsPhone.Recipes.Push.Client
|
||||
{
|
||||
public class PushContextErrorEventArgs : EventArgs
|
||||
{
|
||||
public Exception Exception { get; private set; }
|
||||
|
||||
public PushContextErrorEventArgs(Exception exception)
|
||||
{
|
||||
Exception = exception;
|
||||
}
|
||||
}
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Microsoft.Phone.Notification;
|
||||
|
||||
namespace WindowsPhone.Recipes.Push.Client
|
||||
{
|
||||
public class PushContextEventArgs : EventArgs
|
||||
{
|
||||
public HttpNotificationChannel NotificationChannel { get; private set; }
|
||||
|
||||
internal PushContextEventArgs(HttpNotificationChannel channel)
|
||||
{
|
||||
NotificationChannel = channel;
|
||||
}
|
||||
}
|
||||
}
|
||||
BIN
Binary file not shown.
|
After Width: | Height: | Size: 7.2 KiB |
BIN
Binary file not shown.
|
After Width: | Height: | Size: 45 KiB |
BIN
Binary file not shown.
|
After Width: | Height: | Size: 10 KiB |
+444
@@ -0,0 +1,444 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.1
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
//
|
||||
// This code was auto-generated by Microsoft.Silverlight.Phone.ServiceReference, version 3.7.0.0
|
||||
//
|
||||
namespace WindowsPhone.Recipes.Push.Client.Services {
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
|
||||
[System.Diagnostics.DebuggerStepThroughAttribute()]
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")]
|
||||
[System.Runtime.Serialization.DataContractAttribute(Name="ServerInfo", Namespace="http://schemas.datacontract.org/2004/07/WindowsPhone.Recipes.Push.Server.Models")]
|
||||
public partial class ServerInfo : object, System.ComponentModel.INotifyPropertyChanged {
|
||||
|
||||
private int CounterField;
|
||||
|
||||
private string PushPatternField;
|
||||
|
||||
[System.Runtime.Serialization.DataMemberAttribute()]
|
||||
public int Counter {
|
||||
get {
|
||||
return this.CounterField;
|
||||
}
|
||||
set {
|
||||
if ((this.CounterField.Equals(value) != true)) {
|
||||
this.CounterField = value;
|
||||
this.RaisePropertyChanged("Counter");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[System.Runtime.Serialization.DataMemberAttribute()]
|
||||
public string PushPattern {
|
||||
get {
|
||||
return this.PushPatternField;
|
||||
}
|
||||
set {
|
||||
if ((object.ReferenceEquals(this.PushPatternField, value) != true)) {
|
||||
this.PushPatternField = value;
|
||||
this.RaisePropertyChanged("PushPattern");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
|
||||
|
||||
protected void RaisePropertyChanged(string propertyName) {
|
||||
System.ComponentModel.PropertyChangedEventHandler propertyChanged = this.PropertyChanged;
|
||||
if ((propertyChanged != null)) {
|
||||
propertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
|
||||
[System.ServiceModel.ServiceContractAttribute(ConfigurationName="Services.IPushService")]
|
||||
public interface IPushService {
|
||||
|
||||
[System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://tempuri.org/IPushService/Register", ReplyAction="http://tempuri.org/IPushService/RegisterResponse")]
|
||||
System.IAsyncResult BeginRegister(string userName, System.Uri channelUri, System.AsyncCallback callback, object asyncState);
|
||||
|
||||
void EndRegister(System.IAsyncResult result);
|
||||
|
||||
[System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://tempuri.org/IPushService/GetServerInfo", ReplyAction="http://tempuri.org/IPushService/GetServerInfoResponse")]
|
||||
System.IAsyncResult BeginGetServerInfo(System.AsyncCallback callback, object asyncState);
|
||||
|
||||
WindowsPhone.Recipes.Push.Client.Services.ServerInfo EndGetServerInfo(System.IAsyncResult result);
|
||||
|
||||
[System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://tempuri.org/IPushService/UpdateTile", ReplyAction="http://tempuri.org/IPushService/UpdateTileResponse")]
|
||||
System.IAsyncResult BeginUpdateTile(System.Uri channelUri, string parameter, System.AsyncCallback callback, object asyncState);
|
||||
|
||||
void EndUpdateTile(System.IAsyncResult result);
|
||||
}
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
|
||||
public interface IPushServiceChannel : WindowsPhone.Recipes.Push.Client.Services.IPushService, System.ServiceModel.IClientChannel {
|
||||
}
|
||||
|
||||
[System.Diagnostics.DebuggerStepThroughAttribute()]
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
|
||||
public partial class GetServerInfoCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
|
||||
|
||||
private object[] results;
|
||||
|
||||
public GetServerInfoCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) :
|
||||
base(exception, cancelled, userState) {
|
||||
this.results = results;
|
||||
}
|
||||
|
||||
public WindowsPhone.Recipes.Push.Client.Services.ServerInfo Result {
|
||||
get {
|
||||
base.RaiseExceptionIfNecessary();
|
||||
return ((WindowsPhone.Recipes.Push.Client.Services.ServerInfo)(this.results[0]));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[System.Diagnostics.DebuggerStepThroughAttribute()]
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
|
||||
public partial class PushServiceClient : System.ServiceModel.ClientBase<WindowsPhone.Recipes.Push.Client.Services.IPushService>, WindowsPhone.Recipes.Push.Client.Services.IPushService {
|
||||
|
||||
private BeginOperationDelegate onBeginRegisterDelegate;
|
||||
|
||||
private EndOperationDelegate onEndRegisterDelegate;
|
||||
|
||||
private System.Threading.SendOrPostCallback onRegisterCompletedDelegate;
|
||||
|
||||
private BeginOperationDelegate onBeginGetServerInfoDelegate;
|
||||
|
||||
private EndOperationDelegate onEndGetServerInfoDelegate;
|
||||
|
||||
private System.Threading.SendOrPostCallback onGetServerInfoCompletedDelegate;
|
||||
|
||||
private BeginOperationDelegate onBeginUpdateTileDelegate;
|
||||
|
||||
private EndOperationDelegate onEndUpdateTileDelegate;
|
||||
|
||||
private System.Threading.SendOrPostCallback onUpdateTileCompletedDelegate;
|
||||
|
||||
private BeginOperationDelegate onBeginOpenDelegate;
|
||||
|
||||
private EndOperationDelegate onEndOpenDelegate;
|
||||
|
||||
private System.Threading.SendOrPostCallback onOpenCompletedDelegate;
|
||||
|
||||
private BeginOperationDelegate onBeginCloseDelegate;
|
||||
|
||||
private EndOperationDelegate onEndCloseDelegate;
|
||||
|
||||
private System.Threading.SendOrPostCallback onCloseCompletedDelegate;
|
||||
|
||||
public PushServiceClient() {
|
||||
}
|
||||
|
||||
public PushServiceClient(string endpointConfigurationName) :
|
||||
base(endpointConfigurationName) {
|
||||
}
|
||||
|
||||
public PushServiceClient(string endpointConfigurationName, string remoteAddress) :
|
||||
base(endpointConfigurationName, remoteAddress) {
|
||||
}
|
||||
|
||||
public PushServiceClient(string endpointConfigurationName, System.ServiceModel.EndpointAddress remoteAddress) :
|
||||
base(endpointConfigurationName, remoteAddress) {
|
||||
}
|
||||
|
||||
public PushServiceClient(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) :
|
||||
base(binding, remoteAddress) {
|
||||
}
|
||||
|
||||
public System.Net.CookieContainer CookieContainer {
|
||||
get {
|
||||
System.ServiceModel.Channels.IHttpCookieContainerManager httpCookieContainerManager = this.InnerChannel.GetProperty<System.ServiceModel.Channels.IHttpCookieContainerManager>();
|
||||
if ((httpCookieContainerManager != null)) {
|
||||
return httpCookieContainerManager.CookieContainer;
|
||||
}
|
||||
else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
set {
|
||||
System.ServiceModel.Channels.IHttpCookieContainerManager httpCookieContainerManager = this.InnerChannel.GetProperty<System.ServiceModel.Channels.IHttpCookieContainerManager>();
|
||||
if ((httpCookieContainerManager != null)) {
|
||||
httpCookieContainerManager.CookieContainer = value;
|
||||
}
|
||||
else {
|
||||
throw new System.InvalidOperationException("Unable to set the CookieContainer. Please make sure the binding contains an HttpC" +
|
||||
"ookieContainerBindingElement.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public event System.EventHandler<System.ComponentModel.AsyncCompletedEventArgs> RegisterCompleted;
|
||||
|
||||
public event System.EventHandler<GetServerInfoCompletedEventArgs> GetServerInfoCompleted;
|
||||
|
||||
public event System.EventHandler<System.ComponentModel.AsyncCompletedEventArgs> UpdateTileCompleted;
|
||||
|
||||
public event System.EventHandler<System.ComponentModel.AsyncCompletedEventArgs> OpenCompleted;
|
||||
|
||||
public event System.EventHandler<System.ComponentModel.AsyncCompletedEventArgs> CloseCompleted;
|
||||
|
||||
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
System.IAsyncResult WindowsPhone.Recipes.Push.Client.Services.IPushService.BeginRegister(string userName, System.Uri channelUri, System.AsyncCallback callback, object asyncState) {
|
||||
return base.Channel.BeginRegister(userName, channelUri, callback, asyncState);
|
||||
}
|
||||
|
||||
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
void WindowsPhone.Recipes.Push.Client.Services.IPushService.EndRegister(System.IAsyncResult result) {
|
||||
base.Channel.EndRegister(result);
|
||||
}
|
||||
|
||||
private System.IAsyncResult OnBeginRegister(object[] inValues, System.AsyncCallback callback, object asyncState) {
|
||||
string userName = ((string)(inValues[0]));
|
||||
System.Uri channelUri = ((System.Uri)(inValues[1]));
|
||||
return ((WindowsPhone.Recipes.Push.Client.Services.IPushService)(this)).BeginRegister(userName, channelUri, callback, asyncState);
|
||||
}
|
||||
|
||||
private object[] OnEndRegister(System.IAsyncResult result) {
|
||||
((WindowsPhone.Recipes.Push.Client.Services.IPushService)(this)).EndRegister(result);
|
||||
return null;
|
||||
}
|
||||
|
||||
private void OnRegisterCompleted(object state) {
|
||||
if ((this.RegisterCompleted != null)) {
|
||||
InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state));
|
||||
this.RegisterCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(e.Error, e.Cancelled, e.UserState));
|
||||
}
|
||||
}
|
||||
|
||||
public void RegisterAsync(string userName, System.Uri channelUri) {
|
||||
this.RegisterAsync(userName, channelUri, null);
|
||||
}
|
||||
|
||||
public void RegisterAsync(string userName, System.Uri channelUri, object userState) {
|
||||
if ((this.onBeginRegisterDelegate == null)) {
|
||||
this.onBeginRegisterDelegate = new BeginOperationDelegate(this.OnBeginRegister);
|
||||
}
|
||||
if ((this.onEndRegisterDelegate == null)) {
|
||||
this.onEndRegisterDelegate = new EndOperationDelegate(this.OnEndRegister);
|
||||
}
|
||||
if ((this.onRegisterCompletedDelegate == null)) {
|
||||
this.onRegisterCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnRegisterCompleted);
|
||||
}
|
||||
base.InvokeAsync(this.onBeginRegisterDelegate, new object[] {
|
||||
userName,
|
||||
channelUri}, this.onEndRegisterDelegate, this.onRegisterCompletedDelegate, userState);
|
||||
}
|
||||
|
||||
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
System.IAsyncResult WindowsPhone.Recipes.Push.Client.Services.IPushService.BeginGetServerInfo(System.AsyncCallback callback, object asyncState) {
|
||||
return base.Channel.BeginGetServerInfo(callback, asyncState);
|
||||
}
|
||||
|
||||
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
WindowsPhone.Recipes.Push.Client.Services.ServerInfo WindowsPhone.Recipes.Push.Client.Services.IPushService.EndGetServerInfo(System.IAsyncResult result) {
|
||||
return base.Channel.EndGetServerInfo(result);
|
||||
}
|
||||
|
||||
private System.IAsyncResult OnBeginGetServerInfo(object[] inValues, System.AsyncCallback callback, object asyncState) {
|
||||
return ((WindowsPhone.Recipes.Push.Client.Services.IPushService)(this)).BeginGetServerInfo(callback, asyncState);
|
||||
}
|
||||
|
||||
private object[] OnEndGetServerInfo(System.IAsyncResult result) {
|
||||
WindowsPhone.Recipes.Push.Client.Services.ServerInfo retVal = ((WindowsPhone.Recipes.Push.Client.Services.IPushService)(this)).EndGetServerInfo(result);
|
||||
return new object[] {
|
||||
retVal};
|
||||
}
|
||||
|
||||
private void OnGetServerInfoCompleted(object state) {
|
||||
if ((this.GetServerInfoCompleted != null)) {
|
||||
InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state));
|
||||
this.GetServerInfoCompleted(this, new GetServerInfoCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState));
|
||||
}
|
||||
}
|
||||
|
||||
public void GetServerInfoAsync() {
|
||||
this.GetServerInfoAsync(null);
|
||||
}
|
||||
|
||||
public void GetServerInfoAsync(object userState) {
|
||||
if ((this.onBeginGetServerInfoDelegate == null)) {
|
||||
this.onBeginGetServerInfoDelegate = new BeginOperationDelegate(this.OnBeginGetServerInfo);
|
||||
}
|
||||
if ((this.onEndGetServerInfoDelegate == null)) {
|
||||
this.onEndGetServerInfoDelegate = new EndOperationDelegate(this.OnEndGetServerInfo);
|
||||
}
|
||||
if ((this.onGetServerInfoCompletedDelegate == null)) {
|
||||
this.onGetServerInfoCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnGetServerInfoCompleted);
|
||||
}
|
||||
base.InvokeAsync(this.onBeginGetServerInfoDelegate, null, this.onEndGetServerInfoDelegate, this.onGetServerInfoCompletedDelegate, userState);
|
||||
}
|
||||
|
||||
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
System.IAsyncResult WindowsPhone.Recipes.Push.Client.Services.IPushService.BeginUpdateTile(System.Uri channelUri, string parameter, System.AsyncCallback callback, object asyncState) {
|
||||
return base.Channel.BeginUpdateTile(channelUri, parameter, callback, asyncState);
|
||||
}
|
||||
|
||||
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
void WindowsPhone.Recipes.Push.Client.Services.IPushService.EndUpdateTile(System.IAsyncResult result) {
|
||||
base.Channel.EndUpdateTile(result);
|
||||
}
|
||||
|
||||
private System.IAsyncResult OnBeginUpdateTile(object[] inValues, System.AsyncCallback callback, object asyncState) {
|
||||
System.Uri channelUri = ((System.Uri)(inValues[0]));
|
||||
string parameter = ((string)(inValues[1]));
|
||||
return ((WindowsPhone.Recipes.Push.Client.Services.IPushService)(this)).BeginUpdateTile(channelUri, parameter, callback, asyncState);
|
||||
}
|
||||
|
||||
private object[] OnEndUpdateTile(System.IAsyncResult result) {
|
||||
((WindowsPhone.Recipes.Push.Client.Services.IPushService)(this)).EndUpdateTile(result);
|
||||
return null;
|
||||
}
|
||||
|
||||
private void OnUpdateTileCompleted(object state) {
|
||||
if ((this.UpdateTileCompleted != null)) {
|
||||
InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state));
|
||||
this.UpdateTileCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(e.Error, e.Cancelled, e.UserState));
|
||||
}
|
||||
}
|
||||
|
||||
public void UpdateTileAsync(System.Uri channelUri, string parameter) {
|
||||
this.UpdateTileAsync(channelUri, parameter, null);
|
||||
}
|
||||
|
||||
public void UpdateTileAsync(System.Uri channelUri, string parameter, object userState) {
|
||||
if ((this.onBeginUpdateTileDelegate == null)) {
|
||||
this.onBeginUpdateTileDelegate = new BeginOperationDelegate(this.OnBeginUpdateTile);
|
||||
}
|
||||
if ((this.onEndUpdateTileDelegate == null)) {
|
||||
this.onEndUpdateTileDelegate = new EndOperationDelegate(this.OnEndUpdateTile);
|
||||
}
|
||||
if ((this.onUpdateTileCompletedDelegate == null)) {
|
||||
this.onUpdateTileCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnUpdateTileCompleted);
|
||||
}
|
||||
base.InvokeAsync(this.onBeginUpdateTileDelegate, new object[] {
|
||||
channelUri,
|
||||
parameter}, this.onEndUpdateTileDelegate, this.onUpdateTileCompletedDelegate, userState);
|
||||
}
|
||||
|
||||
private System.IAsyncResult OnBeginOpen(object[] inValues, System.AsyncCallback callback, object asyncState) {
|
||||
return ((System.ServiceModel.ICommunicationObject)(this)).BeginOpen(callback, asyncState);
|
||||
}
|
||||
|
||||
private object[] OnEndOpen(System.IAsyncResult result) {
|
||||
((System.ServiceModel.ICommunicationObject)(this)).EndOpen(result);
|
||||
return null;
|
||||
}
|
||||
|
||||
private void OnOpenCompleted(object state) {
|
||||
if ((this.OpenCompleted != null)) {
|
||||
InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state));
|
||||
this.OpenCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(e.Error, e.Cancelled, e.UserState));
|
||||
}
|
||||
}
|
||||
|
||||
public void OpenAsync() {
|
||||
this.OpenAsync(null);
|
||||
}
|
||||
|
||||
public void OpenAsync(object userState) {
|
||||
if ((this.onBeginOpenDelegate == null)) {
|
||||
this.onBeginOpenDelegate = new BeginOperationDelegate(this.OnBeginOpen);
|
||||
}
|
||||
if ((this.onEndOpenDelegate == null)) {
|
||||
this.onEndOpenDelegate = new EndOperationDelegate(this.OnEndOpen);
|
||||
}
|
||||
if ((this.onOpenCompletedDelegate == null)) {
|
||||
this.onOpenCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnOpenCompleted);
|
||||
}
|
||||
base.InvokeAsync(this.onBeginOpenDelegate, null, this.onEndOpenDelegate, this.onOpenCompletedDelegate, userState);
|
||||
}
|
||||
|
||||
private System.IAsyncResult OnBeginClose(object[] inValues, System.AsyncCallback callback, object asyncState) {
|
||||
return ((System.ServiceModel.ICommunicationObject)(this)).BeginClose(callback, asyncState);
|
||||
}
|
||||
|
||||
private object[] OnEndClose(System.IAsyncResult result) {
|
||||
((System.ServiceModel.ICommunicationObject)(this)).EndClose(result);
|
||||
return null;
|
||||
}
|
||||
|
||||
private void OnCloseCompleted(object state) {
|
||||
if ((this.CloseCompleted != null)) {
|
||||
InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state));
|
||||
this.CloseCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(e.Error, e.Cancelled, e.UserState));
|
||||
}
|
||||
}
|
||||
|
||||
public void CloseAsync() {
|
||||
this.CloseAsync(null);
|
||||
}
|
||||
|
||||
public void CloseAsync(object userState) {
|
||||
if ((this.onBeginCloseDelegate == null)) {
|
||||
this.onBeginCloseDelegate = new BeginOperationDelegate(this.OnBeginClose);
|
||||
}
|
||||
if ((this.onEndCloseDelegate == null)) {
|
||||
this.onEndCloseDelegate = new EndOperationDelegate(this.OnEndClose);
|
||||
}
|
||||
if ((this.onCloseCompletedDelegate == null)) {
|
||||
this.onCloseCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnCloseCompleted);
|
||||
}
|
||||
base.InvokeAsync(this.onBeginCloseDelegate, null, this.onEndCloseDelegate, this.onCloseCompletedDelegate, userState);
|
||||
}
|
||||
|
||||
protected override WindowsPhone.Recipes.Push.Client.Services.IPushService CreateChannel() {
|
||||
return new PushServiceClientChannel(this);
|
||||
}
|
||||
|
||||
private class PushServiceClientChannel : ChannelBase<WindowsPhone.Recipes.Push.Client.Services.IPushService>, WindowsPhone.Recipes.Push.Client.Services.IPushService {
|
||||
|
||||
public PushServiceClientChannel(System.ServiceModel.ClientBase<WindowsPhone.Recipes.Push.Client.Services.IPushService> client) :
|
||||
base(client) {
|
||||
}
|
||||
|
||||
public System.IAsyncResult BeginRegister(string userName, System.Uri channelUri, System.AsyncCallback callback, object asyncState) {
|
||||
object[] _args = new object[2];
|
||||
_args[0] = userName;
|
||||
_args[1] = channelUri;
|
||||
System.IAsyncResult _result = base.BeginInvoke("Register", _args, callback, asyncState);
|
||||
return _result;
|
||||
}
|
||||
|
||||
public void EndRegister(System.IAsyncResult result) {
|
||||
object[] _args = new object[0];
|
||||
base.EndInvoke("Register", _args, result);
|
||||
}
|
||||
|
||||
public System.IAsyncResult BeginGetServerInfo(System.AsyncCallback callback, object asyncState) {
|
||||
object[] _args = new object[0];
|
||||
System.IAsyncResult _result = base.BeginInvoke("GetServerInfo", _args, callback, asyncState);
|
||||
return _result;
|
||||
}
|
||||
|
||||
public WindowsPhone.Recipes.Push.Client.Services.ServerInfo EndGetServerInfo(System.IAsyncResult result) {
|
||||
object[] _args = new object[0];
|
||||
WindowsPhone.Recipes.Push.Client.Services.ServerInfo _result = ((WindowsPhone.Recipes.Push.Client.Services.ServerInfo)(base.EndInvoke("GetServerInfo", _args, result)));
|
||||
return _result;
|
||||
}
|
||||
|
||||
public System.IAsyncResult BeginUpdateTile(System.Uri channelUri, string parameter, System.AsyncCallback callback, object asyncState) {
|
||||
object[] _args = new object[2];
|
||||
_args[0] = channelUri;
|
||||
_args[1] = parameter;
|
||||
System.IAsyncResult _result = base.BeginInvoke("UpdateTile", _args, callback, asyncState);
|
||||
return _result;
|
||||
}
|
||||
|
||||
public void EndUpdateTile(System.IAsyncResult result) {
|
||||
object[] _args = new object[0];
|
||||
base.EndInvoke("UpdateTile", _args, result);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ReferenceGroup xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" ID="b34463ab-d06f-4c3e-8f1c-f4011a6cf3de" xmlns="urn:schemas-microsoft-com:xml-wcfservicemap">
|
||||
<ClientOptions>
|
||||
<GenerateAsynchronousMethods>true</GenerateAsynchronousMethods>
|
||||
<EnableDataBinding>true</EnableDataBinding>
|
||||
<ExcludedTypes />
|
||||
<ImportXmlTypes>false</ImportXmlTypes>
|
||||
<GenerateInternalTypes>false</GenerateInternalTypes>
|
||||
<GenerateMessageContracts>false</GenerateMessageContracts>
|
||||
<NamespaceMappings />
|
||||
<CollectionMappings>
|
||||
<CollectionMapping TypeName="System.Collections.ObjectModel.ObservableCollection`1" Category="List" />
|
||||
</CollectionMappings>
|
||||
<GenerateSerializableTypes>false</GenerateSerializableTypes>
|
||||
<Serializer>Auto</Serializer>
|
||||
<UseSerializerForFaults>true</UseSerializerForFaults>
|
||||
<ReferenceAllAssemblies>true</ReferenceAllAssemblies>
|
||||
<ReferencedAssemblies />
|
||||
<ReferencedDataContractTypes />
|
||||
<ServiceContractMappings />
|
||||
</ClientOptions>
|
||||
<MetadataSources>
|
||||
<MetadataSource Address="http://localhost:8000/PushService/mex" Protocol="mex" SourceId="1" />
|
||||
</MetadataSources>
|
||||
<Metadata>
|
||||
<MetadataFile FileName="service.wsdl" MetadataType="Wsdl" ID="873b7a0f-8033-4034-af94-88cc77224416" SourceId="1" SourceUrl="http://localhost:8000/PushService/mex" />
|
||||
<MetadataFile FileName="service.xsd" MetadataType="Schema" ID="d694fe0f-aa9b-4c7f-81d1-75715872921c" SourceId="1" SourceUrl="http://localhost:8000/PushService/mex" />
|
||||
<MetadataFile FileName="service1.xsd" MetadataType="Schema" ID="6d271cb2-5886-456f-8ab4-c0d85e8835d1" SourceId="1" SourceUrl="http://localhost:8000/PushService/mex" />
|
||||
<MetadataFile FileName="WindowsPhone.Recipes.Push.Server.Models.xsd" MetadataType="Schema" ID="6da06e72-aa72-4541-b7c3-de12dc2f6a68" SourceId="1" SourceUrl="http://localhost:8000/PushService/mex" />
|
||||
</Metadata>
|
||||
<Extensions>
|
||||
<ExtensionFile FileName="configuration91.svcinfo" Name="configuration91.svcinfo" />
|
||||
<ExtensionFile FileName="configuration.svcinfo" Name="configuration.svcinfo" />
|
||||
</Extensions>
|
||||
</ReferenceGroup>
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
This file is automatically generated by Visual Studio .Net. It is
|
||||
used to store generic object data source configuration information.
|
||||
Renaming the file extension or editing the content of this file may
|
||||
cause the file to be unrecognizable by the program.
|
||||
-->
|
||||
<GenericObjectDataSource DisplayName="ServerInfo" Version="1.0" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
|
||||
<TypeInfo>WindowsPhone.Recipes.Push.Client.Services.ServerInfo, Service References.Services.Reference.cs, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</TypeInfo>
|
||||
</GenericObjectDataSource>
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<xs:schema xmlns:tns="http://schemas.datacontract.org/2004/07/WindowsPhone.Recipes.Push.Server.Models" elementFormDefault="qualified" targetNamespace="http://schemas.datacontract.org/2004/07/WindowsPhone.Recipes.Push.Server.Models" xmlns:xs="http://www.w3.org/2001/XMLSchema">
|
||||
<xs:complexType name="ServerInfo">
|
||||
<xs:sequence>
|
||||
<xs:element minOccurs="0" name="Counter" type="xs:int" />
|
||||
<xs:element minOccurs="0" name="PushPattern" nillable="true" type="xs:string" />
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:element name="ServerInfo" nillable="true" type="tns:ServerInfo" />
|
||||
</xs:schema>
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configurationSnapshot xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="urn:schemas-microsoft-com:xml-wcfconfigurationsnapshot">
|
||||
<behaviors />
|
||||
<bindings>
|
||||
<binding digest="System.ServiceModel.Configuration.BasicHttpBindingElement, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089:<?xml version="1.0" encoding="utf-16"?><Data maxBufferSize="2147483647" name="BasicHttpBinding_IPushService"><security mode="None" /></Data>" bindingType="basicHttpBinding" name="BasicHttpBinding_IPushService" />
|
||||
</bindings>
|
||||
<endpoints>
|
||||
<endpoint normalizedDigest="<?xml version="1.0" encoding="utf-16"?><Data address="http://localhost:8000/PushService/" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IPushService" contract="Services.IPushService" name="BasicHttpBinding_IPushService" />" digest="<?xml version="1.0" encoding="utf-16"?><Data address="http://localhost:8000/PushService/" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IPushService" contract="Services.IPushService" name="BasicHttpBinding_IPushService" />" contractName="Services.IPushService" name="BasicHttpBinding_IPushService" />
|
||||
</endpoints>
|
||||
</configurationSnapshot>
|
||||
+201
@@ -0,0 +1,201 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<SavedWcfConfigurationInformation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Version="9.1" CheckSum="S5v8kqHwW6G6hJbtL+pkYskxV7I=">
|
||||
<bindingConfigurations>
|
||||
<bindingConfiguration bindingType="basicHttpBinding" name="BasicHttpBinding_IPushService">
|
||||
<properties>
|
||||
<property path="/name" isComplexType="false" isExplicitlyDefined="true" clrType="System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<serializedValue>BasicHttpBinding_IPushService</serializedValue>
|
||||
</property>
|
||||
<property path="/closeTimeout" isComplexType="false" isExplicitlyDefined="true" clrType="System.TimeSpan, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<serializedValue />
|
||||
</property>
|
||||
<property path="/openTimeout" isComplexType="false" isExplicitlyDefined="true" clrType="System.TimeSpan, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<serializedValue />
|
||||
</property>
|
||||
<property path="/receiveTimeout" isComplexType="false" isExplicitlyDefined="true" clrType="System.TimeSpan, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<serializedValue />
|
||||
</property>
|
||||
<property path="/sendTimeout" isComplexType="false" isExplicitlyDefined="true" clrType="System.TimeSpan, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<serializedValue />
|
||||
</property>
|
||||
<property path="/allowCookies" isComplexType="false" isExplicitlyDefined="true" clrType="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<serializedValue />
|
||||
</property>
|
||||
<property path="/bypassProxyOnLocal" isComplexType="false" isExplicitlyDefined="true" clrType="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<serializedValue />
|
||||
</property>
|
||||
<property path="/hostNameComparisonMode" isComplexType="false" isExplicitlyDefined="false" clrType="System.ServiceModel.HostNameComparisonMode, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<serializedValue>StrongWildcard</serializedValue>
|
||||
</property>
|
||||
<property path="/maxBufferSize" isComplexType="false" isExplicitlyDefined="true" clrType="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<serializedValue>2147483647</serializedValue>
|
||||
</property>
|
||||
<property path="/maxBufferPoolSize" isComplexType="false" isExplicitlyDefined="true" clrType="System.Int64, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<serializedValue />
|
||||
</property>
|
||||
<property path="/maxReceivedMessageSize" isComplexType="false" isExplicitlyDefined="true" clrType="System.Int64, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<serializedValue>2147483647</serializedValue>
|
||||
</property>
|
||||
<property path="/messageEncoding" isComplexType="false" isExplicitlyDefined="false" clrType="System.ServiceModel.WSMessageEncoding, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<serializedValue>Text</serializedValue>
|
||||
</property>
|
||||
<property path="/proxyAddress" isComplexType="false" isExplicitlyDefined="false" clrType="System.Uri, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<serializedValue />
|
||||
</property>
|
||||
<property path="/readerQuotas" isComplexType="true" isExplicitlyDefined="false" clrType="System.ServiceModel.Configuration.XmlDictionaryReaderQuotasElement, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<serializedValue>System.ServiceModel.Configuration.XmlDictionaryReaderQuotasElement</serializedValue>
|
||||
</property>
|
||||
<property path="/readerQuotas/maxDepth" isComplexType="false" isExplicitlyDefined="false" clrType="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<serializedValue>0</serializedValue>
|
||||
</property>
|
||||
<property path="/readerQuotas/maxStringContentLength" isComplexType="false" isExplicitlyDefined="false" clrType="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<serializedValue>0</serializedValue>
|
||||
</property>
|
||||
<property path="/readerQuotas/maxArrayLength" isComplexType="false" isExplicitlyDefined="false" clrType="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<serializedValue>0</serializedValue>
|
||||
</property>
|
||||
<property path="/readerQuotas/maxBytesPerRead" isComplexType="false" isExplicitlyDefined="false" clrType="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<serializedValue>0</serializedValue>
|
||||
</property>
|
||||
<property path="/readerQuotas/maxNameTableCharCount" isComplexType="false" isExplicitlyDefined="false" clrType="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<serializedValue>0</serializedValue>
|
||||
</property>
|
||||
<property path="/security" isComplexType="true" isExplicitlyDefined="false" clrType="System.ServiceModel.Configuration.BasicHttpSecurityElement, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<serializedValue>System.ServiceModel.Configuration.BasicHttpSecurityElement</serializedValue>
|
||||
</property>
|
||||
<property path="/security/mode" isComplexType="false" isExplicitlyDefined="true" clrType="System.ServiceModel.BasicHttpSecurityMode, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<serializedValue>None</serializedValue>
|
||||
</property>
|
||||
<property path="/security/transport" isComplexType="true" isExplicitlyDefined="false" clrType="System.ServiceModel.Configuration.HttpTransportSecurityElement, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<serializedValue>System.ServiceModel.Configuration.HttpTransportSecurityElement</serializedValue>
|
||||
</property>
|
||||
<property path="/security/transport/clientCredentialType" isComplexType="false" isExplicitlyDefined="false" clrType="System.ServiceModel.HttpClientCredentialType, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<serializedValue>None</serializedValue>
|
||||
</property>
|
||||
<property path="/security/transport/proxyCredentialType" isComplexType="false" isExplicitlyDefined="false" clrType="System.ServiceModel.HttpProxyCredentialType, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<serializedValue>None</serializedValue>
|
||||
</property>
|
||||
<property path="/security/transport/extendedProtectionPolicy" isComplexType="true" isExplicitlyDefined="false" clrType="System.Security.Authentication.ExtendedProtection.Configuration.ExtendedProtectionPolicyElement, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<serializedValue>System.Security.Authentication.ExtendedProtection.Configuration.ExtendedProtectionPolicyElement</serializedValue>
|
||||
</property>
|
||||
<property path="/security/transport/extendedProtectionPolicy/policyEnforcement" isComplexType="false" isExplicitlyDefined="false" clrType="System.Security.Authentication.ExtendedProtection.PolicyEnforcement, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<serializedValue>Never</serializedValue>
|
||||
</property>
|
||||
<property path="/security/transport/extendedProtectionPolicy/protectionScenario" isComplexType="false" isExplicitlyDefined="false" clrType="System.Security.Authentication.ExtendedProtection.ProtectionScenario, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<serializedValue>TransportSelected</serializedValue>
|
||||
</property>
|
||||
<property path="/security/transport/extendedProtectionPolicy/customServiceNames" isComplexType="true" isExplicitlyDefined="false" clrType="System.Security.Authentication.ExtendedProtection.Configuration.ServiceNameElementCollection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<serializedValue>(Collection)</serializedValue>
|
||||
</property>
|
||||
<property path="/security/transport/realm" isComplexType="false" isExplicitlyDefined="false" clrType="System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<serializedValue />
|
||||
</property>
|
||||
<property path="/security/message" isComplexType="true" isExplicitlyDefined="false" clrType="System.ServiceModel.Configuration.BasicHttpMessageSecurityElement, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<serializedValue>System.ServiceModel.Configuration.BasicHttpMessageSecurityElement</serializedValue>
|
||||
</property>
|
||||
<property path="/security/message/clientCredentialType" isComplexType="false" isExplicitlyDefined="false" clrType="System.ServiceModel.BasicHttpMessageCredentialType, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<serializedValue>UserName</serializedValue>
|
||||
</property>
|
||||
<property path="/security/message/algorithmSuite" isComplexType="false" isExplicitlyDefined="false" clrType="System.ServiceModel.Security.SecurityAlgorithmSuite, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<serializedValue>Default</serializedValue>
|
||||
</property>
|
||||
<property path="/textEncoding" isComplexType="false" isExplicitlyDefined="false" clrType="System.Text.Encoding, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<serializedValue>System.Text.UTF8Encoding</serializedValue>
|
||||
</property>
|
||||
<property path="/transferMode" isComplexType="false" isExplicitlyDefined="false" clrType="System.ServiceModel.TransferMode, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<serializedValue>Buffered</serializedValue>
|
||||
</property>
|
||||
<property path="/useDefaultWebProxy" isComplexType="false" isExplicitlyDefined="true" clrType="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<serializedValue />
|
||||
</property>
|
||||
</properties>
|
||||
</bindingConfiguration>
|
||||
</bindingConfigurations>
|
||||
<endpoints>
|
||||
<endpoint name="BasicHttpBinding_IPushService" contract="Services.IPushService" bindingType="basicHttpBinding" address="http://localhost:8000/PushService/" bindingConfiguration="BasicHttpBinding_IPushService">
|
||||
<properties>
|
||||
<property path="/address" isComplexType="false" isExplicitlyDefined="true" clrType="System.Uri, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<serializedValue>http://localhost:8000/PushService/</serializedValue>
|
||||
</property>
|
||||
<property path="/behaviorConfiguration" isComplexType="false" isExplicitlyDefined="false" clrType="System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<serializedValue />
|
||||
</property>
|
||||
<property path="/binding" isComplexType="false" isExplicitlyDefined="true" clrType="System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<serializedValue>basicHttpBinding</serializedValue>
|
||||
</property>
|
||||
<property path="/bindingConfiguration" isComplexType="false" isExplicitlyDefined="true" clrType="System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<serializedValue>BasicHttpBinding_IPushService</serializedValue>
|
||||
</property>
|
||||
<property path="/contract" isComplexType="false" isExplicitlyDefined="true" clrType="System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<serializedValue>Services.IPushService</serializedValue>
|
||||
</property>
|
||||
<property path="/headers" isComplexType="true" isExplicitlyDefined="false" clrType="System.ServiceModel.Configuration.AddressHeaderCollectionElement, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<serializedValue>System.ServiceModel.Configuration.AddressHeaderCollectionElement</serializedValue>
|
||||
</property>
|
||||
<property path="/headers/headers" isComplexType="false" isExplicitlyDefined="true" clrType="System.ServiceModel.Channels.AddressHeaderCollection, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<serializedValue><Header /></serializedValue>
|
||||
</property>
|
||||
<property path="/identity" isComplexType="true" isExplicitlyDefined="false" clrType="System.ServiceModel.Configuration.IdentityElement, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<serializedValue>System.ServiceModel.Configuration.IdentityElement</serializedValue>
|
||||
</property>
|
||||
<property path="/identity/userPrincipalName" isComplexType="true" isExplicitlyDefined="false" clrType="System.ServiceModel.Configuration.UserPrincipalNameElement, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<serializedValue>System.ServiceModel.Configuration.UserPrincipalNameElement</serializedValue>
|
||||
</property>
|
||||
<property path="/identity/userPrincipalName/value" isComplexType="false" isExplicitlyDefined="false" clrType="System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<serializedValue />
|
||||
</property>
|
||||
<property path="/identity/servicePrincipalName" isComplexType="true" isExplicitlyDefined="false" clrType="System.ServiceModel.Configuration.ServicePrincipalNameElement, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<serializedValue>System.ServiceModel.Configuration.ServicePrincipalNameElement</serializedValue>
|
||||
</property>
|
||||
<property path="/identity/servicePrincipalName/value" isComplexType="false" isExplicitlyDefined="false" clrType="System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<serializedValue />
|
||||
</property>
|
||||
<property path="/identity/dns" isComplexType="true" isExplicitlyDefined="false" clrType="System.ServiceModel.Configuration.DnsElement, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<serializedValue>System.ServiceModel.Configuration.DnsElement</serializedValue>
|
||||
</property>
|
||||
<property path="/identity/dns/value" isComplexType="false" isExplicitlyDefined="false" clrType="System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<serializedValue />
|
||||
</property>
|
||||
<property path="/identity/rsa" isComplexType="true" isExplicitlyDefined="false" clrType="System.ServiceModel.Configuration.RsaElement, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<serializedValue>System.ServiceModel.Configuration.RsaElement</serializedValue>
|
||||
</property>
|
||||
<property path="/identity/rsa/value" isComplexType="false" isExplicitlyDefined="false" clrType="System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<serializedValue />
|
||||
</property>
|
||||
<property path="/identity/certificate" isComplexType="true" isExplicitlyDefined="false" clrType="System.ServiceModel.Configuration.CertificateElement, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<serializedValue>System.ServiceModel.Configuration.CertificateElement</serializedValue>
|
||||
</property>
|
||||
<property path="/identity/certificate/encodedValue" isComplexType="false" isExplicitlyDefined="false" clrType="System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<serializedValue />
|
||||
</property>
|
||||
<property path="/identity/certificateReference" isComplexType="true" isExplicitlyDefined="false" clrType="System.ServiceModel.Configuration.CertificateReferenceElement, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<serializedValue>System.ServiceModel.Configuration.CertificateReferenceElement</serializedValue>
|
||||
</property>
|
||||
<property path="/identity/certificateReference/storeName" isComplexType="false" isExplicitlyDefined="false" clrType="System.Security.Cryptography.X509Certificates.StoreName, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<serializedValue>My</serializedValue>
|
||||
</property>
|
||||
<property path="/identity/certificateReference/storeLocation" isComplexType="false" isExplicitlyDefined="false" clrType="System.Security.Cryptography.X509Certificates.StoreLocation, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<serializedValue>LocalMachine</serializedValue>
|
||||
</property>
|
||||
<property path="/identity/certificateReference/x509FindType" isComplexType="false" isExplicitlyDefined="false" clrType="System.Security.Cryptography.X509Certificates.X509FindType, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<serializedValue>FindBySubjectDistinguishedName</serializedValue>
|
||||
</property>
|
||||
<property path="/identity/certificateReference/findValue" isComplexType="false" isExplicitlyDefined="false" clrType="System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<serializedValue />
|
||||
</property>
|
||||
<property path="/identity/certificateReference/isChainIncluded" isComplexType="false" isExplicitlyDefined="false" clrType="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<serializedValue>False</serializedValue>
|
||||
</property>
|
||||
<property path="/name" isComplexType="false" isExplicitlyDefined="true" clrType="System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<serializedValue>BasicHttpBinding_IPushService</serializedValue>
|
||||
</property>
|
||||
<property path="/kind" isComplexType="false" isExplicitlyDefined="false" clrType="System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<serializedValue />
|
||||
</property>
|
||||
<property path="/endpointConfiguration" isComplexType="false" isExplicitlyDefined="false" clrType="System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<serializedValue />
|
||||
</property>
|
||||
</properties>
|
||||
</endpoint>
|
||||
</endpoints>
|
||||
</SavedWcfConfigurationInformation>
|
||||
+77
@@ -0,0 +1,77 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<wsdl:definitions xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy" xmlns:wsa10="http://www.w3.org/2005/08/addressing" xmlns:tns="http://tempuri.org/" xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="PushService" targetNamespace="http://tempuri.org/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
|
||||
<wsdl:types>
|
||||
<xsd:schema targetNamespace="http://tempuri.org/Imports">
|
||||
<xsd:import namespace="http://tempuri.org/" />
|
||||
<xsd:import namespace="http://schemas.microsoft.com/2003/10/Serialization/" />
|
||||
<xsd:import namespace="http://schemas.datacontract.org/2004/07/WindowsPhone.Recipes.Push.Server.Models" />
|
||||
</xsd:schema>
|
||||
</wsdl:types>
|
||||
<wsdl:message name="IPushService_Register_InputMessage">
|
||||
<wsdl:part name="parameters" element="tns:Register" />
|
||||
</wsdl:message>
|
||||
<wsdl:message name="IPushService_Register_OutputMessage">
|
||||
<wsdl:part name="parameters" element="tns:RegisterResponse" />
|
||||
</wsdl:message>
|
||||
<wsdl:message name="IPushService_GetServerInfo_InputMessage">
|
||||
<wsdl:part name="parameters" element="tns:GetServerInfo" />
|
||||
</wsdl:message>
|
||||
<wsdl:message name="IPushService_GetServerInfo_OutputMessage">
|
||||
<wsdl:part name="parameters" element="tns:GetServerInfoResponse" />
|
||||
</wsdl:message>
|
||||
<wsdl:message name="IPushService_UpdateTile_InputMessage">
|
||||
<wsdl:part name="parameters" element="tns:UpdateTile" />
|
||||
</wsdl:message>
|
||||
<wsdl:message name="IPushService_UpdateTile_OutputMessage">
|
||||
<wsdl:part name="parameters" element="tns:UpdateTileResponse" />
|
||||
</wsdl:message>
|
||||
<wsdl:portType name="IPushService">
|
||||
<wsdl:operation name="Register">
|
||||
<wsdl:input wsaw:Action="http://tempuri.org/IPushService/Register" message="tns:IPushService_Register_InputMessage" />
|
||||
<wsdl:output wsaw:Action="http://tempuri.org/IPushService/RegisterResponse" message="tns:IPushService_Register_OutputMessage" />
|
||||
</wsdl:operation>
|
||||
<wsdl:operation name="GetServerInfo">
|
||||
<wsdl:input wsaw:Action="http://tempuri.org/IPushService/GetServerInfo" message="tns:IPushService_GetServerInfo_InputMessage" />
|
||||
<wsdl:output wsaw:Action="http://tempuri.org/IPushService/GetServerInfoResponse" message="tns:IPushService_GetServerInfo_OutputMessage" />
|
||||
</wsdl:operation>
|
||||
<wsdl:operation name="UpdateTile">
|
||||
<wsdl:input wsaw:Action="http://tempuri.org/IPushService/UpdateTile" message="tns:IPushService_UpdateTile_InputMessage" />
|
||||
<wsdl:output wsaw:Action="http://tempuri.org/IPushService/UpdateTileResponse" message="tns:IPushService_UpdateTile_OutputMessage" />
|
||||
</wsdl:operation>
|
||||
</wsdl:portType>
|
||||
<wsdl:binding name="BasicHttpBinding_IPushService" type="tns:IPushService">
|
||||
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" />
|
||||
<wsdl:operation name="Register">
|
||||
<soap:operation soapAction="http://tempuri.org/IPushService/Register" style="document" />
|
||||
<wsdl:input>
|
||||
<soap:body use="literal" />
|
||||
</wsdl:input>
|
||||
<wsdl:output>
|
||||
<soap:body use="literal" />
|
||||
</wsdl:output>
|
||||
</wsdl:operation>
|
||||
<wsdl:operation name="GetServerInfo">
|
||||
<soap:operation soapAction="http://tempuri.org/IPushService/GetServerInfo" style="document" />
|
||||
<wsdl:input>
|
||||
<soap:body use="literal" />
|
||||
</wsdl:input>
|
||||
<wsdl:output>
|
||||
<soap:body use="literal" />
|
||||
</wsdl:output>
|
||||
</wsdl:operation>
|
||||
<wsdl:operation name="UpdateTile">
|
||||
<soap:operation soapAction="http://tempuri.org/IPushService/UpdateTile" style="document" />
|
||||
<wsdl:input>
|
||||
<soap:body use="literal" />
|
||||
</wsdl:input>
|
||||
<wsdl:output>
|
||||
<soap:body use="literal" />
|
||||
</wsdl:output>
|
||||
</wsdl:operation>
|
||||
</wsdl:binding>
|
||||
<wsdl:service name="PushService">
|
||||
<wsdl:port name="BasicHttpBinding_IPushService" binding="tns:BasicHttpBinding_IPushService">
|
||||
<soap:address location="http://localhost:8000/PushService/" />
|
||||
</wsdl:port>
|
||||
</wsdl:service>
|
||||
</wsdl:definitions>
|
||||
+42
@@ -0,0 +1,42 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<xs:schema xmlns:tns="http://tempuri.org/" elementFormDefault="qualified" targetNamespace="http://tempuri.org/" xmlns:xs="http://www.w3.org/2001/XMLSchema">
|
||||
<xs:import namespace="http://schemas.datacontract.org/2004/07/WindowsPhone.Recipes.Push.Server.Models" />
|
||||
<xs:element name="Register">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element minOccurs="0" name="userName" nillable="true" type="xs:string" />
|
||||
<xs:element minOccurs="0" name="channelUri" nillable="true" type="xs:anyURI" />
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:element name="RegisterResponse">
|
||||
<xs:complexType>
|
||||
<xs:sequence />
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:element name="GetServerInfo">
|
||||
<xs:complexType>
|
||||
<xs:sequence />
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:element name="GetServerInfoResponse">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element xmlns:q1="http://schemas.datacontract.org/2004/07/WindowsPhone.Recipes.Push.Server.Models" minOccurs="0" name="GetServerInfoResult" nillable="true" type="q1:ServerInfo" />
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:element name="UpdateTile">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element minOccurs="0" name="channelUri" nillable="true" type="xs:anyURI" />
|
||||
<xs:element minOccurs="0" name="parameter" nillable="true" type="xs:string" />
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:element name="UpdateTileResponse">
|
||||
<xs:complexType>
|
||||
<xs:sequence />
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:schema>
|
||||
+42
@@ -0,0 +1,42 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<xs:schema xmlns:tns="http://schemas.microsoft.com/2003/10/Serialization/" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://schemas.microsoft.com/2003/10/Serialization/" xmlns:xs="http://www.w3.org/2001/XMLSchema">
|
||||
<xs:element name="anyType" nillable="true" type="xs:anyType" />
|
||||
<xs:element name="anyURI" nillable="true" type="xs:anyURI" />
|
||||
<xs:element name="base64Binary" nillable="true" type="xs:base64Binary" />
|
||||
<xs:element name="boolean" nillable="true" type="xs:boolean" />
|
||||
<xs:element name="byte" nillable="true" type="xs:byte" />
|
||||
<xs:element name="dateTime" nillable="true" type="xs:dateTime" />
|
||||
<xs:element name="decimal" nillable="true" type="xs:decimal" />
|
||||
<xs:element name="double" nillable="true" type="xs:double" />
|
||||
<xs:element name="float" nillable="true" type="xs:float" />
|
||||
<xs:element name="int" nillable="true" type="xs:int" />
|
||||
<xs:element name="long" nillable="true" type="xs:long" />
|
||||
<xs:element name="QName" nillable="true" type="xs:QName" />
|
||||
<xs:element name="short" nillable="true" type="xs:short" />
|
||||
<xs:element name="string" nillable="true" type="xs:string" />
|
||||
<xs:element name="unsignedByte" nillable="true" type="xs:unsignedByte" />
|
||||
<xs:element name="unsignedInt" nillable="true" type="xs:unsignedInt" />
|
||||
<xs:element name="unsignedLong" nillable="true" type="xs:unsignedLong" />
|
||||
<xs:element name="unsignedShort" nillable="true" type="xs:unsignedShort" />
|
||||
<xs:element name="char" nillable="true" type="tns:char" />
|
||||
<xs:simpleType name="char">
|
||||
<xs:restriction base="xs:int" />
|
||||
</xs:simpleType>
|
||||
<xs:element name="duration" nillable="true" type="tns:duration" />
|
||||
<xs:simpleType name="duration">
|
||||
<xs:restriction base="xs:duration">
|
||||
<xs:pattern value="\-?P(\d*D)?(T(\d*H)?(\d*M)?(\d*(\.\d*)?S)?)?" />
|
||||
<xs:minInclusive value="-P10675199DT2H48M5.4775808S" />
|
||||
<xs:maxInclusive value="P10675199DT2H48M5.4775807S" />
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
<xs:element name="guid" nillable="true" type="tns:guid" />
|
||||
<xs:simpleType name="guid">
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:pattern value="[\da-fA-F]{8}-[\da-fA-F]{4}-[\da-fA-F]{4}-[\da-fA-F]{4}-[\da-fA-F]{12}" />
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
<xs:attribute name="FactoryType" type="xs:QName" />
|
||||
<xs:attribute name="Id" type="xs:ID" />
|
||||
<xs:attribute name="Ref" type="xs:IDREF" />
|
||||
</xs:schema>
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
<configuration>
|
||||
<system.serviceModel>
|
||||
<bindings>
|
||||
<basicHttpBinding>
|
||||
<binding name="BasicHttpBinding_IPushService" maxBufferSize="2147483647"
|
||||
maxReceivedMessageSize="2147483647">
|
||||
<security mode="None" />
|
||||
</binding>
|
||||
</basicHttpBinding>
|
||||
</bindings>
|
||||
<client>
|
||||
<endpoint address="http://localhost:8000/PushService/" binding="basicHttpBinding"
|
||||
bindingConfiguration="BasicHttpBinding_IPushService" contract="Services.IPushService"
|
||||
name="BasicHttpBinding_IPushService" />
|
||||
</client>
|
||||
</system.serviceModel>
|
||||
</configuration>
|
||||
BIN
Binary file not shown.
|
After Width: | Height: | Size: 9.2 KiB |
+79
@@ -0,0 +1,79 @@
|
||||
<UserControl x:Class="WindowsPhone.Recipes.Push.Client.Views.InboxView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:tk="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
mc:Ignorable="d"
|
||||
FontFamily="{StaticResource PhoneFontFamilyNormal}"
|
||||
FontSize="{StaticResource PhoneFontSizeNormal}"
|
||||
Foreground="{StaticResource PhoneForegroundBrush}"
|
||||
d:DesignHeight="480" d:DesignWidth="480">
|
||||
|
||||
<Grid x:Name="LayoutRoot" Background="{StaticResource PhoneChromeBrush}">
|
||||
|
||||
<VisualStateManager.VisualStateGroups>
|
||||
<VisualStateGroup x:Name="Views">
|
||||
<VisualState x:Name="NormalView" />
|
||||
<VisualState x:Name="ScheduleView">
|
||||
<Storyboard>
|
||||
<ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="TileScheduleView" Storyboard.TargetProperty="Visibility">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="Visible" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
</VisualStateManager.VisualStateGroups>
|
||||
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="120"/>
|
||||
<RowDefinition Height="120"/>
|
||||
<RowDefinition Height="60"/>
|
||||
<RowDefinition Height="*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<StackPanel d:LayoutOverrides="Height">
|
||||
<TextBlock Margin="12,12,0,0" Text="Active Push Pattern" FontSize="24" />
|
||||
<ListBox ItemsSource="{Binding PushPatterns}"
|
||||
IsHitTestVisible="False"
|
||||
SelectedItem="{Binding PushPattern, Mode=TwoWay}"
|
||||
ItemsPanel="{StaticResource ItemsPanelTemplate}"
|
||||
ItemContainerStyle="{StaticResource PatternListBoxItemStyle}"
|
||||
HorizontalAlignment="Center">
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding}"
|
||||
TextWrapping="Wrap"
|
||||
VerticalAlignment="Center"
|
||||
HorizontalAlignment="Center"
|
||||
TextAlignment="Center" />
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>
|
||||
</StackPanel>
|
||||
<StackPanel Grid.Row="1" d:LayoutOverrides="Height">
|
||||
<TextBlock Margin="12,12,0,0" Text="Counter (if relevant)" FontSize="24" />
|
||||
<TextBlock Margin="12,12,0,0" Text="{Binding Counter}" Foreground="LightBlue" />
|
||||
</StackPanel>
|
||||
<TextBlock Margin="12,12,0,17" Text="Raw Messages (last on top)" Grid.Row="2" d:LayoutOverrides="Height" FontSize="24" />
|
||||
<ListBox ItemsSource="{Binding RawMessages}" Grid.Row="4" Margin="12,0,12,80"/>
|
||||
<Border x:Name="TileScheduleView"
|
||||
Grid.Row="1" Grid.RowSpan="3"
|
||||
Visibility="Collapsed"
|
||||
Background="{StaticResource PhoneChromeBrush}">
|
||||
<StackPanel>
|
||||
<TextBlock Margin="12,12,0,17" Text="Tile Image (located on server)" Grid.Row="2" d:LayoutOverrides="Height" FontSize="24" />
|
||||
<ListBox ItemsSource="{Binding ServerImages}"
|
||||
SelectedItem="{Binding SelectedServerImage, Mode=TwoWay}"
|
||||
Margin="12,0,12,0" />
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Button Content="Schedule" Click="ButtonSchedule_Click" />
|
||||
<Button Content="Test Now" Click="ButtonTestNow_Click" Grid.Column="1" />
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
+275
@@ -0,0 +1,275 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Animation;
|
||||
using System.Windows.Shapes;
|
||||
using System.IO;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Threading;
|
||||
using Microsoft.Phone.Shell;
|
||||
|
||||
using Microsoft.Phone.Notification;
|
||||
|
||||
using WindowsPhone.Recipes.Push.Client.Services;
|
||||
using WindowsPhone.Recipes.Push.Client.Controls;
|
||||
|
||||
namespace WindowsPhone.Recipes.Push.Client.Views
|
||||
{
|
||||
public partial class InboxView : UserControl
|
||||
{
|
||||
#region Fields
|
||||
|
||||
/// <value>Url of the GetTileImage REST service.</value>
|
||||
private static readonly string GetTileImageService = App.ServerAddress + "/ImageService/GetTileImage?uri={0}";
|
||||
|
||||
private readonly ObservableCollection<string> _rawMessages = new ObservableCollection<string>();
|
||||
private ShellTileSchedule _tileSchedule;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Properties
|
||||
|
||||
public ObservableCollection<string> RawMessages
|
||||
{
|
||||
get { return _rawMessages; }
|
||||
}
|
||||
|
||||
public IEnumerable<string> ServerImages
|
||||
{
|
||||
get
|
||||
{
|
||||
return new string[]
|
||||
{
|
||||
"number0.png",
|
||||
"number1.png",
|
||||
"number2.png",
|
||||
"number3.png",
|
||||
"number4.png",
|
||||
"number5.png",
|
||||
"number6.png",
|
||||
"number7.png",
|
||||
"number8.png",
|
||||
"number9.png"
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public string SelectedServerImage
|
||||
{
|
||||
get { return (string)GetValue(SelectedServerImageProperty); }
|
||||
set { SetValue(SelectedServerImageProperty, value); }
|
||||
}
|
||||
|
||||
// Using a DependencyProperty as the backing store for SelectedServerImage. This enables animation, styling, binding, etc...
|
||||
public static readonly DependencyProperty SelectedServerImageProperty =
|
||||
DependencyProperty.Register(
|
||||
"SelectedServerImage",
|
||||
typeof(string),
|
||||
typeof(InboxView),
|
||||
new PropertyMetadata("number0.png"));
|
||||
|
||||
|
||||
|
||||
public IEnumerable<string> PushPatterns
|
||||
{
|
||||
get { return new string[] { "One Time", "Counter", "Ask to Pin", "Custom Tile", "Tile Schedule" }; }
|
||||
}
|
||||
|
||||
public string PushPattern
|
||||
{
|
||||
get { return (string)GetValue(PushPatternProperty); }
|
||||
set { SetValue(PushPatternProperty, value); }
|
||||
}
|
||||
|
||||
// Using a DependencyProperty as the backing store for PushPattern. This enables animation, styling, binding, etc...
|
||||
public static readonly DependencyProperty PushPatternProperty =
|
||||
DependencyProperty.Register(
|
||||
"PushPattern",
|
||||
typeof(string),
|
||||
typeof(InboxView),
|
||||
new PropertyMetadata(null, PushPatternChanged));
|
||||
|
||||
private static void PushPatternChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
var view = d as InboxView;
|
||||
if ("Tile Schedule".CompareTo(e.NewValue) == 0)
|
||||
{
|
||||
VisualStateManager.GoToState(view, "ScheduleView", false);
|
||||
}
|
||||
else
|
||||
{
|
||||
VisualStateManager.GoToState(view, "NormalView", false);
|
||||
}
|
||||
}
|
||||
|
||||
public int Counter
|
||||
{
|
||||
get { return (int)GetValue(CounterProperty); }
|
||||
set { SetValue(CounterProperty, value); }
|
||||
}
|
||||
|
||||
// Using a DependencyProperty as the backing store for Counter. This enables animation, styling, binding, etc...
|
||||
public static readonly DependencyProperty CounterProperty =
|
||||
DependencyProperty.Register(
|
||||
"Counter",
|
||||
typeof(int),
|
||||
typeof(InboxView),
|
||||
new PropertyMetadata(0));
|
||||
|
||||
public string TileScheduleParameter
|
||||
{
|
||||
get { return (string)GetValue(TileScheduleParameterProperty); }
|
||||
set { SetValue(TileScheduleParameterProperty, value); }
|
||||
}
|
||||
|
||||
// Using a DependencyProperty as the backing store for TileScheduleParameter. This enables animation, styling, binding, etc...
|
||||
public static readonly DependencyProperty TileScheduleParameterProperty =
|
||||
DependencyProperty.Register(
|
||||
"TileScheduleParameter",
|
||||
typeof(string),
|
||||
typeof(InboxView),
|
||||
new PropertyMetadata("number0.png"));
|
||||
|
||||
#endregion
|
||||
|
||||
public InboxView()
|
||||
{
|
||||
DataContext = this;
|
||||
InitializeComponent();
|
||||
|
||||
Loaded += InboxView_Loaded;
|
||||
Unloaded += InboxView_Unloaded;
|
||||
UpdateServerInfo();
|
||||
}
|
||||
|
||||
private void InboxView_Unloaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
UnregisterRawNotification();
|
||||
}
|
||||
|
||||
private void InboxView_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
RegisterRawNotification();
|
||||
}
|
||||
|
||||
private void UpdateServerInfo()
|
||||
{
|
||||
try
|
||||
{
|
||||
var pushService = new PushServiceClient();
|
||||
pushService.GetServerInfoCompleted += (s1, e1) =>
|
||||
{
|
||||
try
|
||||
{
|
||||
pushService.CloseAsync();
|
||||
if (e1.Result != null)
|
||||
{
|
||||
Dispatcher.BeginInvoke(() =>
|
||||
{
|
||||
PushPattern = e1.Result.PushPattern;
|
||||
Counter = e1.Result.Counter;
|
||||
});
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
ex.Show();
|
||||
}
|
||||
};
|
||||
|
||||
pushService.GetServerInfoAsync();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
ex.Show();
|
||||
}
|
||||
}
|
||||
|
||||
private void RegisterRawNotification()
|
||||
{
|
||||
var context = PushContext.Current;
|
||||
if (context != null)
|
||||
{
|
||||
context.RawNotification += context_RawNotification;
|
||||
}
|
||||
}
|
||||
|
||||
private void UnregisterRawNotification()
|
||||
{
|
||||
var context = PushContext.Current;
|
||||
if (context != null)
|
||||
{
|
||||
context.RawNotification -= context_RawNotification;
|
||||
}
|
||||
}
|
||||
|
||||
private void context_RawNotification(object sender, HttpNotificationEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
using (var stream = new StreamReader(e.Notification.Body))
|
||||
{
|
||||
var rawMessage = stream.ReadToEnd();
|
||||
_rawMessages.Insert(0, rawMessage);
|
||||
if ("AskToPin".CompareTo(rawMessage) == 0)
|
||||
{
|
||||
AskToPin();
|
||||
}
|
||||
|
||||
UpdateServerInfo();
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
ex.Show();
|
||||
}
|
||||
}
|
||||
|
||||
private void AskToPin()
|
||||
{
|
||||
NotificationBox.Show("Important", "Please pin your application to Start Screen so this application can work properly.");
|
||||
}
|
||||
|
||||
private void ButtonSchedule_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
_tileSchedule = new ShellTileSchedule();
|
||||
_tileSchedule.Recurrence = UpdateRecurrence.Interval;
|
||||
_tileSchedule.StartTime = DateTime.Now;
|
||||
_tileSchedule.Interval = UpdateInterval.EveryHour;
|
||||
_tileSchedule.RemoteImageUri = new Uri(string.Format(GetTileImageService, TileScheduleParameter));
|
||||
_tileSchedule.Start();
|
||||
}
|
||||
|
||||
private void ButtonTestNow_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
var pushService = new PushServiceClient();
|
||||
pushService.UpdateTileCompleted += (s1, e1) =>
|
||||
{
|
||||
try
|
||||
{
|
||||
pushService.CloseAsync();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
ex.Show();
|
||||
}
|
||||
};
|
||||
|
||||
pushService.UpdateTileAsync(PushContext.Current.NotificationChannel.ChannelUri, SelectedServerImage);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
ex.Show();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace WindowsPhone.Recipes.Push.Client.Views
|
||||
{
|
||||
public class LoginEventArgs : EventArgs
|
||||
{
|
||||
public Exception Exception { get; private set; }
|
||||
|
||||
public LoginEventArgs(Exception exception = null)
|
||||
{
|
||||
Exception = exception;
|
||||
}
|
||||
}
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
<UserControl x:Class="WindowsPhone.Recipes.Push.Client.Views.PushSettingsView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:my="clr-namespace:WindowsPhone.Recipes.Push.Client.Controls"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
mc:Ignorable="d"
|
||||
FontFamily="{StaticResource PhoneFontFamilyNormal}"
|
||||
FontSize="{StaticResource PhoneFontSizeNormal}"
|
||||
Foreground="{StaticResource PhoneForegroundBrush}"
|
||||
d:DesignHeight="628" d:DesignWidth="480">
|
||||
|
||||
<Grid x:Name="LayoutRoot" Background="{StaticResource PhoneChromeBrush}">
|
||||
<my:PushSettingsControl x:Name="settingsControl" />
|
||||
</Grid>
|
||||
</UserControl>
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Animation;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
namespace WindowsPhone.Recipes.Push.Client.Views
|
||||
{
|
||||
public partial class PushSettingsView : UserControl
|
||||
{
|
||||
public PushSettingsView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
<UserControl x:Class="WindowsPhone.Recipes.Push.Client.Views.UserLoginView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls"
|
||||
xmlns:my="clr-namespace:WindowsPhone.Recipes.Push.Client.Controls"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
mc:Ignorable="d"
|
||||
FontFamily="{StaticResource PhoneFontFamilyNormal}"
|
||||
FontSize="{StaticResource PhoneFontSizeNormal}"
|
||||
Foreground="{StaticResource PhoneForegroundBrush}"
|
||||
d:DesignHeight="480" d:DesignWidth="480">
|
||||
|
||||
<!--ContentPanel - place additional content here-->
|
||||
<Grid x:Name="LayoutRoot">
|
||||
<my:ProgressBarWithText x:Name="progress" Margin="0,-40,0,0" Text="Login..." FontSize="24" ShowProgress="True" Visibility="Collapsed" />
|
||||
<StackPanel x:Name="login" Visibility="Collapsed">
|
||||
<StackPanel>
|
||||
<TextBlock Text="User Name" />
|
||||
<TextBox x:Name="textBoxUserName" Text="{Binding UserName, Mode=TwoWay}" />
|
||||
</StackPanel>
|
||||
<Button x:Name="buttonLogin" Content="Login" Click="ButtonLogin_Click" />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
|
||||
</UserControl>
|
||||
+115
@@ -0,0 +1,115 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Animation;
|
||||
using System.Windows.Shapes;
|
||||
using System.IO.IsolatedStorage;
|
||||
|
||||
using WindowsPhone.Recipes.Push.Client.Services;
|
||||
using System.Threading;
|
||||
|
||||
namespace WindowsPhone.Recipes.Push.Client.Views
|
||||
{
|
||||
public partial class UserLoginView : UserControl
|
||||
{
|
||||
#region Fields
|
||||
|
||||
private readonly IsolatedStorageSettings Settings = IsolatedStorageSettings.ApplicationSettings;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Properties
|
||||
|
||||
public string UserName { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
#region Events
|
||||
|
||||
public event EventHandler<LoginEventArgs> Login;
|
||||
|
||||
#endregion
|
||||
|
||||
public UserLoginView()
|
||||
{
|
||||
DataContext = this;
|
||||
|
||||
InitializeComponent();
|
||||
|
||||
Loaded += UserLoginView_Loaded;
|
||||
}
|
||||
|
||||
private void UserLoginView_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
string userName;
|
||||
if (!Settings.TryGetValue("LoginPage.UserName", out userName))
|
||||
{
|
||||
login.Visibility = Visibility.Visible;
|
||||
}
|
||||
else
|
||||
{
|
||||
UserName = userName;
|
||||
InternalLogin();
|
||||
}
|
||||
}
|
||||
|
||||
private void ButtonLogin_Click(object sender, RoutedEventArgs args)
|
||||
{
|
||||
Settings["LoginPage.UserName"] = UserName;
|
||||
login.Visibility = Visibility.Collapsed;
|
||||
InternalLogin();
|
||||
}
|
||||
|
||||
private void OnLogin(LoginEventArgs args)
|
||||
{
|
||||
if (Login != null)
|
||||
{
|
||||
Login(this, args);
|
||||
}
|
||||
}
|
||||
|
||||
private void InternalLogin()
|
||||
{
|
||||
login.Visibility = Visibility.Collapsed;
|
||||
progress.Visibility = Visibility.Visible;
|
||||
|
||||
var pushContext = PushContext.Current;
|
||||
pushContext.Connect(c => RegisterClient(c.ChannelUri));
|
||||
}
|
||||
|
||||
private void RegisterClient(Uri channelUri)
|
||||
{
|
||||
// Register the URI with 3rd party web service.
|
||||
try
|
||||
{
|
||||
var pushService = new PushServiceClient();
|
||||
pushService.RegisterCompleted += (s, e) =>
|
||||
{
|
||||
pushService.CloseAsync();
|
||||
|
||||
Completed(e.Error);
|
||||
};
|
||||
|
||||
pushService.RegisterAsync(UserName, channelUri);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Completed(ex);
|
||||
}
|
||||
}
|
||||
|
||||
private void Completed(Exception ex)
|
||||
{
|
||||
login.Visibility = Visibility.Visible;
|
||||
progress.Visibility = Visibility.Collapsed;
|
||||
|
||||
Dispatcher.BeginInvoke(() => OnLogin(new LoginEventArgs(ex)));
|
||||
}
|
||||
}
|
||||
}
|
||||
+196
@@ -0,0 +1,196 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>10.0.20506</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{DD28493E-0C20-4175-AEB0-E76D94EC92D3}</ProjectGuid>
|
||||
<ProjectTypeGuids>{C089C8C0-30E0-4E22-80C0-CE093F111A43};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>WindowsPhone.Recipes.Push.Client</RootNamespace>
|
||||
<AssemblyName>PushClient</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||
<SilverlightVersion>$(TargetFrameworkVersion)</SilverlightVersion>
|
||||
<TargetFrameworkProfile>WindowsPhone</TargetFrameworkProfile>
|
||||
<TargetFrameworkIdentifier>Silverlight</TargetFrameworkIdentifier>
|
||||
<SilverlightApplication>true</SilverlightApplication>
|
||||
<SupportedCultures>
|
||||
</SupportedCultures>
|
||||
<XapOutputs>true</XapOutputs>
|
||||
<GenerateSilverlightManifest>true</GenerateSilverlightManifest>
|
||||
<XapFilename>PushClient.xap</XapFilename>
|
||||
<SilverlightManifestTemplate>Properties\AppManifest.xml</SilverlightManifestTemplate>
|
||||
<SilverlightAppEntry>WindowsPhone.Recipes.Push.Client.App</SilverlightAppEntry>
|
||||
<ValidateXaml>true</ValidateXaml>
|
||||
<ThrowErrorsInValidation>true</ThrowErrorsInValidation>
|
||||
<SccProjectName>SAK</SccProjectName>
|
||||
<SccLocalPath>SAK</SccLocalPath>
|
||||
<SccAuxPath>SAK</SccAuxPath>
|
||||
<SccProvider>SAK</SccProvider>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>Bin\Debug</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE;SILVERLIGHT;WINDOWS_PHONE</DefineConstants>
|
||||
<NoStdLib>true</NoStdLib>
|
||||
<NoConfig>true</NoConfig>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>Bin\Release</OutputPath>
|
||||
<DefineConstants>TRACE;SILVERLIGHT;WINDOWS_PHONE</DefineConstants>
|
||||
<NoStdLib>true</NoStdLib>
|
||||
<NoConfig>true</NoConfig>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Microsoft.Phone" />
|
||||
<Reference Include="Microsoft.Phone.Controls, Version=7.0.0.0, Culture=neutral, PublicKeyToken=24eec0d8c86cda1e, processorArchitecture=MSIL" />
|
||||
<Reference Include="Microsoft.Phone.Controls.Toolkit, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b772ad94eb9ca604, processorArchitecture=MSIL" />
|
||||
<Reference Include="Microsoft.Phone.Interop" />
|
||||
<Reference Include="System.Net" />
|
||||
<Reference Include="System.Runtime.Serialization" />
|
||||
<Reference Include="System.Servicemodel" />
|
||||
<Reference Include="System.Servicemodel.Web" />
|
||||
<Reference Include="System.Windows" />
|
||||
<Reference Include="system" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="App.xaml.cs">
|
||||
<DependentUpon>App.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Controls\NotificationBox.xaml.cs">
|
||||
<DependentUpon>NotificationBox.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Controls\ViewTransitions.cs" />
|
||||
<Compile Include="Converters\BoolBrushConverter.cs" />
|
||||
<Compile Include="ExceptionExtensions.cs" />
|
||||
<Compile Include="MainPage.xaml.cs">
|
||||
<DependentUpon>MainPage.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Controls\ProgressBar\BooleanToVisibilityConverter.cs" />
|
||||
<Compile Include="Controls\ProgressBar\ProgressBarWithText.xaml.cs">
|
||||
<DependentUpon>ProgressBarWithText.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Controls\ProgressBar\RelativeAnimatingContentControl.cs" />
|
||||
<Compile Include="PushContextErrorEventArgs.cs" />
|
||||
<Compile Include="PushContextEventArgs.cs" />
|
||||
<Compile Include="PushContext.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Controls\PushSettingsControl.xaml.cs">
|
||||
<DependentUpon>PushSettingsControl.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Service References\Services\Reference.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>Reference.svcmap</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Views\InboxView.xaml.cs">
|
||||
<DependentUpon>InboxView.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Views\LoginEventArgs.cs" />
|
||||
<Compile Include="Views\PushSettingsView.xaml.cs">
|
||||
<DependentUpon>PushSettingsView.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Views\UserLoginView.xaml.cs">
|
||||
<DependentUpon>UserLoginView.xaml</DependentUpon>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ApplicationDefinition Include="App.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</ApplicationDefinition>
|
||||
<Page Include="Controls\NotificationBox.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="MainPage.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Controls\PushSettingsControl.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Controls\ProgressBar\ProgressBarWithText.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="Views\InboxView.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Views\PushSettingsView.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Views\UserLoginView.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Properties\AppManifest.xml" />
|
||||
<None Include="Properties\WMAppManifest.xml" />
|
||||
<None Include="Service References\Services\service.wsdl" />
|
||||
<None Include="Service References\Services\service.xsd">
|
||||
<SubType>Designer</SubType>
|
||||
</None>
|
||||
<None Include="Service References\Services\service1.xsd">
|
||||
<SubType>Designer</SubType>
|
||||
</None>
|
||||
<None Include="Service References\Services\WindowsPhone.Recipes.Push.Client.Services.ServerInfo1.datasource">
|
||||
<DependentUpon>Reference.svcmap</DependentUpon>
|
||||
</None>
|
||||
<None Include="Service References\Services\WindowsPhone.Recipes.Push.Server.Models.xsd">
|
||||
<SubType>Designer</SubType>
|
||||
</None>
|
||||
<Content Include="ServiceReferences.ClientConfig" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="ApplicationIcon.png">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Background.png">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Resources\TileImages\TileBackground1.jpg" />
|
||||
<Content Include="Resources\TileImages\TileBackground2.jpg" />
|
||||
<Content Include="Resources\TileImages\TileBackground3.jpg" />
|
||||
<None Include="Service References\Services\configuration91.svcinfo" />
|
||||
<None Include="Service References\Services\configuration.svcinfo" />
|
||||
<None Include="Service References\Services\Reference.svcmap">
|
||||
<Generator>WCF Proxy Generator</Generator>
|
||||
<LastGenOutput>Reference.cs</LastGenOutput>
|
||||
</None>
|
||||
<Content Include="SplashScreenImage.jpg" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<WCFMetadata Include="Service References\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<WCFMetadataStorage Include="Service References\Services\" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildExtensionsPath)\Microsoft\Silverlight for Phone\$(TargetFrameworkVersion)\Microsoft.Silverlight.$(TargetFrameworkProfile).Overrides.targets" />
|
||||
<Import Project="$(MSBuildExtensionsPath)\Microsoft\Silverlight for Phone\$(TargetFrameworkVersion)\Microsoft.Silverlight.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
<ProjectExtensions />
|
||||
</Project>
|
||||
Reference in New Issue
Block a user