Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/pubnub/pubnub-api
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenlb committed Dec 18, 2012
2 parents 052b350 + bd28e1f commit c2fc18f
Show file tree
Hide file tree
Showing 16 changed files with 2,950 additions and 389 deletions.
Binary file not shown.
Expand Up @@ -55,7 +55,7 @@
<Reference Include="System.Core" />
</ItemGroup>
</When>
<When Condition=" '$(TargetFrameworkVersion.Replace(&quot;v&quot;,&quot;&quot;))' == '4.0' ">
<When Condition=" '$(TargetFrameworkVersion.Replace(&quot;v&quot;,&quot;&quot;))' == '4.0' Or '$(TargetFrameworkVersion.Replace(&quot;v&quot;,&quot;&quot;))' == '4.5' ">
<PropertyGroup>
<ConfigTemplate>
<Configuration>
Expand Down
2 changes: 1 addition & 1 deletion csharp/3.3.0.1/PubNub-Messaging/PubNub-Messaging.csproj
Expand Up @@ -54,7 +54,7 @@
<StartupObject>PubNub_Messaging.Pubnub_Example</StartupObject>
</PropertyGroup>
<Choose>
<When Condition=" '$(TargetFrameworkVersion.Replace(&quot;v&quot;,&quot;&quot;))' == '4.0' ">
<When Condition=" '$(TargetFrameworkVersion.Replace(&quot;v&quot;,&quot;&quot;))' == '4.0' Or '$(TargetFrameworkVersion.Replace(&quot;v&quot;,&quot;&quot;))' == '4.5' ">
<PropertyGroup>
<ConfigTemplate>
<Configuration>
Expand Down
380 changes: 148 additions & 232 deletions csharp/3.3.0.1/PubNub-Messaging/Pubnub.cs

Large diffs are not rendered by default.

35 changes: 34 additions & 1 deletion csharp/3.3.0.1/PubNub-Messaging/Pubnub_Example.cs
Expand Up @@ -90,7 +90,40 @@ static public void Main()
Console.WriteLine("Running publish()");
Console.WriteLine("Enter the message for publish. To exit loop, enter QUIT");
string publishMsg = Console.ReadLine();
pubnub.publish<string>(channel, publishMsg, DisplayReturnMessage);
double doubleData;
int intData;
if (int.TryParse(publishMsg, out intData))
{
pubnub.publish<string>(channel, intData, DisplayReturnMessage);
}
else if (double.TryParse(publishMsg, out doubleData))
{
pubnub.publish<string>(channel, doubleData, DisplayReturnMessage);
}
else
{
//check whether any numeric is sent in double quotes
if (publishMsg.IndexOf("\"") == 0 && publishMsg.LastIndexOf("\"") == publishMsg.Length - 1)
{
string strMsg = publishMsg.Substring(1, publishMsg.Length - 2);
if (int.TryParse(strMsg, out intData))
{
pubnub.publish<string>(channel, strMsg, DisplayReturnMessage);
}
else if (double.TryParse(strMsg, out doubleData))
{
pubnub.publish<string>(channel, strMsg, DisplayReturnMessage);
}
else
{
pubnub.publish<string>(channel, publishMsg, DisplayReturnMessage);
}
}
else
{
pubnub.publish<string>(channel, publishMsg, DisplayReturnMessage);
}
}
break;
case "3":
Console.WriteLine("Running presence()");
Expand Down
1 change: 1 addition & 0 deletions csharp/3.3.0.1/PubNub-Messaging/app.config
Expand Up @@ -3,6 +3,7 @@
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup>
<appSettings>
<add key="OverrideTcpKeepAlive" value="false"/>
<add key="LogLevel" value="1"/>
</appSettings>
<system.diagnostics>
<trace autoflush="true" indentsize="4">
Expand Down
Binary file modified csharp/3.3.0.1/PubNub.suo
Binary file not shown.
153 changes: 0 additions & 153 deletions javascript/3.4/README.md

This file was deleted.

0 comments on commit c2fc18f

Please sign in to comment.