MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RemoteAgents", "RemoteAgents\RemoteAgents.csproj", "{C11B661C-3470-4542-83A7-939674DB2BD2}"
EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "jsonrpc4net.WindowsPhone8", "..\..\jsonrpc4net\jsonrpc4net\jsonrpc4net.WindowsPhone8.csproj", "{9FC57CC3-23D0-486B-A3E4-92C547561949}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
{C11B661C-3470-4542-83A7-939674DB2BD2}.Release|x86.ActiveCfg = Release|x86
{C11B661C-3470-4542-83A7-939674DB2BD2}.Release|x86.Build.0 = Release|x86
{C11B661C-3470-4542-83A7-939674DB2BD2}.Release|x86.Deploy.0 = Release|x86
+ {9FC57CC3-23D0-486B-A3E4-92C547561949}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {9FC57CC3-23D0-486B-A3E4-92C547561949}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {9FC57CC3-23D0-486B-A3E4-92C547561949}.Debug|ARM.ActiveCfg = Debug|ARM
+ {9FC57CC3-23D0-486B-A3E4-92C547561949}.Debug|ARM.Build.0 = Debug|ARM
+ {9FC57CC3-23D0-486B-A3E4-92C547561949}.Debug|x86.ActiveCfg = Debug|x86
+ {9FC57CC3-23D0-486B-A3E4-92C547561949}.Debug|x86.Build.0 = Debug|x86
+ {9FC57CC3-23D0-486B-A3E4-92C547561949}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {9FC57CC3-23D0-486B-A3E4-92C547561949}.Release|Any CPU.Build.0 = Release|Any CPU
+ {9FC57CC3-23D0-486B-A3E4-92C547561949}.Release|ARM.ActiveCfg = Release|ARM
+ {9FC57CC3-23D0-486B-A3E4-92C547561949}.Release|ARM.Build.0 = Release|ARM
+ {9FC57CC3-23D0-486B-A3E4-92C547561949}.Release|x86.ActiveCfg = Release|x86
+ {9FC57CC3-23D0-486B-A3E4-92C547561949}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
<Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
<TextBox x:Name="CurrentDateTextBox" HorizontalAlignment="Left" Height="72" Margin="0,57,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="456" IsReadOnly="True" InputScope="Date"/>
<Button x:Name="ButtonRetrieveRemoteData" Content="{Binding LocalizedResources.ButtonRetrieveRemoteData, Mode=OneWay, Source={StaticResource LocalizedStrings}}" HorizontalAlignment="Left" Margin="289,479,0,0" VerticalAlignment="Top" RenderTransformOrigin="-0.915,0.432"/>
+ <Button x:Name="ButtonSendRemoteData" Content="{Binding LocalizedResources.ButtonSendRemoteData, Mode=OneWay, Source={StaticResource LocalizedStrings}}" HorizontalAlignment="Left" Margin="29,479,0,0" VerticalAlignment="Top"/>
+ <TextBox x:Name="TextBoxSendText" HorizontalAlignment="Left" Height="182" Margin="10,236,0,0" TextWrapping="Wrap" Text="TextBox" VerticalAlignment="Top" Width="251"/>
+ <TextBlock HorizontalAlignment="Left" Margin="29,192,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Height="29" Width="121" Text="{Binding LocalizedResources.TextBlockSendText, Mode=OneWay, Source={StaticResource LocalizedStrings}}">
+ <Run Text="Send Text"/>
+ <Run Text=":"/>
+ <LineBreak/>
+ <Run/>
+ </TextBlock>
+ <TextBlock HorizontalAlignment="Left" Margin="29,23,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Height="29" Width="121" Text="{Binding LocalizedResources.TextBlockRemoteDate, Mode=OneWay, Source={StaticResource LocalizedStrings}}">
+ <Run Text="Remote Date:"/>
+ <LineBreak/>
+ <Run/>
+ </TextBlock>
</Grid>
}
catch (Exception exception)
{
- _logger.Error("ButtonGetDateClicked. Message: {0} Stacktrace: {1}", exception.Message, exception.StackTrace);
+ _logger.ErrorException("ButtonGetDateClicked error: ", exception);
+ }
+ }
+
+ async private void SendDataButtonClicked(object sender, RoutedEventArgs e)
+ {
+ try
+ {
+ int number = 666;
+ await _view.SetWriteTextAsync(this.TextBoxSendText.Text,
+ number);
+ }
+ catch (Exception exception)
+ {
+ _logger.ErrorException("SendDataButtonClicked error: ", exception);
}
}
private void registerEvents ()
{
this.ButtonRetrieveRemoteData.Click += ButtonRetrieveRemoteData_Click;
+ this.ButtonSendRemoteData.Click += SendDataButtonClicked;
}
// Código de ejemplo para compilar una ApplicationBar traducida
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
- <Reference Include="jsonrpc4net, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\..\..\jsonrpc4net\jsonrpc4net\Bin\Debug\jsonrpc4net.dll</HintPath>
- </Reference>
<Reference Include="NLog">
<HintPath>..\packages\NLog.2.1.0\lib\sl4-windowsphone71\NLog.dll</HintPath>
</Reference>
<ItemGroup>
<Folder Include="Model\" />
</ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\..\..\jsonrpc4net\jsonrpc4net\jsonrpc4net.WindowsPhone8.csproj">
+ <Project>{9FC57CC3-23D0-486B-A3E4-92C547561949}</Project>
+ <Name>jsonrpc4net.WindowsPhone8</Name>
+ </ProjectReference>
+ </ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Microsoft\$(TargetFrameworkIdentifier)\$(TargetFrameworkVersion)\Microsoft.$(TargetFrameworkIdentifier).$(TargetFrameworkVersion).Overrides.targets" />
<Import Project="$(MSBuildExtensionsPath)\Microsoft\$(TargetFrameworkIdentifier)\$(TargetFrameworkVersion)\Microsoft.$(TargetFrameworkIdentifier).CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
}
/// <summary>
+ /// Busca una cadena traducida similar a SendData.
+ /// </summary>
+ public static string ButtonSendRemoteData {
+ get {
+ return ResourceManager.GetString("ButtonSendRemoteData", resourceCulture);
+ }
+ }
+
+ /// <summary>
/// Busca una cadena traducida similar a LeftToRight.
/// </summary>
public static string ResourceFlowDirection {
return ResourceManager.GetString("ResourceLanguage", resourceCulture);
}
}
+
+ /// <summary>
+ /// Busca una cadena traducida similar a RemoteDate:.
+ /// </summary>
+ public static string TextBlockRemoteDate {
+ get {
+ return ResourceManager.GetString("TextBlockRemoteDate", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Busca una cadena traducida similar a SendText:.
+ /// </summary>
+ public static string TextBlockSendText {
+ get {
+ return ResourceManager.GetString("TextBlockSendText", resourceCulture);
+ }
+ }
}
}
<data name="ButtonRetrieveRemoteData" xml:space="preserve">
<value>GetData</value>
</data>
+ <data name="ButtonSendRemoteData" xml:space="preserve">
+ <value>SendData</value>
+ </data>
</root>
\ No newline at end of file
<data name="ButtonRetrieveRemoteData" xml:space="preserve">
<value>GetData</value>
</data>
+ <data name="ButtonSendRemoteData" xml:space="preserve">
+ <value>SendData</value>
+ </data>
+ <data name="TextBlockRemoteDate" xml:space="preserve">
+ <value>RemoteDate:</value>
+ </data>
+ <data name="TextBlockSendText" xml:space="preserve">
+ <value>SendText:</value>
+ </data>
</root>
\ No newline at end of file
{
return await _vm.GetCurrentDateAsync();
}
+
+ async public Task SetWriteTextAsync(params object[] parameters)
+ {
+ await _vm.SetWriteTextAsync(parameters);
+ }
}
}
public class ViewModelImpl
{
private static readonly string uri = "http://gumartinm.name/spring-mainapp/CurrentDateService.json";
- private readonly JsonRpcHttpAsyncClient _remoteProcedure = new JsonRpcHttpAsyncClient();
+ private static readonly string uriSetWriteText = "http://gumartinm.name/spring-mainapp/WriteTextService.json";
+ private readonly JsonRpcHttpAsyncClient _remoteClient = new JsonRpcHttpAsyncClient();
async public Task<string> GetCurrentDateAsync()
{
- return await _remoteProcedure.PostRemoteServiceAsync<string>(uri, "getCurrentDate");
+ return await _remoteClient.PostRemoteServiceAsync<string>(uri, "getCurrentDate");
}
+
+ async public Task SetWriteTextAsync(params object[] parameters)
+ {
+ await _remoteClient.PostRemoteServiceAsync(uriSetWriteText, "setWriteText", parameters);
+ }
+
}
}