Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

moving repo

  • Loading branch information...
commit 0f4430f15f4c6bd5a2b3f47ef0c2079797d04486 1 parent 7e775ce
geremy authored
Showing with 2 additions and 12,842 deletions.
  1. BIN  silverlight/3.3.0.1/Libraries/ConcurrentHashtable_Silverlight.dll
  2. BIN  silverlight/3.3.0.1/Libraries/Microsoft.Silverlight.Testing.dll
  3. BIN  silverlight/3.3.0.1/Libraries/Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight.dll
  4. BIN  silverlight/3.3.0.1/Libraries/Newtonsoft.Json.dll
  5. +0 −30 silverlight/3.3.0.1/PubnubSilverlight.Example.sln
  6. BIN  silverlight/3.3.0.1/PubnubSilverlight.Example.suo
  7. +0 −14 silverlight/3.3.0.1/PubnubSilverlight.Example/App.xaml
  8. +0 −57 silverlight/3.3.0.1/PubnubSilverlight.Example/App.xaml.cs
  9. +0 −12 silverlight/3.3.0.1/PubnubSilverlight.Example/Bin/Debug/AppManifest.xaml
  10. BIN  silverlight/3.3.0.1/PubnubSilverlight.Example/Bin/Debug/PubnubSilverlight.Example.dll
  11. BIN  silverlight/3.3.0.1/PubnubSilverlight.Example/Bin/Debug/PubnubSilverlight.Example.pdb
  12. BIN  silverlight/3.3.0.1/PubnubSilverlight.Example/Bin/Debug/PubnubSilverlight.Example.xap
  13. BIN  silverlight/3.3.0.1/PubnubSilverlight.Example/Bin/Debug/System.Threading.Tasks.SL5.dll
  14. BIN  silverlight/3.3.0.1/PubnubSilverlight.Example/Bin/Debug/System.Threading.Tasks.SL5.pdb
  15. +0 −3,408 silverlight/3.3.0.1/PubnubSilverlight.Example/Core/Pubnub.cs
  16. +0 −18 silverlight/3.3.0.1/PubnubSilverlight.Example/Dialogs/PublishMessageDialog.xaml
  17. +0 −33 silverlight/3.3.0.1/PubnubSilverlight.Example/Dialogs/PublishMessageDialog.xaml.cs
  18. +0 −106 silverlight/3.3.0.1/PubnubSilverlight.Example/Imports/ArrayList.cs
  19. +0 −3,592 silverlight/3.3.0.1/PubnubSilverlight.Example/Imports/AtlasWeb.cs
  20. +0 −109 silverlight/3.3.0.1/PubnubSilverlight.Example/Imports/HttpEncoder.cs
  21. +0 −17 silverlight/3.3.0.1/PubnubSilverlight.Example/Imports/JavaScriptConverter.cs
  22. +0 −410 silverlight/3.3.0.1/PubnubSilverlight.Example/Imports/JavaScriptObjectDeserializer.cs
  23. +0 −550 silverlight/3.3.0.1/PubnubSilverlight.Example/Imports/JavaScriptSerializer.cs
  24. +0 −79 silverlight/3.3.0.1/PubnubSilverlight.Example/Imports/JavaScriptString.cs
  25. +0 −14 silverlight/3.3.0.1/PubnubSilverlight.Example/Imports/JavaScriptTypeResolver.cs
  26. +0 −472 silverlight/3.3.0.1/PubnubSilverlight.Example/Imports/ObjectConverter.cs
  27. +0 −9 silverlight/3.3.0.1/PubnubSilverlight.Example/Imports/ScriptIgnoreAttribute.cs
  28. +0 −40 silverlight/3.3.0.1/PubnubSilverlight.Example/Imports/Trace.cs
  29. +0 −56 silverlight/3.3.0.1/PubnubSilverlight.Example/MainView.xaml
  30. +0 −56 silverlight/3.3.0.1/PubnubSilverlight.Example/MainView.xaml.cs
  31. +0 −7 silverlight/3.3.0.1/PubnubSilverlight.Example/Properties/AppManifest.xml
  32. +0 −37 silverlight/3.3.0.1/PubnubSilverlight.Example/Properties/AssemblyInfo.cs
  33. +0 −191 silverlight/3.3.0.1/PubnubSilverlight.Example/PubnubSilverlight.Example.csproj
  34. +0 −32 silverlight/3.3.0.1/PubnubSilverlight.Example/PubnubSilverlight.Example.csproj.user
  35. +0 −25 silverlight/3.3.0.1/PubnubSilverlight.Example/Styles/ButtonStyle.xaml
  36. +0 −327 silverlight/3.3.0.1/PubnubSilverlight.Example/Styles/Styles.xaml
  37. +0 −527 silverlight/3.3.0.1/PubnubSilverlight.Example/UnitTest/EncryptionTests.cs
  38. +0 −28 silverlight/3.3.0.1/PubnubSilverlight.Example/UnitTest/Main.cs
  39. +0 −121 silverlight/3.3.0.1/PubnubSilverlight.Example/UnitTest/WhenAClientIsPresented.cs
  40. +0 −491 silverlight/3.3.0.1/PubnubSilverlight.Example/UnitTest/WhenAMessageIsPublished.cs
  41. +0 −193 silverlight/3.3.0.1/PubnubSilverlight.Example/UnitTest/WhenDetailedHistoryIsRequested.cs
  42. +0 −69 silverlight/3.3.0.1/PubnubSilverlight.Example/UnitTest/WhenGetRequestServerTime.cs
  43. +0 −66 silverlight/3.3.0.1/PubnubSilverlight.Example/UnitTest/WhenSubscribedToAChannel.cs
  44. +0 −91 silverlight/3.3.0.1/PubnubSilverlight.Example/Views/CodeExampleView.xaml
  45. +0 −263 silverlight/3.3.0.1/PubnubSilverlight.Example/Views/CodeExampleView.xaml.cs
  46. +0 −17 silverlight/3.3.0.1/PubnubSilverlight.Example/Views/CodeUnitTestView.xaml
  47. +0 −45 silverlight/3.3.0.1/PubnubSilverlight.Example/Views/CodeUnitTestView.xaml.cs
  48. +0 −34 silverlight/3.3.0.1/PubnubSilverlight.Example/Views/ErrorWindow.xaml
  49. +0 −38 silverlight/3.3.0.1/PubnubSilverlight.Example/Views/ErrorWindow.xaml.cs
  50. +0 −53 silverlight/3.3.0.1/PubnubSilverlight.Example/obj/Debug/App.g.cs
  51. +0 −53 silverlight/3.3.0.1/PubnubSilverlight.Example/obj/Debug/App.g.i.cs
  52. BIN  silverlight/3.3.0.1/PubnubSilverlight.Example/obj/Debug/DesignTimeResolveAssemblyReferences.cache
  53. BIN  silverlight/3.3.0.1/PubnubSilverlight.Example/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache
  54. +0 −65 silverlight/3.3.0.1/PubnubSilverlight.Example/obj/Debug/Dialogs/PublishMessageDialog.g.cs
  55. +0 −65 silverlight/3.3.0.1/PubnubSilverlight.Example/obj/Debug/Dialogs/PublishMessageDialog.g.i.cs
  56. +0 −89 silverlight/3.3.0.1/PubnubSilverlight.Example/obj/Debug/MainView.g.cs
  57. +0 −89 silverlight/3.3.0.1/PubnubSilverlight.Example/obj/Debug/MainView.g.i.cs
  58. +0 −313 silverlight/3.3.0.1/PubnubSilverlight.Example/obj/Debug/PubnubSilverlight.Example.csproj.FileListAbsolute.txt
  59. BIN  silverlight/3.3.0.1/PubnubSilverlight.Example/obj/Debug/PubnubSilverlight.Example.dll
  60. BIN  silverlight/3.3.0.1/PubnubSilverlight.Example/obj/Debug/PubnubSilverlight.Example.g.resources
  61. BIN  silverlight/3.3.0.1/PubnubSilverlight.Example/obj/Debug/PubnubSilverlight.Example.pdb
  62. +0 −59 silverlight/3.3.0.1/PubnubSilverlight.Example/obj/Debug/Views/CodeExampleView.g.cs
  63. +0 −59 silverlight/3.3.0.1/PubnubSilverlight.Example/obj/Debug/Views/CodeExampleView.g.i.cs
  64. +0 −59 silverlight/3.3.0.1/PubnubSilverlight.Example/obj/Debug/Views/CodeUnitTestView.g.cs
  65. +0 −59 silverlight/3.3.0.1/PubnubSilverlight.Example/obj/Debug/Views/CodeUnitTestView.g.i.cs
  66. +0 −71 silverlight/3.3.0.1/PubnubSilverlight.Example/obj/Debug/Views/ErrorWindow.g.cs
  67. +0 −71 silverlight/3.3.0.1/PubnubSilverlight.Example/obj/Debug/Views/ErrorWindow.g.i.cs
  68. +0 −11 silverlight/3.3.0.1/PubnubSilverlight.Example/obj/Debug/XapCacheFile.xml
  69. +0 −4 silverlight/3.3.0.1/PubnubSilverlight.Example/packages.config
  70. BIN  silverlight/3.3.0.1/packages/System.Threading.Tasks.3.0.2-beta2/System.Threading.Tasks.3.0.2-beta2.nupkg
  71. BIN  silverlight/3.3.0.1/packages/System.Threading.Tasks.3.0.2-beta2/lib/net35/System.Threading.Tasks.NET35.dll
  72. BIN  silverlight/3.3.0.1/packages/System.Threading.Tasks.3.0.2-beta2/lib/net35/System.Threading.Tasks.NET35.pdb
  73. BIN  silverlight/3.3.0.1/packages/System.Threading.Tasks.3.0.2-beta2/lib/sl3-wp/System.Threading.Tasks.WP7.dll
  74. BIN  silverlight/3.3.0.1/packages/System.Threading.Tasks.3.0.2-beta2/lib/sl3-wp/System.Threading.Tasks.WP7.pdb
  75. BIN  silverlight/3.3.0.1/packages/System.Threading.Tasks.3.0.2-beta2/lib/sl30/System.Threading.Tasks.SL3.dll
  76. BIN  silverlight/3.3.0.1/packages/System.Threading.Tasks.3.0.2-beta2/lib/sl30/System.Threading.Tasks.SL3.pdb
  77. BIN  silverlight/3.3.0.1/packages/System.Threading.Tasks.3.0.2-beta2/lib/sl4-wp71/System.Threading.Tasks.WP71.dll
  78. BIN  silverlight/3.3.0.1/packages/System.Threading.Tasks.3.0.2-beta2/lib/sl4-wp71/System.Threading.Tasks.WP71.pdb
  79. BIN  silverlight/3.3.0.1/packages/System.Threading.Tasks.3.0.2-beta2/lib/sl40/System.Threading.Tasks.SL4.dll
  80. BIN  silverlight/3.3.0.1/packages/System.Threading.Tasks.3.0.2-beta2/lib/sl40/System.Threading.Tasks.SL4.pdb
  81. BIN  silverlight/3.3.0.1/packages/System.Threading.Tasks.3.0.2-beta2/lib/sl50/System.Threading.Tasks.SL5.dll
  82. BIN  silverlight/3.3.0.1/packages/System.Threading.Tasks.3.0.2-beta2/lib/sl50/System.Threading.Tasks.SL5.pdb
  83. +0 −4 silverlight/3.3.0.1/packages/repositories.config
  84. +2 −34 silverlight/README.md
View
BIN  silverlight/3.3.0.1/Libraries/ConcurrentHashtable_Silverlight.dll
Binary file not shown
View
BIN  silverlight/3.3.0.1/Libraries/Microsoft.Silverlight.Testing.dll
Binary file not shown
View
BIN  ...erlight/3.3.0.1/Libraries/Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight.dll
Binary file not shown
View
BIN  silverlight/3.3.0.1/Libraries/Newtonsoft.Json.dll
Binary file not shown
View
30 silverlight/3.3.0.1/PubnubSilverlight.Example.sln
@@ -1,30 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 11.00
-# Visual Studio 2010
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PubnubSilverlight.Example", "PubnubSilverlight.Example\PubnubSilverlight.Example.csproj", "{FC8C4396-43E2-4C43-AA56-7F0A54F6F1DB}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Any CPU = Debug|Any CPU
- Debug|Mixed Platforms = Debug|Mixed Platforms
- Debug|x86 = Debug|x86
- Release|Any CPU = Release|Any CPU
- Release|Mixed Platforms = Release|Mixed Platforms
- Release|x86 = Release|x86
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {FC8C4396-43E2-4C43-AA56-7F0A54F6F1DB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {FC8C4396-43E2-4C43-AA56-7F0A54F6F1DB}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {FC8C4396-43E2-4C43-AA56-7F0A54F6F1DB}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
- {FC8C4396-43E2-4C43-AA56-7F0A54F6F1DB}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
- {FC8C4396-43E2-4C43-AA56-7F0A54F6F1DB}.Debug|x86.ActiveCfg = Debug|Any CPU
- {FC8C4396-43E2-4C43-AA56-7F0A54F6F1DB}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {FC8C4396-43E2-4C43-AA56-7F0A54F6F1DB}.Release|Any CPU.Build.0 = Release|Any CPU
- {FC8C4396-43E2-4C43-AA56-7F0A54F6F1DB}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
- {FC8C4396-43E2-4C43-AA56-7F0A54F6F1DB}.Release|Mixed Platforms.Build.0 = Release|Any CPU
- {FC8C4396-43E2-4C43-AA56-7F0A54F6F1DB}.Release|x86.ActiveCfg = Release|Any CPU
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
-EndGlobal
View
BIN  silverlight/3.3.0.1/PubnubSilverlight.Example.suo
Binary file not shown
View
14 silverlight/3.3.0.1/PubnubSilverlight.Example/App.xaml
@@ -1,14 +0,0 @@
-<Application xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- x:Class="PubNub_Messaging.App">
- <Application.Resources>
- <ResourceDictionary>
- <ResourceDictionary.MergedDictionaries>
-
- <ResourceDictionary Source="/PubnubSilverlight.Example;component/Styles/ButtonStyle.xaml"/>
- <ResourceDictionary Source="/PubnubSilverlight.Example;component/Styles/Styles.xaml"/>
-
- </ResourceDictionary.MergedDictionaries>
- </ResourceDictionary>
- </Application.Resources>
-</Application>
View
57 silverlight/3.3.0.1/PubnubSilverlight.Example/App.xaml.cs
@@ -1,57 +0,0 @@
-using System;
-using System.Windows;
-
-namespace PubNub_Messaging
-{
- public partial class App : Application
- {
-
- public App()
- {
- this.Startup += this.Application_Startup;
- this.Exit += this.Application_Exit;
- this.UnhandledException += this.Application_UnhandledException;
-
- InitializeComponent();
- }
-
- private void Application_Startup(object sender, StartupEventArgs e)
- {
- RootVisual = new MainView();
- }
-
- private void Application_Exit(object sender, EventArgs e)
- {
-
- }
- private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e)
- {
- // If the app is running outside of the debugger then report the exception using
- // the browser's exception mechanism. On IE this will display it a yellow alert
- // icon in the status bar and Firefox will display a script error.
- if (!System.Diagnostics.Debugger.IsAttached)
- {
-
- // NOTE: This will allow the application to continue running after an exception has been thrown
- // but not handled.
- // For production applications this error handling should be replaced with something that will
- // report the error to the website and stop the application.
- e.Handled = true;
- Deployment.Current.Dispatcher.BeginInvoke(delegate { ReportErrorToDOM(e); });
- }
- }
- private void ReportErrorToDOM(ApplicationUnhandledExceptionEventArgs e)
- {
- try
- {
- string errorMsg = e.ExceptionObject.Message + e.ExceptionObject.StackTrace;
- errorMsg = errorMsg.Replace('"', '\'').Replace("\r\n", @"\n");
-
- System.Windows.Browser.HtmlPage.Window.Eval("throw new Error(\"Unhandled Error in Silverlight Application " + errorMsg + "\");");
- }
- catch (Exception)
- {
- }
- }
- }
-}
View
12 silverlight/3.3.0.1/PubnubSilverlight.Example/Bin/Debug/AppManifest.xaml
@@ -1,12 +0,0 @@
-<Deployment xmlns="http://schemas.microsoft.com/client/2007/deployment" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" EntryPointAssembly="PubnubSilverlight.Example" EntryPointType="PubNub_Messaging.App" RuntimeVersion="5.0.61118.0">
- <Deployment.Parts>
- <AssemblyPart x:Name="PubnubSilverlight.Example" Source="PubnubSilverlight.Example.dll" />
- <AssemblyPart x:Name="ConcurrentHashtable_Silverlight" Source="ConcurrentHashtable_Silverlight.dll" />
- <AssemblyPart x:Name="Microsoft.Silverlight.Testing" Source="Microsoft.Silverlight.Testing.dll" />
- <AssemblyPart x:Name="Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight" Source="Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight.dll" />
- <AssemblyPart x:Name="Newtonsoft.Json" Source="Newtonsoft.Json.dll" />
- <AssemblyPart x:Name="System.Threading.Tasks.SL5" Source="System.Threading.Tasks.SL5.dll" />
- <AssemblyPart x:Name="System.Windows.Controls" Source="System.Windows.Controls.dll" />
- <AssemblyPart x:Name="System.Windows.Controls.Navigation" Source="System.Windows.Controls.Navigation.dll" />
- </Deployment.Parts>
-</Deployment>
View
BIN  silverlight/3.3.0.1/PubnubSilverlight.Example/Bin/Debug/PubnubSilverlight.Example.dll
Binary file not shown
View
BIN  silverlight/3.3.0.1/PubnubSilverlight.Example/Bin/Debug/PubnubSilverlight.Example.pdb
Binary file not shown
View
BIN  silverlight/3.3.0.1/PubnubSilverlight.Example/Bin/Debug/PubnubSilverlight.Example.xap
Binary file not shown
View
BIN  silverlight/3.3.0.1/PubnubSilverlight.Example/Bin/Debug/System.Threading.Tasks.SL5.dll
Binary file not shown
View
BIN  silverlight/3.3.0.1/PubnubSilverlight.Example/Bin/Debug/System.Threading.Tasks.SL5.pdb
Binary file not shown
View
3,408 silverlight/3.3.0.1/PubnubSilverlight.Example/Core/Pubnub.cs
0 additions, 3,408 deletions not shown
View
18 silverlight/3.3.0.1/PubnubSilverlight.Example/Dialogs/PublishMessageDialog.xaml
@@ -1,18 +0,0 @@
-<controls:ChildWindow x:Class="PubNub_Messaging.PublishMessageDialog"
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
- Width="400" Height="200"
- Title="Message">
- <Grid x:Name="LayoutRoot" Margin="2">
- <Grid.RowDefinitions>
- <RowDefinition />
- <RowDefinition Height="Auto" />
- </Grid.RowDefinitions>
-
- <TextBox x:Name="Message"/>
-
- <Button x:Name="CancelButton" Content="Cancel" Click="CancelButton_Click" Width="75" Height="23" HorizontalAlignment="Right" Margin="0,12,0,0" Grid.Row="1" />
- <Button x:Name="OKButton" Content="OK" Click="OKButton_Click" Width="75" Height="23" HorizontalAlignment="Right" Margin="0,12,79,0" Grid.Row="1" />
- </Grid>
-</controls:ChildWindow>
View
33 silverlight/3.3.0.1/PubnubSilverlight.Example/Dialogs/PublishMessageDialog.xaml.cs
@@ -1,33 +0,0 @@
-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 PubNub_Messaging
-{
- public partial class PublishMessageDialog : ChildWindow
- {
- public PublishMessageDialog()
- {
- InitializeComponent();
- }
-
- private void OKButton_Click(object sender, RoutedEventArgs e)
- {
- this.DialogResult = true;
- }
-
- private void CancelButton_Click(object sender, RoutedEventArgs e)
- {
- this.DialogResult = false;
- }
- }
-}
-
View
106 silverlight/3.3.0.1/PubnubSilverlight.Example/Imports/ArrayList.cs
@@ -1,106 +0,0 @@
-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;
-
-namespace PubnubSilverlight.Imports
-{
- // public class ArrayList: IList
- // {
- // private object[] array = null;
-
- // public ArrayList()
- // {
- //array = object[]();
- // }
-
- // public int Add(object value)
- // {
- // throw new NotImplementedException();
- // }
-
- // public void Clear()
- // {
- // throw new NotImplementedException();
- // }
-
- // public bool Contains(object value)
- // {
- // throw new NotImplementedException();
- // }
-
- // public int IndexOf(object value)
- // {
- // throw new NotImplementedException();
- // }
-
- // public void Insert(int index, object value)
- // {
- // throw new NotImplementedException();
- // }
-
- // public bool IsFixedSize
- // {
- // get { throw new NotImplementedException(); }
- // }
-
- // public bool IsReadOnly
- // {
- // get { throw new NotImplementedException(); }
- // }
-
- // public void Remove(object value)
- // {
- // throw new NotImplementedException();
- // }
-
- // public void RemoveAt(int index)
- // {
- // throw new NotImplementedException();
- // }
-
- // public object this[int index]
- // {
- // get
- // {
- // throw new NotImplementedException();
- // }
- // set
- // {
- // throw new NotImplementedException();
- // }
- // }
-
- // public void CopyTo(Array array, int index)
- // {
- // throw new NotImplementedException();
- // }
-
- // public int Count
- // {
- // get { throw new NotImplementedException(); }
- // }
-
- // public bool IsSynchronized
- // {
- // get { throw new NotImplementedException(); }
- // }
-
- // public object SyncRoot
- // {
- // get { throw new NotImplementedException(); }
- // }
-
- // public IEnumerator GetEnumerator()
- // {
- // throw new NotImplementedException();
- // }
- // }
-}
View
3,592 silverlight/3.3.0.1/PubnubSilverlight.Example/Imports/AtlasWeb.cs
0 additions, 3,592 deletions not shown
View
109 silverlight/3.3.0.1/PubnubSilverlight.Example/Imports/HttpEncoder.cs
@@ -1,109 +0,0 @@
-namespace System.Web.Util
-{
- using System;
- using System.Globalization;
- using System.IO;
- using System.Net;
- using System.Runtime.InteropServices;
- using System.Text;
- using System.Web;
-
- public class HttpEncoder
- {
- internal static string JavaScriptStringEncode(string value)
- {
- if (string.IsNullOrEmpty(value))
- {
- return string.Empty;
- }
- StringBuilder builder = null;
- int startIndex = 0;
- int count = 0;
- for (int i = 0; i < value.Length; i++)
- {
- char c = value[i];
- if ((((c == '\r') || (c == '\t')) || ((c == '"') || (c == '\''))) || ((((c == '<') || (c == '>')) || ((c == '\\') || (c == '\n'))) || (((c == '\b') || (c == '\f')) || (c < ' '))))
- {
- if (builder == null)
- {
- builder = new StringBuilder(value.Length + 5);
- }
- if (count > 0)
- {
- builder.Append(value, startIndex, count);
- }
- startIndex = i + 1;
- count = 0;
- }
- switch (c)
- {
- case '<':
- case '>':
- case '\'':
- {
- AppendCharAsUnicodeJavaScript(builder, c);
- continue;
- }
- case '\\':
- {
- builder.Append(@"\\");
- continue;
- }
- case '\b':
- {
- builder.Append(@"\b");
- continue;
- }
- case '\t':
- {
- builder.Append(@"\t");
- continue;
- }
- case '\n':
- {
- builder.Append(@"\n");
- continue;
- }
- case '\f':
- {
- builder.Append(@"\f");
- continue;
- }
- case '\r':
- {
- builder.Append(@"\r");
- continue;
- }
- case '"':
- {
- builder.Append("\\\"");
- continue;
- }
- }
- if (c < ' ')
- {
- AppendCharAsUnicodeJavaScript(builder, c);
- }
- else
- {
- count++;
- }
- }
- if (builder == null)
- {
- return value;
- }
- if (count > 0)
- {
- builder.Append(value, startIndex, count);
- }
- return builder.ToString();
- }
-
- private static void AppendCharAsUnicodeJavaScript(StringBuilder builder, char c)
- {
- builder.Append(@"\u");
- builder.Append(((int)c).ToString("x4", CultureInfo.InvariantCulture));
- }
- }
-}
View
17 silverlight/3.3.0.1/PubnubSilverlight.Example/Imports/JavaScriptConverter.cs
@@ -1,17 +0,0 @@
-namespace System.Web.Script.Serialization
-{
- using System;
- using System.Collections.Generic;
-
- public abstract class JavaScriptConverter
- {
- protected JavaScriptConverter()
- {
- }
-
- public abstract object Deserialize(IDictionary<string, object> dictionary, Type type, JavaScriptSerializer serializer);
- public abstract IDictionary<string, object> Serialize(object obj, JavaScriptSerializer serializer);
-
- public abstract IEnumerable<Type> SupportedTypes { get; }
- }
-}
View
410 silverlight/3.3.0.1/PubnubSilverlight.Example/Imports/JavaScriptObjectDeserializer.cs
@@ -1,410 +0,0 @@
-namespace System.Web.Script.Serialization
-{
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using System.Globalization;
- using System.Text;
- using System.Text.RegularExpressions;
- using System.Web.Resources;
-
- internal class JavaScriptObjectDeserializer
- {
- private int _depthLimit;
- internal JavaScriptString _s;
- private JavaScriptSerializer _serializer;
- private const string DateTimePrefix = "\"\\/Date(";
- private const int DateTimePrefixLength = 8;
-
- private JavaScriptObjectDeserializer(string input, int depthLimit, JavaScriptSerializer serializer)
- {
- this._s = new JavaScriptString(input);
- this._depthLimit = depthLimit;
- this._serializer = serializer;
- }
-
- private void AppendCharToBuilder(char? c, StringBuilder sb)
- {
- if (((c == '"') || (c == '\'')) || (c == '/'))
- {
- sb.Append(c);
- }
- else if (c == 'b')
- {
- sb.Append('\b');
- }
- else if (c == 'f')
- {
- sb.Append('\f');
- }
- else if (c == 'n')
- {
- sb.Append('\n');
- }
- else if (c == 'r')
- {
- sb.Append('\r');
- }
- else if (c == 't')
- {
- sb.Append('\t');
- }
- else
- {
- if (c != 'u')
- {
- throw new ArgumentException(this._s.GetDebugString(AtlasWeb.JSON_BadEscape));
- }
- sb.Append((char)int.Parse(this._s.MoveNext(4), NumberStyles.HexNumber, CultureInfo.InvariantCulture));
- }
- }
-
- internal static object BasicDeserialize(string input, int depthLimit, JavaScriptSerializer serializer)
- {
- JavaScriptObjectDeserializer deserializer = new JavaScriptObjectDeserializer(input, depthLimit, serializer);
- object obj2 = deserializer.DeserializeInternal(0);
- char? nextNonEmptyChar = deserializer._s.GetNextNonEmptyChar();
- int? nullable3 = nextNonEmptyChar.HasValue ? new int?(nextNonEmptyChar.GetValueOrDefault()) : null;
- if (nullable3.HasValue)
- {
- throw new ArgumentException(string.Format(CultureInfo.InvariantCulture, AtlasWeb.JSON_IllegalPrimitive, new object[] { deserializer._s.ToString() }));
- }
- return obj2;
- }
-
- private char CheckQuoteChar(char? c)
- {
- if (c == '\'')
- {
- return c.Value;
- }
- if (c != '"')
- {
- throw new ArgumentException(this._s.GetDebugString(AtlasWeb.JSON_StringNotQuoted));
- }
- return '"';
- }
-
- private IDictionary<string, object> DeserializeDictionary(int depth)
- {
- IDictionary<string, object> dictionary = null;
- char? nextNonEmptyChar;
- char? nullable8;
- char? nullable11;
- if (this._s.MoveNext() != '{')
- {
- throw new ArgumentException(this._s.GetDebugString(AtlasWeb.JSON_ExpectedOpenBrace));
- }
- Label_0199:
- nullable8 = nextNonEmptyChar = this._s.GetNextNonEmptyChar();
- int? nullable10 = nullable8.HasValue ? new int?(nullable8.GetValueOrDefault()) : null;
- if (nullable10.HasValue)
- {
- this._s.MovePrev();
- if (nextNonEmptyChar == ':')
- {
- throw new ArgumentException(this._s.GetDebugString(AtlasWeb.JSON_InvalidMemberName));
- }
- string str = null;
- if (nextNonEmptyChar != '}')
- {
- str = this.DeserializeMemberName();
- if (string.IsNullOrEmpty(str))
- {
- throw new ArgumentException(this._s.GetDebugString(AtlasWeb.JSON_InvalidMemberName));
- }
- if (this._s.GetNextNonEmptyChar() != ':')
- {
- //throw new ArgumentException(this._s.GetDebugString(AtlasWeb.JSON_InvalidObject));
- }
- }
- if (dictionary == null)
- {
- dictionary = new Dictionary<string, object>();
- if (string.IsNullOrEmpty(str))
- {
- nextNonEmptyChar = this._s.GetNextNonEmptyChar();
- goto Label_01D7;
- }
- }
- this.ThrowIfMaxJsonDeserializerMembersExceeded(dictionary.Count);
- object obj2 = this.DeserializeInternal(depth);
- dictionary[str] = obj2;
- nextNonEmptyChar = this._s.GetNextNonEmptyChar();
- if (nextNonEmptyChar != '}')
- {
- //if (nextNonEmptyChar != ',')
- //{
- //throw new ArgumentException(this._s.GetDebugString(AtlasWeb.JSON_InvalidObject));
- //}
- goto Label_0199;
- }
- }
- Label_01D7:
- nullable11 = nextNonEmptyChar;
- if ((nullable11.GetValueOrDefault() != '}') || !nullable11.HasValue)
- {
- throw new ArgumentException(this._s.GetDebugString(AtlasWeb.JSON_InvalidObject));
- }
- return dictionary;
- }
-
- private object DeserializeInternal(int depth)
- {
- if (++depth > this._depthLimit)
- {
- throw new ArgumentException(this._s.GetDebugString(AtlasWeb.JSON_DepthLimitExceeded));
- }
- char? nextNonEmptyChar = this._s.GetNextNonEmptyChar();
- char? nullable2 = nextNonEmptyChar;
- int? nullable4 = nullable2.HasValue ? new int?(nullable2.GetValueOrDefault()) : null;
- if (!nullable4.HasValue)
- {
- return null;
- }
- this._s.MovePrev();
- if (this.IsNextElementDateTime())
- {
- return this.DeserializeStringIntoDateTime();
- }
- if (IsNextElementObject(nextNonEmptyChar))
- {
- IDictionary<string, object> o = this.DeserializeDictionary(depth);
- if (o.ContainsKey("__type"))
- {
- return ObjectConverter.ConvertObjectToType(o, null, this._serializer);
- }
- return o;
- }
- if (IsNextElementArray(nextNonEmptyChar))
- {
- return this.DeserializeList(depth);
- }
- if (IsNextElementString(nextNonEmptyChar))
- {
- return this.DeserializeString();
- }
- return this.DeserializePrimitiveObject();
- }
-
- private IList DeserializeList(int depth)
- {
- char? nextNonEmptyChar;
- char? nullable5;
- IList list = new List<object>();
- if (this._s.MoveNext() != '[')
- {
- throw new ArgumentException(this._s.GetDebugString(AtlasWeb.JSON_InvalidArrayStart));
- }
- bool flag = false;
- Label_00C4:
- nullable5 = nextNonEmptyChar = this._s.GetNextNonEmptyChar();
- int? nullable7 = nullable5.HasValue ? new int?(nullable5.GetValueOrDefault()) : null;
- if (nullable7.HasValue && (nextNonEmptyChar != ']'))
- {
- this._s.MovePrev();
- object obj2 = this.DeserializeInternal(depth);
- list.Add(obj2);
- flag = false;
- nextNonEmptyChar = this._s.GetNextNonEmptyChar();
- if (nextNonEmptyChar != ']')
- {
- flag = true;
- if (nextNonEmptyChar != ',')
- {
- throw new ArgumentException(this._s.GetDebugString(AtlasWeb.JSON_InvalidArrayExpectComma));
- }
- goto Label_00C4;
- }
- }
- if (flag)
- {
- throw new ArgumentException(this._s.GetDebugString(AtlasWeb.JSON_InvalidArrayExtraComma));
- }
- if (nextNonEmptyChar != ']')
- {
- throw new ArgumentException(this._s.GetDebugString(AtlasWeb.JSON_InvalidArrayEnd));
- }
- return list;
- }
-
- private string DeserializeMemberName()
- {
- char? nextNonEmptyChar = this._s.GetNextNonEmptyChar();
- char? nullable2 = nextNonEmptyChar;
- int? nullable4 = nullable2.HasValue ? new int?(nullable2.GetValueOrDefault()) : null;
- if (!nullable4.HasValue)
- {
- return null;
- }
- this._s.MovePrev();
- if (IsNextElementString(nextNonEmptyChar))
- {
- return this.DeserializeString();
- }
- return this.DeserializePrimitiveToken();
- }
-
- private object DeserializePrimitiveObject()
- {
- double num4;
- string s = this.DeserializePrimitiveToken();
- if (s.Equals("null"))
- {
- return null;
- }
- if (s.Equals("true"))
- {
- return true;
- }
- if (s.Equals("false"))
- {
- return false;
- }
- bool flag = s.IndexOf('.') >= 0;
- if (s.LastIndexOf("e", StringComparison.OrdinalIgnoreCase) < 0)
- {
- decimal num3;
- if (!flag)
- {
- int num;
- long num2;
- if (int.TryParse(s, NumberStyles.Integer, CultureInfo.InvariantCulture, out num))
- {
- return num;
- }
- if (long.TryParse(s, NumberStyles.Integer, CultureInfo.InvariantCulture, out num2))
- {
- return num2;
- }
- }
- if (decimal.TryParse(s, NumberStyles.Number, CultureInfo.InvariantCulture, out num3))
- {
- return num3;
- }
- }
- if (!double.TryParse(s, NumberStyles.Float, CultureInfo.InvariantCulture, out num4))
- {
- throw new ArgumentException(string.Format(CultureInfo.InvariantCulture, AtlasWeb.JSON_IllegalPrimitive, new object[] { s }));
- }
- return num4;
- }
-
- private string DeserializePrimitiveToken()
- {
- char? nullable2;
- StringBuilder builder = new StringBuilder();
- char? nullable = null;
- Label_0066:
- nullable2 = nullable = this._s.MoveNext();
- int? nullable4 = nullable2.HasValue ? new int?(nullable2.GetValueOrDefault()) : null;
- if (nullable4.HasValue)
- {
- if ((char.IsLetterOrDigit(nullable.Value) || (nullable.Value == '.')) || (((nullable.Value == '-') || (nullable.Value == '_')) || (nullable.Value == '+')))
- {
- builder.Append(nullable);
- }
- else
- {
- this._s.MovePrev();
- goto Label_00A2;
- }
- goto Label_0066;
- }
- Label_00A2:
- return builder.ToString();
- }
-
- private string DeserializeString()
- {
- StringBuilder sb = new StringBuilder();
- bool flag = false;
- char? c = this._s.MoveNext();
- char ch = this.CheckQuoteChar(c);
- while (true)
- {
- char? nullable4 = c = this._s.MoveNext();
- int? nullable6 = nullable4.HasValue ? new int?(nullable4.GetValueOrDefault()) : null;
- if (!nullable6.HasValue)
- {
- throw new ArgumentException(this._s.GetDebugString(AtlasWeb.JSON_UnterminatedString));
- }
- if (c == '\\')
- {
- if (flag)
- {
- sb.Append('\\');
- flag = false;
- }
- else
- {
- flag = true;
- }
- }
- else if (flag)
- {
- this.AppendCharToBuilder(c, sb);
- flag = false;
- }
- else
- {
- char? nullable3 = c;
- int num = ch;
- if ((nullable3.GetValueOrDefault() == num) && nullable3.HasValue)
- {
- return sb.ToString();
- }
- sb.Append(c);
- }
- }
- }
-
- private object DeserializeStringIntoDateTime()
- {
- long num;
- Match match = Regex.Match(this._s.ToString(), "^\"\\\\/Date\\((?<ticks>-?[0-9]+)(?:[a-zA-Z]|(?:\\+|-)[0-9]{4})?\\)\\\\/\"");
- if (long.TryParse(match.Groups["ticks"].Value, out num))
- {
- this._s.MoveNext(match.Length);
- return new DateTime((num * 0x2710L) + JavaScriptSerializer.DatetimeMinTimeTicks, DateTimeKind.Utc);
- }
- return this.DeserializeString();
- }
-
- private static bool IsNextElementArray(char? c)
- {
- return (c == '[');
- }
-
- private bool IsNextElementDateTime()
- {
- string a = this._s.MoveNext(8);
- if (a != null)
- {
- this._s.MovePrev(8);
- return string.Equals(a, "\"\\/Date(", StringComparison.Ordinal);
- }
- return false;
- }
-
- private static bool IsNextElementObject(char? c)
- {
- return (c == '{');
- }
-
- private static bool IsNextElementString(char? c)
- {
- return ((c == '"') || (c == '\''));
- }
-
- private static int MaxJsonDeserializerMembers = 0x3e8;
-
- private void ThrowIfMaxJsonDeserializerMembersExceeded(int count)
- {
- if (count >= MaxJsonDeserializerMembers)
- {
- throw new InvalidOperationException();
- }
- }
- }
-}
View
550 silverlight/3.3.0.1/PubnubSilverlight.Example/Imports/JavaScriptSerializer.cs
@@ -1,550 +0,0 @@
-namespace System.Web.Script.Serialization
-{
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using System.Globalization;
- using System.Reflection;
- using System.Runtime.CompilerServices;
- using System.Runtime.InteropServices;
- using System.Text;
- using System.Web;
- using System.Web.Resources;
- using System.Web.Util;
-
- public class Hashtable : Dictionary<object, object>
- { }
-
- public class JavaScriptSerializer
- {
- private Dictionary<Type, JavaScriptConverter> _converters;
- private int _maxJsonLength;
- private int _recursionLimit;
- private JavaScriptTypeResolver _typeResolver;
- internal static readonly long DatetimeMinTimeTicks;
- internal const int DefaultMaxJsonLength = 0x200000;
- internal const int DefaultRecursionLimit = 100;
- internal const string ServerTypeFieldName = "__type";
-
- static JavaScriptSerializer()
- {
- DateTime time = new DateTime(0x7b2, 1, 1, 0, 0, 0, DateTimeKind.Utc);
- DatetimeMinTimeTicks = time.Ticks;
- }
-
- public JavaScriptSerializer() : this(null)
- {
- }
-
- public JavaScriptSerializer(JavaScriptTypeResolver resolver)
- {
- this._typeResolver = resolver;
- this.RecursionLimit = 100;
- this.MaxJsonLength = 0x200000;
- }
-
- internal bool ConverterExistsForType(Type t, out JavaScriptConverter converter)
- {
- converter = this.GetConverter(t);
- return (converter != null);
- }
-
- public T ConvertToType<T>(object obj)
- {
- return (T)ObjectConverter.ConvertObjectToType(obj, typeof(T), this);
- }
-
- public object ConvertToType(object obj, Type targetType)
- {
- return ObjectConverter.ConvertObjectToType(obj, targetType, this);
- }
-
- public T Deserialize<T>(string input)
- {
- return (T)Deserialize(this, input, typeof(T), this.RecursionLimit);
- }
-
- public object Deserialize(string input, Type targetType)
- {
- return Deserialize(this, input, targetType, this.RecursionLimit);
- }
-
- internal static object Deserialize(JavaScriptSerializer serializer, string input, Type type, int depthLimit)
- {
- if (input == null)
- {
- throw new ArgumentNullException("input");
- }
- if (input.Length > serializer.MaxJsonLength)
- {
- throw new ArgumentException(AtlasWeb.JSON_MaxJsonLengthExceeded, "input");
- }
- return ObjectConverter.ConvertObjectToType(JavaScriptObjectDeserializer.BasicDeserialize(input, depthLimit, serializer), type, serializer);
- }
-
- public object DeserializeObject(string input)
- {
- return Deserialize(this, input, null, this.RecursionLimit);
- }
-
- private JavaScriptConverter GetConverter(Type t)
- {
- if (this._converters != null)
- {
- while (t != null)
- {
- if (this._converters.ContainsKey(t))
- {
- return this._converters[t];
- }
- t = t.BaseType;
- }
- }
- return null;
- }
-
- public void RegisterConverters(IEnumerable<JavaScriptConverter> converters)
- {
- if (converters == null)
- {
- throw new ArgumentNullException("converters");
- }
- foreach (JavaScriptConverter converter in converters)
- {
- IEnumerable<Type> supportedTypes = converter.SupportedTypes;
- if (supportedTypes != null)
- {
- foreach (Type type in supportedTypes)
- {
- this.Converters[type] = converter;
- }
- }
- }
- }
-
- public string Serialize(object obj)
- {
- return this.Serialize(obj, SerializationFormat.JSON);
- }
-
- public void Serialize(object obj, StringBuilder output)
- {
- this.Serialize(obj, output, SerializationFormat.JSON);
- }
-
- internal string Serialize(object obj, SerializationFormat serializationFormat)
- {
- StringBuilder output = new StringBuilder();
- this.Serialize(obj, output, serializationFormat);
- return output.ToString();
- }
-
- internal void Serialize(object obj, StringBuilder output, SerializationFormat serializationFormat)
- {
- this.SerializeValue(obj, output, 0, null, serializationFormat);
- if ((serializationFormat == SerializationFormat.JSON) && (output.Length > this.MaxJsonLength))
- {
- throw new InvalidOperationException(AtlasWeb.JSON_MaxJsonLengthExceeded);
- }
- }
-
- private static void SerializeBoolean(bool o, StringBuilder sb)
- {
- if (o)
- {
- sb.Append("true");
- }
- else
- {
- sb.Append("false");
- }
- }
-
- private void SerializeCustomObject(object o, StringBuilder sb, int depth, Hashtable objectsInUse, SerializationFormat serializationFormat)
- {
- bool flag = true;
- Type type = o.GetType();
- sb.Append('{');
- if (this.TypeResolver != null)
- {
- string str = this.TypeResolver.ResolveTypeId(type);
- if (str != null)
- {
- SerializeString("__type", sb);
- sb.Append(':');
- this.SerializeValue(str, sb, depth, objectsInUse, serializationFormat);
- flag = false;
- }
- }
- foreach (FieldInfo info in type.GetFields(BindingFlags.Public | BindingFlags.Instance))
- {
- if (!info.IsDefined(typeof(ScriptIgnoreAttribute), true))
- {
- if (!flag)
- {
- sb.Append(',');
- }
- SerializeString(info.Name, sb);
- sb.Append(':');
- //System.Web.SecurityUtils.FieldInfoGetValue(info, o)
- this.SerializeValue(info.GetValue(o), sb, depth, objectsInUse, serializationFormat);
- flag = false;
- }
- }
- foreach (PropertyInfo info2 in type.GetProperties(BindingFlags.GetProperty | BindingFlags.Public | BindingFlags.Instance))
- {
- if (!info2.IsDefined(typeof(ScriptIgnoreAttribute), true))
- {
- MethodInfo getMethod = info2.GetGetMethod();
- if ((getMethod != null) && (getMethod.GetParameters().Length <= 0))
- {
- if (!flag)
- {
- sb.Append(',');
- }
- SerializeString(info2.Name, sb);
- sb.Append(':');
- //System.Web.SecurityUtils.MethodInfoInvoke(getMethod, o, null)
- this.SerializeValue(getMethod.Invoke(o, null), sb, depth, objectsInUse, serializationFormat);
- flag = false;
- }
- }
- }
- sb.Append('}');
- }
-
- private static void SerializeDateTime(DateTime datetime, StringBuilder sb, SerializationFormat serializationFormat)
- {
- if (serializationFormat == SerializationFormat.JSON)
- {
- sb.Append("\"\\/Date(");
- sb.Append((long)((datetime.ToUniversalTime().Ticks - DatetimeMinTimeTicks) / 0x2710L));
- sb.Append(")\\/\"");
- }
- else
- {
- sb.Append("new Date(");
- sb.Append((long)((datetime.ToUniversalTime().Ticks - DatetimeMinTimeTicks) / 0x2710L));
- sb.Append(")");
- }
- }
-
- private void SerializeDictionary(IDictionary o, StringBuilder sb, int depth, Hashtable objectsInUse, SerializationFormat serializationFormat)
- {
- sb.Append('{');
- bool flag = true;
- bool flag2 = false;
- if (o.Contains("__type"))
- {
- flag = false;
- flag2 = true;
- this.SerializeDictionaryKeyValue("__type", o["__type"], sb, depth, objectsInUse, serializationFormat);
- }
- foreach (DictionaryEntry entry in o)
- {
- string key = entry.Key as string;
- if (key == null)
- {
- throw new ArgumentException(string.Format(CultureInfo.InvariantCulture, AtlasWeb.JSON_DictionaryTypeNotSupported, new object[] { o.GetType().FullName }));
- }
- if (flag2 && string.Equals(key, "__type", StringComparison.Ordinal))
- {
- flag2 = false;
- }
- else
- {
- if (!flag)
- {
- sb.Append(',');
- }
- this.SerializeDictionaryKeyValue(key, entry.Value, sb, depth, objectsInUse, serializationFormat);
- flag = false;
- }
- }
- sb.Append('}');
- }
-
- private void SerializeDictionaryKeyValue(string key, object value, StringBuilder sb, int depth, Hashtable objectsInUse, SerializationFormat serializationFormat)
- {
- SerializeString(key, sb);
- sb.Append(':');
- this.SerializeValue(value, sb, depth, objectsInUse, serializationFormat);
- }
-
- private void SerializeEnumerable(IEnumerable enumerable, StringBuilder sb, int depth, Hashtable objectsInUse, SerializationFormat serializationFormat)
- {
- sb.Append('[');
- bool flag = true;
- foreach (object obj2 in enumerable)
- {
- if (!flag)
- {
- sb.Append(',');
- }
- this.SerializeValue(obj2, sb, depth, objectsInUse, serializationFormat);
- flag = false;
- }
- sb.Append(']');
- }
-
- private static void SerializeGuid(Guid guid, StringBuilder sb)
- {
- sb.Append("\"").Append(guid.ToString()).Append("\"");
- }
-
- internal static string SerializeInternal(object o)
- {
- JavaScriptSerializer serializer = new JavaScriptSerializer();
- return serializer.Serialize(o);
- }
-
- private static void SerializeString(string input, StringBuilder sb)
- {
- sb.Append('"');
- sb.Append(JavaScriptStringEncode(input));
- sb.Append('"');
- }
-
- public static string JavaScriptStringEncode(string value)
- {
- return JavaScriptStringEncode(value, false);
- }
-
- public static string JavaScriptStringEncode(string value, bool addDoubleQuotes)
- {
- string str = HttpEncoder.JavaScriptStringEncode(value);
- if (!addDoubleQuotes)
- {
- return str;
- }
- return ("\"" + str + "\"");
- }
-
- private static void SerializeUri(Uri uri, StringBuilder sb)
- {
- sb.Append("\"").Append(uri.GetComponents(UriComponents.SerializationInfoString, UriFormat.UriEscaped)).Append("\"");
- }
-
- private void SerializeValue(object o, StringBuilder sb, int depth, Hashtable objectsInUse, SerializationFormat serializationFormat)
- {
- if (++depth > this._recursionLimit)
- {
- throw new ArgumentException(AtlasWeb.JSON_DepthLimitExceeded);
- }
- JavaScriptConverter converter = null;
- if ((o != null) && this.ConverterExistsForType(o.GetType(), out converter))
- {
- IDictionary<string, object> dictionary = converter.Serialize(o, this);
- if (this.TypeResolver != null)
- {
- string str = this.TypeResolver.ResolveTypeId(o.GetType());
- if (str != null)
- {
- dictionary["__type"] = str;
- }
- }
- sb.Append(this.Serialize(dictionary, serializationFormat));
- }
- else
- {
- this.SerializeValueInternal(o, sb, depth, objectsInUse, serializationFormat);
- }
- }
-
- private void SerializeValueInternal(object o, StringBuilder sb, int depth, Hashtable objectsInUse, SerializationFormat serializationFormat)
- {
- if ((o == null) || DBNull.Value.Equals(o))
- {
- sb.Append("null");
- }
- else
- {
- string input = o as string;
- if (input != null)
- {
- SerializeString(input, sb);
- }
- else if (o is char)
- {
- if (((char)o) == '\0')
- {
- sb.Append("null");
- }
- else
- {
- SerializeString(o.ToString(), sb);
- }
- }
- else if (o is bool)
- {
- SerializeBoolean((bool)o, sb);
- }
- else if (o is DateTime)
- {
- SerializeDateTime((DateTime)o, sb, serializationFormat);
- }
- else if (o is DateTimeOffset)
- {
- DateTimeOffset offset = (DateTimeOffset)o;
- SerializeDateTime(offset.UtcDateTime, sb, serializationFormat);
- }
- else if (o is Guid)
- {
- SerializeGuid((Guid)o, sb);
- }
- else
- {
- Uri uri = o as Uri;
- if (uri != null)
- {
- SerializeUri(uri, sb);
- }
- else if (o is double)
- {
- sb.Append(((double)o).ToString("r", CultureInfo.InvariantCulture));
- }
- else if (o is float)
- {
- sb.Append(((float)o).ToString("r", CultureInfo.InvariantCulture));
- }
- else if (o.GetType().IsPrimitive || (o is decimal))
- {
- IConvertible convertible = o as IConvertible;
- if (convertible != null)
- {
- sb.Append(convertible.ToString(CultureInfo.InvariantCulture));
- }
- else
- {
- sb.Append(o.ToString());
- }
- }
- else
- {
- Type enumType = o.GetType();
- if (enumType.IsEnum)
- {
- Type underlyingType = Enum.GetUnderlyingType(enumType);
- if ((underlyingType == typeof(long)) || (underlyingType == typeof(ulong)))
- {
- throw new InvalidOperationException(AtlasWeb.JSON_InvalidEnumType);
- }
- sb.Append(((Enum)o).ToString("D"));
- }
- else
- {
- try
- {
- if (objectsInUse == null)
- {
- //new Hashtable(new ReferenceComparer());
- objectsInUse = new Hashtable();
- }
- else if (objectsInUse.ContainsKey(o))
- {
- throw new InvalidOperationException(string.Format(CultureInfo.CurrentCulture, AtlasWeb.JSON_CircularReference, new object[] { enumType.FullName }));
- }
- objectsInUse.Add(o, null);
- IDictionary dictionary = o as IDictionary;
- if (dictionary != null)
- {
- this.SerializeDictionary(dictionary, sb, depth, objectsInUse, serializationFormat);
- }
- else
- {
- IEnumerable enumerable = o as IEnumerable;
- if (enumerable != null)
- {
- this.SerializeEnumerable(enumerable, sb, depth, objectsInUse, serializationFormat);
- }
- else
- {
- this.SerializeCustomObject(o, sb, depth, objectsInUse, serializationFormat);
- }
- }
- }
- finally
- {
- if (objectsInUse != null)
- {
- objectsInUse.Remove(o);
- }
- }
- }
- }
- }
- }
- }
-
- private Dictionary<Type, JavaScriptConverter> Converters
- {
- get
- {
- if (this._converters == null)
- {
- this._converters = new Dictionary<Type, JavaScriptConverter>();
- }
- return this._converters;
- }
- }
-
- public int MaxJsonLength
- {
- get
- {
- return this._maxJsonLength;
- }
- set
- {
- if (value < 1)
- {
- throw new ArgumentOutOfRangeException(AtlasWeb.JSON_InvalidMaxJsonLength);
- }
- this._maxJsonLength = value;
- }
- }
-
- public int RecursionLimit
- {
- get
- {
- return this._recursionLimit;
- }
- set
- {
- if (value < 1)
- {
- throw new ArgumentOutOfRangeException(AtlasWeb.JSON_InvalidRecursionLimit);
- }
- this._recursionLimit = value;
- }
- }
-
- internal JavaScriptTypeResolver TypeResolver
- {
- get
- {
- return this._typeResolver;
- }
- }
-
- private class ReferenceComparer : IEqualityComparer
- {
- bool IEqualityComparer.Equals(object x, object y)
- {
- return (x == y);
- }
-
- int IEqualityComparer.GetHashCode(object obj)
- {
- return RuntimeHelpers.GetHashCode(obj);
- }
- }
-
- internal enum SerializationFormat
- {
- JSON,
- JavaScript
- }
- }
-}
View
79 silverlight/3.3.0.1/PubnubSilverlight.Example/Imports/JavaScriptString.cs
@@ -1,79 +0,0 @@
-namespace System.Web.Script.Serialization
-{
- using System;
-
- internal class JavaScriptString
- {
- private int _index;
- private string _s;
-
- internal JavaScriptString(string s)
- {
- this._s = s;
- }
-
- internal string GetDebugString(string message)
- {
- return string.Concat(new object[] { message, " (", this._index, "): ", this._s });
- }
-
- internal char? GetNextNonEmptyChar()
- {
- while (this._s.Length > this._index)
- {
- char c = this._s[this._index++];
- if (!char.IsWhiteSpace(c))
- {
- return new char?(c);
- }
- }
- return null;
- }
-
- internal char? MoveNext()
- {
- if (this._s.Length > this._index)
- {
- return new char?(this._s[this._index++]);
- }
- return null;
- }
-
- internal string MoveNext(int count)
- {
- if (this._s.Length >= (this._index + count))
- {
- string str = this._s.Substring(this._index, count);
- this._index += count;
- return str;
- }
- return null;
- }
-
- internal void MovePrev()
- {
- if (this._index > 0)
- {
- this._index--;
- }
- }
-
- internal void MovePrev(int count)
- {
- while ((this._index > 0) && (count > 0))
- {
- this._index--;
- count--;
- }
- }
-
- public override string ToString()
- {
- if (this._s.Length > this._index)
- {
- return this._s.Substring(this._index);
- }
- return string.Empty;
- }
- }
-}
View
14 silverlight/3.3.0.1/PubnubSilverlight.Example/Imports/JavaScriptTypeResolver.cs
@@ -1,14 +0,0 @@
-namespace System.Web.Script.Serialization
-{
- using System;
-
- public abstract class JavaScriptTypeResolver
- {
- protected JavaScriptTypeResolver()
- {
- }
-
- public abstract Type ResolveType(string id);
- public abstract string ResolveTypeId(Type type);
- }
-}
View
472 silverlight/3.3.0.1/PubnubSilverlight.Example/Imports/ObjectConverter.cs
@@ -1,472 +0,0 @@
-namespace System.Web.Script.Serialization
-{
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Globalization;
- using System.Reflection;
- using System.Runtime.InteropServices;
- using System.Web.Resources;
-
- internal static class ObjectConverter
- {
- private static Type _dictionaryGenericType = typeof(Dictionary<,>);
- private static Type _enumerableGenericType = typeof(IEnumerable<>);
- private static Type _idictionaryGenericType = typeof(IDictionary<,>);
- private static Type _listGenericType = typeof(List<>);
- private static readonly Type[] s_emptyTypeArray = new Type[0];
-
- private static bool AddItemToList(IList oldList, IList newList, Type elementType, JavaScriptSerializer serializer, bool throwOnError)
- {
- foreach (object obj3 in oldList)
- {
- object obj2;
- if (!ConvertObjectToTypeMain(obj3, elementType, serializer, throwOnError, out obj2))
- {
- return false;
- }
- newList.Add(obj2);
- }
- return true;
- }
-
- private static bool AssignToPropertyOrField(object propertyValue, object o, string memberName, JavaScriptSerializer serializer, bool throwOnError)
- {
- IDictionary dictionary = o as IDictionary;
- if (dictionary != null)
- {
- if (!ConvertObjectToTypeMain(propertyValue, null, serializer, throwOnError, out propertyValue))
- {
- return false;
- }
- dictionary[memberName] = propertyValue;
- return true;
- }
- Type type = o.GetType();
- PropertyInfo property = type.GetProperty(memberName, BindingFlags.Public | BindingFlags.Instance | BindingFlags.IgnoreCase);
- if (property != null)
- {
- MethodInfo setMethod = property.GetSetMethod();
- if (setMethod != null)
- {
- if (!ConvertObjectToTypeMain(propertyValue, property.PropertyType, serializer, throwOnError, out propertyValue))
- {
- return false;
- }
- try
- {
- setMethod.Invoke(o, new object[] { propertyValue });
- return true;
- }
- catch
- {
- if (throwOnError)
- {
- throw;
- }
- return false;
- }
- }
- }
- FieldInfo field = type.GetField(memberName, BindingFlags.Public | BindingFlags.Instance | BindingFlags.IgnoreCase);
- if (field != null)
- {
- if (!ConvertObjectToTypeMain(propertyValue, field.FieldType, serializer, throwOnError, out propertyValue))
- {
- return false;
- }
- try
- {
- field.SetValue(o, propertyValue);
- return true;
- }
- catch
- {
- if (throwOnError)
- {
- throw;
- }
- return false;
- }
- }
- return true;
- }
-
- private static bool ConvertDictionaryToObject(IDictionary<string, object> dictionary, Type type, JavaScriptSerializer serializer, bool throwOnError, out object convertedObject)
- {
- object obj2;
- Type t = type;
- string id = null;
- object o = dictionary;
- if (dictionary.TryGetValue("__type", out obj2))
- {
- if (!ConvertObjectToTypeMain(obj2, typeof(string), serializer, throwOnError, out obj2))
- {
- convertedObject = false;
- return false;
- }
- id = (string)obj2;
- if (id != null)
- {
- if (serializer.TypeResolver != null)
- {
- t = serializer.TypeResolver.ResolveType(id);
- if (t == null)
- {
- if (throwOnError)
- {
- throw new InvalidOperationException();
- }
- convertedObject = null;
- return false;
- }
- }
- dictionary.Remove("__type");
- }
- }
- JavaScriptConverter converter = null;
- if ((t != null) && serializer.ConverterExistsForType(t, out converter))
- {
- try
- {
- convertedObject = converter.Deserialize(dictionary, t, serializer);
- return true;
- }
- catch
- {
- if (throwOnError)
- {
- throw;
- }
- convertedObject = null;
- return false;
- }
- }
- if ((id != null) || IsClientInstantiatableType(t, serializer))
- {
- o = Activator.CreateInstance(t);
- }
- List<string> list = new List<string>(dictionary.Keys);
- if (IsGenericDictionary(type))
- {
- Type type3 = type.GetGenericArguments()[0];
- if ((type3 != typeof(string)) && (type3 != typeof(object)))
- {
- if (throwOnError)
- {
- throw new InvalidOperationException(string.Format(CultureInfo.InvariantCulture, AtlasWeb.JSON_DictionaryTypeNotSupported, new object[] { type.FullName }));
- }
- convertedObject = null;
- return false;
- }
- Type type4 = type.GetGenericArguments()[1];
- IDictionary dictionary2 = null;
- if (IsClientInstantiatableType(type, serializer))
- {
- dictionary2 = (IDictionary)Activator.CreateInstance(type);
- }
- else
- {
- dictionary2 = (IDictionary)Activator.CreateInstance(_dictionaryGenericType.MakeGenericType(new Type[] { type3, type4 }));
- }
- if (dictionary2 != null)
- {
- foreach (string str2 in list)
- {
- object obj4;
- if (!ConvertObjectToTypeMain(dictionary[str2], type4, serializer, throwOnError, out obj4))
- {
- convertedObject = null;
- return false;
- }
- dictionary2[str2] = obj4;
- }
- convertedObject = dictionary2;
- return true;
- }
- }
- if ((type != null) && !type.IsAssignableFrom(o.GetType()))
- {
- if (!throwOnError)
- {
- convertedObject = null;
- return false;
- }
- if (type.GetConstructor(BindingFlags.Public | BindingFlags.Instance, null, s_emptyTypeArray, null) == null)
- {
- throw new MissingMethodException(string.Format(CultureInfo.InvariantCulture, AtlasWeb.JSON_NoConstructor, new object[] { type.FullName }));
- }
- throw new InvalidOperationException(string.Format(CultureInfo.InvariantCulture, AtlasWeb.JSON_DeserializerTypeMismatch, new object[] { type.FullName }));
- }
- foreach (string str3 in list)
- {
- object propertyValue = dictionary[str3];
- if (!AssignToPropertyOrField(propertyValue, o, str3, serializer, throwOnError))
- {
- convertedObject = null;
- return false;
- }
- }
- convertedObject = o;
- return true;
- }
-
- private static bool ConvertListToObject(IList list, Type type, JavaScriptSerializer serializer, bool throwOnError, out IList convertedList)
- {
- if (((type == null) || (type == typeof(object))) || IsArrayListCompatible(type))
- {
- Type elementType = typeof(object);
- if ((type != null) && (type != typeof(object)))
- {
- elementType = type.GetElementType();
- }
- List<object> newList = new List<object>();
- if (!AddItemToList(list, newList, elementType, serializer, throwOnError))
- {
- convertedList = null;
- return false;
- }
- if ((type == typeof(IEnumerable)) || ((type == typeof(IList)) || (type == typeof(ICollection))))
- {
- convertedList = newList;
- return true;
- }
- convertedList = newList.ToArray();
- return true;
- }
- if (type.IsGenericType && (type.GetGenericArguments().Length == 1))
- {
- Type type3 = type.GetGenericArguments()[0];
- if (_enumerableGenericType.MakeGenericType(new Type[] { type3 }).IsAssignableFrom(type))
- {
- Type type5 = _listGenericType.MakeGenericType(new Type[] { type3 });
- IList list3 = null;
- if (IsClientInstantiatableType(type, serializer) && typeof(IList).IsAssignableFrom(type))
- {
- list3 = (IList)Activator.CreateInstance(type);
- }
- else
- {
- if (type5.IsAssignableFrom(type))
- {
- if (throwOnError)
- {
- throw new InvalidOperationException(string.Format(CultureInfo.InvariantCulture, AtlasWeb.JSON_CannotCreateListType, new object[] { type.FullName }));
- }
- convertedList = null;
- return false;
- }
- list3 = (IList)Activator.CreateInstance(type5);
- }
- if (!AddItemToList(list, list3, type3, serializer, throwOnError))
- {
- convertedList = null;
- return false;
- }
- convertedList = list3;
- return true;
- }
- }
- else if (IsClientInstantiatableType(type, serializer) && typeof(IList).IsAssignableFrom(type))
- {
- IList list4 = (IList)Activator.CreateInstance(type);
- if (!AddItemToList(list, list4, null, serializer, throwOnError))
- {
- convertedList = null;
- return false;
- }
- convertedList = list4;
- return true;
- }
- if (throwOnError)
- {
- throw new InvalidOperationException(string.Format(CultureInfo.CurrentCulture, AtlasWeb.JSON_ArrayTypeNotSupported, new object[] { type.FullName }));
- }
- convertedList = null;
- return false;
- }
-
- internal static object ConvertObjectToType(object o, Type type, JavaScriptSerializer serializer)
- {
- object obj2;
- ConvertObjectToTypeMain(o, type, serializer, true, out obj2);
- return obj2;
- }
-
- private static bool ConvertObjectToTypeInternal(object o, Type type, JavaScriptSerializer serializer, bool throwOnError, out object convertedObject)
- {
- IDictionary<string, object> dictionary = o as IDictionary<string, object>;
- if (dictionary != null)
- {
- return ConvertDictionaryToObject(dictionary, type, serializer, throwOnError, out convertedObject);
- }
- IList list = o as IList;
- if (list != null)
- {
- IList list2;
- if (ConvertListToObject(list, type, serializer, throwOnError, out list2))
- {
- convertedObject = list2;
- return true;
- }
- convertedObject = null;
- return false;
- }
- if ((type == null) || (o.GetType() == type))
- {
- convertedObject = o;
- return true;
- }
- //TypeDescriptor.GetConverter(type) !!!
- TypeConverter converter = new TypeConverter();
- if (converter.CanConvertFrom(o.GetType()))
- {
- try
- {
- convertedObject = converter.ConvertFrom(null, CultureInfo.InvariantCulture, o);
- return true;
- }
- catch
- {
- if (throwOnError)
- {
- throw;
- }
- convertedObject = null;
- return false;
- }
- }
- if (converter.CanConvertFrom(typeof(string)))
- {
- try
- {
- string str;
- if (o is DateTime)
- {
- DateTime time = (DateTime)o;
- str = time.ToUniversalTime().ToString("u", CultureInfo.InvariantCulture);
- }
- else
- {
- //ConvertToInvariantString(o); !!!
- str = converter.ConvertToString(o);
- }
- //ConvertFromInvariantString(str); !!!
- convertedObject = converter.ConvertToString(str);
- return true;
- }
- catch
- {
- if (throwOnError)
- {
- throw;
- }
- convertedObject = null;
- return false;
- }
- }
- if (type.IsAssignableFrom(o.GetType()))
- {
- convertedObject = o;
- return true;
- }
- if (throwOnError)
- {
- throw new InvalidOperationException(string.Format(CultureInfo.CurrentCulture, AtlasWeb.JSON_CannotConvertObjectToType, new object[] { o.GetType(), type }));
- }
- convertedObject = null;
- return false;
- }
-
- private static bool ConvertObjectToTypeMain(object o, Type type, JavaScriptSerializer serializer, bool throwOnError, out object convertedObject)
- {
- if (o == null)
- {
- if (type == typeof(char))
- {
- convertedObject = '\0';
- return true;
- }
- if (IsNonNullableValueType(type))
- {
- if (throwOnError)
- {
- throw new InvalidOperationException(AtlasWeb.JSON_ValueTypeCannotBeNull);
- }
- convertedObject = null;
- return false;
- }
- convertedObject = null;
- return true;
- }
- if (o.GetType() == type)
- {
- convertedObject = o;
- return true;
- }
- return ConvertObjectToTypeInternal(o, type, serializer, throwOnError, out convertedObject);
- }
-
- private static bool IsArrayListCompatible(Type type)
- {
- if (!type.IsArray && (!(type == typeof(IEnumerable)) && !(type == typeof(IList))))
- {
- return (type == typeof(ICollection));
- }
- return true;
- }
-
- internal static bool IsClientInstantiatableType(Type t, JavaScriptSerializer serializer)
- {
- if (((t == null) || t.IsAbstract) || (t.IsInterface || t.IsArray))
- {
- return false;
- }
- if (t == typeof(object))
- {
- return false;
- }
- JavaScriptConverter converter = null;
- if (!serializer.ConverterExistsForType(t, out converter))
- {
- if (t.IsValueType)
- {
- return true;
- }
- if (t.GetConstructor(BindingFlags.Public | BindingFlags.Instance, null, s_emptyTypeArray, null) == null)
- {
- return false;
- }
- }
- return true;
- }
-
- private static bool IsGenericDictionary(Type type)
- {
- if (((type == null) || !type.IsGenericType) || (!typeof(IDictionary).IsAssignableFrom(type) && !(type.GetGenericTypeDefinition() == _idictionaryGenericType)))
- {
- return false;
- }
- return (type.GetGenericArguments().Length == 2);
- }
-
- private static bool IsNonNullableValueType(Type type)
- {
- if ((type == null) || !type.IsValueType)
- {
- return false;
- }
- if (type.IsGenericType)
- {
- return !(type.GetGenericTypeDefinition() == typeof(Nullable<>));
- }
- return true;
- }
-
- internal static bool TryConvertObjectToType(object o, Type type, JavaScriptSerializer serializer, out object convertedObject)
- {
- return ConvertObjectToTypeMain(o, type, serializer, false, out convertedObject);
- }
- }
-}
View
9 silverlight/3.3.0.1/PubnubSilverlight.Example/Imports/ScriptIgnoreAttribute.cs
@@ -1,9 +0,0 @@
-namespace System.Web.Script.Serialization
-{
- using System;
-
- [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property)]
- public sealed class ScriptIgnoreAttribute : Attribute
- {
- }
-}
View
40 silverlight/3.3.0.1/PubnubSilverlight.Example/Imports/Trace.cs
@@ -1,40 +0,0 @@
-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.IO.IsolatedStorage;
-using System.IO;
-
-namespace System.Diagnostics
-{
- public class Trace
- {
- private static IsolatedStorageFile _storageFile = null;
- private static IsolatedStorageFileStream _storageFileStream = null;
- private static StreamWriter _streamWriter = null;
-
- public Trace()
- {
- _storageFile = IsolatedStorageFile.GetUserStoreForApplication();
- _storageFileStream = _storageFile.OpenFile("Trace.log", FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.ReadWrite);
- _streamWriter = new StreamWriter(_storageFileStream);
- _streamWriter.AutoFlush = true;
- }
-
- ~Trace()
- {
- _storageFileStream.Close();
- }
-
- public static void WriteLine(String message)
- {
- _streamWriter.WriteLine(message);
- }
- }
-}
View
56 silverlight/3.3.0.1/PubnubSilverlight.Example/MainView.xaml
@@ -1,56 +0,0 @@
-<navigation:Page x:Class="PubNub_Messaging.MainView"
- 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"
- xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"
- xmlns:uriMapper="clr-namespace:System.Windows.Navigation;assembly=System.Windows.Controls.Navigation"
- d:DesignWidth="640" d:DesignHeight="480" Title="MainView Page">
-
- <Grid x:Name="LayoutRoot" Style="{StaticResource LayoutRootGridStyle}">
-
- <Border x:Name="ContentBorder" Style="{StaticResource ContentBorderStyle}" >
- <navigation:Frame x:Name="ContentFrame" Style="{StaticResource ContentFrameStyle}" Source="/CodeExampleView" Navigated="ContentFrame_Navigated" NavigationFailed="ContentFrame_NavigationFailed">
- <navigation:Frame.UriMapper>
- <uriMapper:UriMapper>
- <uriMapper:UriMapping Uri="" MappedUri="/Views/CodeExampleView.xaml"/>
- <uriMapper:UriMapping Uri="/{pageName}" MappedUri="/Views/{pageName}.xaml"/>
- </uriMapper:UriMapper>
- </navigation:Frame.UriMapper>
- </navigation:Frame>
- </Border>
-
- <Grid x:Name="NavigationGrid" Style="{StaticResource NavigationGridStyle}">
-
- <Border x:Name="BrandingBorder" Style="{StaticResource BrandingBorderStyle}">
-
- <StackPanel x:Name="BrandingStackPanel" Style="{StaticResource BrandingStackPanelStyle}">
-
- <ContentControl Style="{StaticResource LogoIcon}"/>
-
- <TextBlock x:Name="ApplicationNameTextBlock" Style="{StaticResource ApplicationNameStyle}" Text="Pubnub Silverlight Example"/>
-
- </StackPanel>
-
- </Border>
-
- <Border x:Name="LinksBorder" Style="{StaticResource LinksBorderStyle}">
-
- <StackPanel x:Name="LinksStackPanel" Style="{StaticResource LinksStackPanelStyle}">
-
- <HyperlinkButton x:Name="Link1" Style="{StaticResource LinkStyle}" NavigateUri="/CodeExampleView" TargetName="ContentFrame" Content="Example"/>
-
- <Rectangle x:Name="Divider1" Style="{StaticResource DividerStyle}"/>
-
- <HyperlinkButton x:Name="Link2" Style="{StaticResource LinkStyle}" NavigateUri="/CodeUnitTestView" TargetName="ContentFrame" Content="Unit Test"/>
-
- </StackPanel>
-
- </Border>
-
- </Grid>
-
- </Grid>
-
-</navigation:Page>
View
56 silverlight/3.3.0.1/PubnubSilverlight.Example/MainView.xaml.cs
@@ -1,56 +0,0 @@
-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.Windows.Navigation;
-using System.Diagnostics;
-using System.ComponentModel;
-using System.IO;
-using System.Threading;
-using Microsoft.Silverlight.Testing;
-
-namespace PubNub_Messaging
-{
- public partial class MainView : Page
- {
- public MainView()
- {
- InitializeComponent();
- }
-
- // After the Frame navigates, ensure the HyperlinkButton representing the current page is selected
- private void ContentFrame_Navigated(object sender, NavigationEventArgs e)
- {
- foreach (UIElement child in LinksStackPanel.Children)
- {
- HyperlinkButton hb = child as HyperlinkButton;
- if (hb != null && hb.NavigateUri != null)
- {
- if (hb.NavigateUri.ToString().Equals(e.Uri.ToString()))
- {
- VisualStateManager.GoToState(hb, "ActiveLink", true);
- }
- else
- {
- VisualStateManager.GoToState(hb, "InactiveLink", true);
- }
- }
- }
- }
-
- // If an error occurs during navigation, show an error window
- private void ContentFrame_NavigationFailed(object sender, NavigationFailedEventArgs e)
- {
- e.Handled = true;
- ChildWindow errorWin = new ErrorWindow(e.Uri);
- errorWin.Show();
- }
- }
-}
View
7 silverlight/3.3.0.1/PubnubSilverlight.Example/Properties/AppManifest.xml
@@ -1,7 +0,0 @@
-<Deployment xmlns="http://schemas.microsoft.com/client/2007/deployment"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
->
- <Deployment.Parts>
- </Deployment.Parts>
-
-</Deployment>
View
37 silverlight/3.3.0.1/PubnubSilverlight.Example/Properties/AssemblyInfo.cs
@@ -1,37 +0,0 @@
-// Copyright © 2012
-
-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("PubnubSilverlight.Example")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("PubnubSilverlight.Example")]
-[assembly: AssemblyCopyright("Copyright © 2012")]
-[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("05b36b44-3170-4cca-87b8-17522f66dcfc")]
-
-// 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")]
View
191 silverlight/3.3.0.1/PubnubSilverlight.Example/PubnubSilverlight.Example.csproj
@@ -1,191 +0,0 @@
-<?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>9.0.30729</ProductVersion>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{FC8C4396-43E2-4C43-AA56-7F0A54F6F1DB}</ProjectGuid>
- <ProjectTypeGuids>{A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
- <OutputType>Library</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>PubNub_Messaging</RootNamespace>
- <AssemblyName>PubnubSilverlight.Example</AssemblyName>
- <TargetFrameworkIdentifier>Silverlight</TargetFrameworkIdentifier>
- <TargetFrameworkVersion>v5.0</TargetFrameworkVersion>
- <SilverlightVersion>$(TargetFrameworkVersion)</SilverlightVersion>
- <SilverlightApplication>true</SilverlightApplication>
- <SupportedCultures />
- <XapOutputs>true</XapOutputs>
- <GenerateSilverlightManifest>true</GenerateSilverlightManifest>
- <XapFilename>PubnubSilverlight.Example.xap</XapFilename>
- <SilverlightManifestTemplate>Properties\AppManifest.xml</SilverlightManifestTemplate>
- <SilverlightAppEntry>PubNub_Messaging.App</SilverlightAppEntry>
- <TestPageFileName>TestPage.html</TestPageFileName>
- <CreateTestPage>true</CreateTestPage>
- <ValidateXaml>true</ValidateXaml>
- <EnableOutOfBrowser>false</EnableOutOfBrowser>
- <OutOfBrowserSettingsFile>Properties\OutOfBrowserSettings.xml</OutOfBrowserSettingsFile>
- <UsePlatformExtensions>false</UsePlatformExtensions>
- <ThrowErrorsInValidation>true</ThrowErrorsInValidation>
- <LinkedServerProject />
- </PropertyGroup>
- <!--
- //
- // Silverlight Code Coverage Instrumentation
- // List any libraries or assemblies that you would like to instrument during
- // a code coverage pass. An example, for ClassLibrary1, is provided, and
- // commented out below as a starting point:
- //
- -->
- <!--
- <ItemGroup>
- <InstrumentSilverlightAssemblies Include="SilverlightClassLibrary1">
- <Visible>false</Visible>
- </InstrumentSilverlightAssemblies>
- </ItemGroup>
- -->
- <!-- This property group is only here to support building this project using the
- MSBuild 3.5 toolset. In order to work correctly with this older toolset, it needs
- to set the TargetFrameworkVersion to v3.5 -->
- <PropertyGroup Condition="'$(MSBuildToolsVersion)' == '3.5'">
- <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
- <DebugSymbols>true</DebugSymbols>
- <DebugType>full</DebugType>
- <Optimize>false</Optimize>
- <OutputPath>Bin\Debug</OutputPath>
- <DefineConstants>DEBUG;TRACE;SILVERLIGHT</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</DefineConstants>
- <NoStdLib>true</NoStdLib>
- <NoConfig>true</NoConfig>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- </PropertyGroup>
- <ItemGroup>
- <Reference Include="ConcurrentHashtable_Silverlight">
- <HintPath>..\Libraries\ConcurrentHashtable_Silverlight.dll</HintPath>
- </Reference>
- <Reference Include="Microsoft.Silverlight.Testing">
- <HintPath>..\Libraries\Microsoft.Silverlight.Testing.dll</HintPath>
- </Reference>
- <Reference Include="Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight">
- <HintPath>..\Libraries\Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight.dll</HintPath>
- </Reference>
- <Reference