diff options
author | Benoit Foucher <benoit@zeroc.com> | 2012-04-25 11:19:13 +0200 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2012-04-25 11:19:13 +0200 |
commit | 7e874613ff22bedf988273b51a15ab937f01169f (patch) | |
tree | 115a92a902f80fcc6252c5fac6a957ecc548b82c /cs/demo/Ice | |
parent | Fixed copyrights (diff) | |
download | ice-7e874613ff22bedf988273b51a15ab937f01169f.tar.bz2 ice-7e874613ff22bedf988273b51a15ab937f01169f.tar.xz ice-7e874613ff22bedf988273b51a15ab937f01169f.zip |
Merged Silverlight support
Diffstat (limited to 'cs/demo/Ice')
55 files changed, 2493 insertions, 24 deletions
diff --git a/cs/demo/Ice/compact/Program.cs b/cs/demo/Ice/compact/Program.cs deleted file mode 100644 index ddcf47cb988..00000000000 --- a/cs/demo/Ice/compact/Program.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System;
-using System.Linq;
-using System.Collections.Generic;
-using System.Windows.Forms;
-
-namespace client
-{
- static class Program
- {
- /// <summary>
- /// The main entry point for the application.
- /// </summary>
- [MTAThread]
- static void Main()
- {
- Application.Run(new MainForm());
- }
- }
-}
\ No newline at end of file diff --git a/cs/demo/Ice/compact/bidir/Callback.ice b/cs/demo/Ice/compact/bidir/Callback.ice new file mode 100644 index 00000000000..2bdd497a048 --- /dev/null +++ b/cs/demo/Ice/compact/bidir/Callback.ice @@ -0,0 +1,30 @@ +// ********************************************************************** +// +// Copyright (c) 2003-2011 ZeroC, Inc. All rights reserved. +// +// This copy of Ice is licensed to you under the terms described in the +// ICE_LICENSE file included in this distribution. +// +// ********************************************************************** + +#ifndef CALLBACK_ICE +#define CALLBACK_ICE + +#include <Ice/Identity.ice> + +module Demo +{ + +interface CallbackReceiver +{ + void callback(int num); +}; + +interface CallbackSender +{ + void addClient(Ice::Identity ident); +}; + +}; + +#endif diff --git a/cs/demo/Ice/compact/bidir/CallbackSenderI.cs b/cs/demo/Ice/compact/bidir/CallbackSenderI.cs new file mode 100644 index 00000000000..8669e0fe53f --- /dev/null +++ b/cs/demo/Ice/compact/bidir/CallbackSenderI.cs @@ -0,0 +1,110 @@ +// ********************************************************************** +// +// Copyright (c) 2003-2011 ZeroC, Inc. All rights reserved. +// +// This copy of Ice is licensed to you under the terms described in the +// ICE_LICENSE file included in this distribution. +// +// ********************************************************************** + +using Demo; +using System; +using System.Collections; + +class CallbackSenderI : CallbackSenderDisp_ +{ + public CallbackSenderI(Ice.Communicator communicator) + { + _communicator = communicator; + _destroy = false; + _clients = new ArrayList(); + } + + public void destroy() + { + _m.Lock(); + try + { + System.Console.Out.WriteLine("destroying callback sender"); + _destroy = true; + + _m.Notify(); + } + finally + { + _m.Unlock(); + } + } + + public override void addClient(Ice.Identity ident, Ice.Current current) + { + _m.Lock(); + try + { + System.Console.Out.WriteLine("adding client `" + _communicator.identityToString(ident) + "'"); + + Ice.ObjectPrx @base = current.con.createProxy(ident); + CallbackReceiverPrx client = CallbackReceiverPrxHelper.uncheckedCast(@base); + _clients.Add(client); + } + finally + { + _m.Unlock(); + } + } + + public void Run() + { + int num = 0; + while(true) + { + ArrayList clients; + _m.Lock(); + try + { + _m.TimedWait(2000); + if(_destroy) + { + break; + } + + clients = new ArrayList(_clients); + } + finally + { + _m.Unlock(); + } + + if(clients.Count > 0) + { + ++num; + foreach(CallbackReceiverPrx c in clients) + { + try + { + c.callback(num); + } + catch(Ice.LocalException ex) + { + Console.Error.WriteLine("removing client `" + + _communicator.identityToString(c.ice_getIdentity()) + "':\n" + ex); + _m.Lock(); + try + { + _clients.Remove(c); + } + finally + { + _m.Unlock(); + } + } + } + } + } + } + + private Ice.Communicator _communicator; + private bool _destroy; + private ArrayList _clients; + private readonly IceUtilInternal.Monitor _m = new IceUtilInternal.Monitor(); +} diff --git a/cs/demo/Ice/compact/bidir/MainForm.Designer.cs b/cs/demo/Ice/compact/bidir/MainForm.Designer.cs new file mode 100644 index 00000000000..4911b127bc5 --- /dev/null +++ b/cs/demo/Ice/compact/bidir/MainForm.Designer.cs @@ -0,0 +1,107 @@ +namespace server
+{
+ partial class MainForm
+ {
+ /// <summary>
+ /// Required designer variable.
+ /// </summary>
+ private System.ComponentModel.IContainer components = null;
+ private System.Windows.Forms.MainMenu mainMenu1;
+
+ /// <summary>
+ /// Clean up any resources being used.
+ /// </summary>
+ /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ /// <summary>
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ /// </summary>
+ private void InitializeComponent()
+ {
+ this.mainMenu1 = new System.Windows.Forms.MainMenu();
+ this.lblStatus = new System.Windows.Forms.Label();
+ this.btnStart = new System.Windows.Forms.Button();
+ this.btnStop = new System.Windows.Forms.Button();
+ this.lblPort = new System.Windows.Forms.Label();
+ this.txtPort = new System.Windows.Forms.TextBox();
+ this.SuspendLayout();
+ //
+ // lblStatus
+ //
+ this.lblStatus.Location = new System.Drawing.Point(13, 94);
+ this.lblStatus.Name = "lblStatus";
+ this.lblStatus.Size = new System.Drawing.Size(212, 79);
+ //
+ // btnStart
+ //
+ this.btnStart.Location = new System.Drawing.Point(13, 34);
+ this.btnStart.Name = "btnStart";
+ this.btnStart.Size = new System.Drawing.Size(212, 20);
+ this.btnStart.TabIndex = 2;
+ this.btnStart.Text = "Start Server";
+ this.btnStart.Click += new System.EventHandler(this.btnStart_Click);
+ //
+ // btnStop
+ //
+ this.btnStop.Enabled = false;
+ this.btnStop.Location = new System.Drawing.Point(13, 60);
+ this.btnStop.Name = "btnStop";
+ this.btnStop.Size = new System.Drawing.Size(212, 20);
+ this.btnStop.TabIndex = 3;
+ this.btnStop.Text = "Stop Server";
+ this.btnStop.Click += new System.EventHandler(this.btnStop_Click);
+ //
+ // lblPort
+ //
+ this.lblPort.Location = new System.Drawing.Point(13, 4);
+ this.lblPort.Name = "lblPort";
+ this.lblPort.Size = new System.Drawing.Size(39, 20);
+ this.lblPort.Text = "Port:";
+ //
+ // txtPort
+ //
+ this.txtPort.Location = new System.Drawing.Point(54, 4);
+ this.txtPort.Name = "txtPort";
+ this.txtPort.Size = new System.Drawing.Size(171, 21);
+ this.txtPort.TabIndex = 6;
+ this.txtPort.Text = "10000";
+ //
+ // MainForm
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
+ this.AutoScroll = true;
+ this.ClientSize = new System.Drawing.Size(240, 268);
+ this.Controls.Add(this.txtPort);
+ this.Controls.Add(this.lblPort);
+ this.Controls.Add(this.btnStop);
+ this.Controls.Add(this.btnStart);
+ this.Controls.Add(this.lblStatus);
+ this.Menu = this.mainMenu1;
+ this.Name = "MainForm";
+ this.Text = "Bidir Server";
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.Label lblStatus;
+ private System.Windows.Forms.Button btnStart;
+ private System.Windows.Forms.Button btnStop;
+ private System.Windows.Forms.Label lblPort;
+ private System.Windows.Forms.TextBox txtPort;
+ }
+}
+
diff --git a/cs/demo/Ice/compact/bidir/MainForm.cs b/cs/demo/Ice/compact/bidir/MainForm.cs new file mode 100644 index 00000000000..73576214f7a --- /dev/null +++ b/cs/demo/Ice/compact/bidir/MainForm.cs @@ -0,0 +1,103 @@ +// **********************************************************************
+//
+// Copyright (c) 2003-2011 ZeroC, Inc. All rights reserved.
+//
+// This copy of Ice is licensed to you under the terms described in the
+// ICE_LICENSE file included in this distribution.
+//
+// **********************************************************************
+
+using System;
+using System.Linq;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Text;
+using System.Windows.Forms;
+using System.Threading;
+
+namespace server
+{
+ public partial class MainForm : Form
+ {
+ public MainForm()
+ {
+ InitializeComponent();
+ }
+
+ protected override void OnClosed(EventArgs e)
+ {
+ base.OnClosed(e);
+ stop();
+ }
+
+ private void btnStart_Click(object sender, EventArgs e)
+ {
+ try
+ {
+ Ice.InitializationData initData = new Ice.InitializationData();
+ initData.properties = Ice.Util.createProperties();
+ initData.properties.setProperty("Callback.Server.Endpoints", "tcp -h 0.0.0.0 -p " + txtPort.Text);
+ _communicator = Ice.Util.initialize(initData);
+
+ Ice.ObjectAdapter adapter = _communicator.createObjectAdapter("Callback.Server");
+ _sender = new CallbackSenderI(_communicator);
+ adapter.add(_sender, _communicator.stringToIdentity("sender"));
+ adapter.activate();
+
+ _thread = new Thread(new ThreadStart(_sender.Run));
+ _thread.Start();
+ btnStart.Enabled = false;
+ btnStop.Enabled = true;
+ }
+ catch(Exception ex)
+ {
+ lblStatus.Text = "Start Failed: " + Environment.NewLine + ex.ToString();
+ }
+ lblStatus.Text = "Server started ok";
+ }
+
+ private void btnStop_Click(object sender, EventArgs e)
+ {
+ stop();
+ }
+
+ private void stop()
+ {
+ try
+ {
+ if(_communicator == null)
+ {
+ return;
+ }
+ _communicator.destroy();
+ _communicator = null;
+
+ if(_sender != null)
+ {
+ _sender.destroy();
+ }
+
+ if(_thread != null)
+ {
+ _thread.Join();
+ }
+ }
+ catch(Exception ex)
+ {
+ lblStatus.Text = "Stop Failed: " + Environment.NewLine + ex.ToString();
+ }
+ finally
+ {
+ btnStart.Enabled = true;
+ btnStop.Enabled = false;
+ }
+ lblStatus.Text = "Server stoped ok";
+ }
+
+ private Ice.Communicator _communicator;
+ private CallbackSenderI _sender;
+ private Thread _thread;
+ }
+}
\ No newline at end of file diff --git a/cs/demo/Ice/compact/MainForm.resx b/cs/demo/Ice/compact/bidir/MainForm.resx index c9d1ac5082d..c9d1ac5082d 100644 --- a/cs/demo/Ice/compact/MainForm.resx +++ b/cs/demo/Ice/compact/bidir/MainForm.resx diff --git a/cs/demo/Ice/compact/bidir/Program.cs b/cs/demo/Ice/compact/bidir/Program.cs new file mode 100644 index 00000000000..9f62d25cec9 --- /dev/null +++ b/cs/demo/Ice/compact/bidir/Program.cs @@ -0,0 +1,28 @@ +// **********************************************************************
+//
+// Copyright (c) 2003-2011 ZeroC, Inc. All rights reserved.
+//
+// This copy of Ice is licensed to you under the terms described in the
+// ICE_LICENSE file included in this distribution.
+//
+// **********************************************************************
+
+using System;
+using System.Linq;
+using System.Collections.Generic;
+using System.Windows.Forms;
+
+namespace server
+{
+ static class Program
+ {
+ /// <summary>
+ /// The main entry point for the application.
+ /// </summary>
+ [MTAThread]
+ static void Main()
+ {
+ Application.Run(new MainForm());
+ }
+ }
+}
\ No newline at end of file diff --git a/cs/demo/Ice/compact/bidir/README.txt b/cs/demo/Ice/compact/bidir/README.txt new file mode 100644 index 00000000000..f8939ecb777 --- /dev/null +++ b/cs/demo/Ice/compact/bidir/README.txt @@ -0,0 +1,58 @@ +This demo shows how to write a simple C# server application using Ice
+for .NET Compact Framework (CF).
+
+This demo requires a bidir client. You can use the C# client located
+in ..\..\bidir, or you can use a client from any other language mapping.
+
+You must use Visual Studio 2008 to build this client (Visual Studio
+2010 does not support Compact Framework development). Follow these
+instructions to build and run the client:
+
+1) Open the project in Visual Studio 2008. This is a Smart Device
+ project and therefore Visual Studio will compile it against the
+ Compact Framework libraries. Furthermore, the Ice Visual Studio
+ Add-in detects a Smart Device project and automatically
+ configures the project to compile against the Ice for .NET CF
+ DLL in <Ice installation directory>\bin\cf\Ice.dll.
+
+2) Build the client by right-clicking on the project and choosing
+ "Build".
+
+3) Start a device emulator. Select Tools -> Device Emulator Manager,
+ highlight "USA Windows Mobile 5.0 Pocket PC R2 Emulator", and
+ select Actions -> Connect.
+
+4) In the emulator window, select File -> Configure, open the Network
+ tab, and check "Enable NE2000 PCMCIA network adapter". Open the
+ drop-down menu and select the appropriate network adapter, then
+ press OK.
+
+ If you get an error dialog that mentions Virtual PC 2007, you will
+ need to install this product to enable network access for the
+ emulator. You can download Virtual PC 2007 at the link below:
+
+ http://www.microsoft.com/downloads/en/details.aspx?FamilyID=04d26402-3199-48a3-afa2-2dc0b40a73b6
+
+ Close the emulator, install Virtual PC 2007, and restart the
+ emulator.
+
+5) After successfully enabling the network adapter, you may need to
+ activate the network connection. Click on the symbol resembling an
+ antenna in the device's status bar and choose Connect to start the
+ connection. If you wish, start Internet Explorer and verify that
+ you can successfully access the Internet.
+
+6) In Visual Studio, right-click on the project, choose Deploy, select
+ the "USA Windows Mobile 5.0 Pocket PC R2 Emulator" device, and
+ click Deploy. This action causes Visual Studio to install the .NET
+ CF run time, the client executable, and the Ice for .NET CF run
+ time in the emulator.
+
+7) In the emulator, choose Start -> Programs and select File Explorer.
+ Click on My Documents and choose My Device. Select Program Files,
+ then select "server".
+
+8) Select "server" to start the program. Click the Start Server button
+ to start the server.
+
+9) Finally in a command window, start the bidir client.
diff --git a/cs/demo/Ice/compact/bidir/server.csproj b/cs/demo/Ice/compact/bidir/server.csproj new file mode 100644 index 00000000000..3e10dca53f1 --- /dev/null +++ b/cs/demo/Ice/compact/bidir/server.csproj @@ -0,0 +1,99 @@ +<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>9.0.21022</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{05B11482-32A1-4212-A7F8-2A135FADD164}</ProjectGuid>
+ <OutputType>WinExe</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>server</RootNamespace>
+ <AssemblyName>server</AssemblyName>
+ <ProjectTypeGuids>{4D628B5B-2FBC-4AA6-8C16-197242AEB884};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+ <PlatformFamilyName>PocketPC</PlatformFamilyName>
+ <PlatformID>4118C335-430C-497f-BE48-11C3316B135E</PlatformID>
+ <OSVersion>5.1</OSVersion>
+ <DeployDirSuffix>server</DeployDirSuffix>
+ <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
+ <NativePlatformName>Windows Mobile 5.0 Pocket PC SDK</NativePlatformName>
+ <FormFactorID>
+ </FormFactorID>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\Debug\</OutputPath>
+ <DefineConstants>TRACE;DEBUG;PocketPC COMPACT</DefineConstants>
+ <NoStdLib>true</NoStdLib>
+ <NoConfig>true</NoConfig>
+ <ErrorReport>prompt</ErrorReport>
+ <FileAlignment>512</FileAlignment>
+ <WarningLevel>4</WarningLevel>
+ <GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>bin\Release\</OutputPath>
+ <DefineConstants>TRACE;$(PlatformFamilyName)</DefineConstants>
+ <NoStdLib>true</NoStdLib>
+ <NoConfig>true</NoConfig>
+ <ErrorReport>prompt</ErrorReport>
+ <FileAlignment>512</FileAlignment>
+ <WarningLevel>4</WarningLevel>
+ <GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="Ice, Version=3.4.2.0, Culture=neutral, PublicKeyToken=cdd571ade22f2f16, processorArchitecture=MSIL" />
+ <Reference Include="mscorlib" />
+ <Reference Include="System" />
+ <Reference Include="System.Core" />
+ <Reference Include="System.Xml.Linq" />
+ <Reference Include="System.Data.DataSetExtensions" />
+ <Reference Include="System.Data" />
+ <Reference Include="System.Drawing" />
+ <Reference Include="System.Windows.Forms" />
+ <Reference Include="System.Xml" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="Callback.cs" />
+ <Compile Include="CallbackSenderI.cs" />
+ <Compile Include="MainForm.cs">
+ <SubType>Form</SubType>
+ </Compile>
+ <Compile Include="MainForm.Designer.cs">
+ <DependentUpon>MainForm.cs</DependentUpon>
+ </Compile>
+ <Compile Include="Program.cs" />
+ <EmbeddedResource Include="MainForm.resx">
+ <DependentUpon>MainForm.cs</DependentUpon>
+ <SubType>Designer</SubType>
+ </EmbeddedResource>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="Callback.ice" />
+ </ItemGroup>
+ <ItemGroup>
+ <Content Include="README.txt" />
+ </ItemGroup>
+ <ItemGroup>
+ <Folder Include="Properties\" />
+ </ItemGroup>
+ <Import Project="$(MSBuildBinPath)\Microsoft.CompactFramework.CSharp.targets" />
+ <ProjectExtensions>
+ <VisualStudio>
+ <FlavorProperties GUID="{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}">
+ <HostingProcess disable="1" />
+ </FlavorProperties>
+ <UserProperties ZerocIce_Enabled="True" />
+ </VisualStudio>
+ </ProjectExtensions>
+ <!-- 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>
+ -->
+</Project>
\ No newline at end of file diff --git a/cs/demo/Ice/compact/Hello.ice b/cs/demo/Ice/compact/hello/Hello.ice index bb7f6d95924..bb7f6d95924 100644 --- a/cs/demo/Ice/compact/Hello.ice +++ b/cs/demo/Ice/compact/hello/Hello.ice diff --git a/cs/demo/Ice/compact/MainForm.Designer.cs b/cs/demo/Ice/compact/hello/MainForm.Designer.cs index e8e802659e5..e8e802659e5 100644 --- a/cs/demo/Ice/compact/MainForm.Designer.cs +++ b/cs/demo/Ice/compact/hello/MainForm.Designer.cs diff --git a/cs/demo/Ice/compact/MainForm.cs b/cs/demo/Ice/compact/hello/MainForm.cs index 9e990f2c01b..9e990f2c01b 100644 --- a/cs/demo/Ice/compact/MainForm.cs +++ b/cs/demo/Ice/compact/hello/MainForm.cs diff --git a/cs/demo/Ice/compact/hello/MainForm.resx b/cs/demo/Ice/compact/hello/MainForm.resx new file mode 100644 index 00000000000..c9d1ac5082d --- /dev/null +++ b/cs/demo/Ice/compact/hello/MainForm.resx @@ -0,0 +1,129 @@ +<?xml version="1.0" encoding="utf-8"?>
+<root>
+ <!--
+ Microsoft ResX Schema
+
+ Version 2.0
+
+ The primary goals of this format is to allow a simple XML format
+ that is mostly human readable. The generation and parsing of the
+ various data types are done through the TypeConverter classes
+ associated with the data types.
+
+ Example:
+
+ ... ado.net/XML headers & schema ...
+ <resheader name="resmimetype">text/microsoft-resx</resheader>
+ <resheader name="version">2.0</resheader>
+ <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+ <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+ <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+ <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+ <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+ <value>[base64 mime encoded serialized .NET Framework object]</value>
+ </data>
+ <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+ <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+ <comment>This is a comment</comment>
+ </data>
+
+ There are any number of "resheader" rows that contain simple
+ name/value pairs.
+
+ Each data row contains a name, and value. The row also contains a
+ type or mimetype. Type corresponds to a .NET class that support
+ text/value conversion through the TypeConverter architecture.
+ Classes that don't support this are serialized and stored with the
+ mimetype set.
+
+ The mimetype is used for serialized objects, and tells the
+ ResXResourceReader how to depersist the object. This is currently not
+ extensible. For a given mimetype the value must be set accordingly:
+
+ Note - application/x-microsoft.net.object.binary.base64 is the format
+ that the ResXResourceWriter will generate, however the reader can
+ read any of the formats listed below.
+
+ mimetype: application/x-microsoft.net.object.binary.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.soap.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.bytearray.base64
+ value : The object must be serialized into a byte array
+ : using a System.ComponentModel.TypeConverter
+ : and then encoded with base64 encoding.
+ -->
+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+ <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+ <xsd:element name="root" msdata:IsDataSet="true">
+ <xsd:complexType>
+ <xsd:choice maxOccurs="unbounded">
+ <xsd:element name="metadata">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" />
+ </xsd:sequence>
+ <xsd:attribute name="name" use="required" type="xsd:string" />
+ <xsd:attribute name="type" type="xsd:string" />
+ <xsd:attribute name="mimetype" type="xsd:string" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="assembly">
+ <xsd:complexType>
+ <xsd:attribute name="alias" type="xsd:string" />
+ <xsd:attribute name="name" type="xsd:string" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="data">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="resheader">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:choice>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ <resheader name="resmimetype">
+ <value>text/microsoft-resx</value>
+ </resheader>
+ <resheader name="version">
+ <value>2.0</value>
+ </resheader>
+ <resheader name="reader">
+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <resheader name="writer">
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <metadata name="mainMenu1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+ <value>17, 17</value>
+ </metadata>
+ <metadata name="$this.FormFactorShadowProperty" xml:space="preserve">
+ <value>Pocket_PC</value>
+ </metadata>
+ <metadata name="$this.Skin" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>True</value>
+ </metadata>
+</root>
\ No newline at end of file diff --git a/cs/demo/Ice/compact/hello/Program.cs b/cs/demo/Ice/compact/hello/Program.cs new file mode 100644 index 00000000000..29c47e42752 --- /dev/null +++ b/cs/demo/Ice/compact/hello/Program.cs @@ -0,0 +1,28 @@ +// **********************************************************************
+//
+// Copyright (c) 2003-2011 ZeroC, Inc. All rights reserved.
+//
+// This copy of Ice is licensed to you under the terms described in the
+// ICE_LICENSE file included in this distribution.
+//
+// **********************************************************************
+
+using System;
+using System.Linq;
+using System.Collections.Generic;
+using System.Windows.Forms;
+
+namespace client
+{
+ static class Program
+ {
+ /// <summary>
+ /// The main entry point for the application.
+ /// </summary>
+ [MTAThread]
+ static void Main()
+ {
+ Application.Run(new MainForm());
+ }
+ }
+}
\ No newline at end of file diff --git a/cs/demo/Ice/compact/README b/cs/demo/Ice/compact/hello/README.txt index af40ad420dc..71741d446f1 100644 --- a/cs/demo/Ice/compact/README +++ b/cs/demo/Ice/compact/hello/README.txt @@ -2,7 +2,7 @@ This demo shows how to write a simple C# client application using Ice for .NET Compact Framework (CF).
This demo requires a hello server. You can use the C# server located
-in ..\hello, or you can use a server from any other language mapping.
+in ..\..\hello, or you can use a server from any other language mapping.
You must use Visual Studio 2008 to build this client (Visual Studio
2010 does not support Compact Framework development). Follow these
diff --git a/cs/demo/Ice/compact/Ice.compact.client.csproj b/cs/demo/Ice/compact/hello/client.csproj index d97e53c724d..255657f4b27 100644 --- a/cs/demo/Ice/compact/Ice.compact.client.csproj +++ b/cs/demo/Ice/compact/hello/client.csproj @@ -2,7 +2,7 @@ <PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ProductVersion>9.0.30729</ProductVersion>
+ <ProductVersion>9.0.21022</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{95E6B539-E515-4BD4-BDB0-35D7C49C897D}</ProjectGuid>
<OutputType>WinExe</OutputType>
@@ -73,7 +73,9 @@ </ItemGroup>
<ItemGroup>
<None Include="Hello.ice" />
- <None Include="README" />
+ </ItemGroup>
+ <ItemGroup>
+ <Content Include="README.txt" />
</ItemGroup>
<ItemGroup>
<Folder Include="Properties\" />
@@ -84,7 +86,7 @@ <FlavorProperties GUID="{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}">
<HostingProcess disable="1" />
</FlavorProperties>
- <UserProperties ZerocIce_VerboseLevel="1" ZerocIce_Enabled="True" />
+ <UserProperties ZerocIce_Enabled="True" ZerocIce_VerboseLevel="1" />
</VisualStudio>
</ProjectExtensions>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
@@ -94,4 +96,4 @@ <Target Name="AfterBuild">
</Target>
-->
-</Project>
+</Project>
\ No newline at end of file diff --git a/cs/demo/Ice/sl/bidir/README.txt b/cs/demo/Ice/sl/bidir/README.txt new file mode 100644 index 00000000000..70f10f9f5f2 --- /dev/null +++ b/cs/demo/Ice/sl/bidir/README.txt @@ -0,0 +1,40 @@ +This demo shows how to use bidirectional connections for callbacks. +This is typically used if the server cannot open a connection to the +client to send callbacks, for example, because firewalls block +incoming connections to the client. + +1) You can use a server from any Ice language mapping, befofe starting + the server, you must edit the server endpoints to use a port in the + range allowed by Silverlight. + + Edit the config.server file in the server bidir demo directory and + update the property Callback.Server.Endpoints as follow: + + Callback.Server.Endpoints=tcp -p 4502 + +2) Start the bidir server following the instructions in the demo + README file. + +3) In a command window, start the policy server. + + > cd <Ice installation directory>\bin + > policyserver 127.0.0.1 ..\config\PolicyResponse.xml + +4) From Visual Studio open the `bidir.Web' and start the bidir + Silverlight application using the "Debug > Start new instance" + command. + +========================================================================== +Running the demo with .NET Compact Framework bidir server +========================================================================== + +1) Start the bidir server following the instructions in the + demo\Ice\compact\bidir\README.txt file, before clicking the `Start + Server' button update the port field to 4502 + +2) In the bidir demo "Properties > Debug" select Out-of-browser + application, and in the combo box select bidir. + +3) Start the bidir client using the "Debug > Start new instance" + command, set the host field to the ip address used by the emulator, + and click Run. diff --git a/cs/demo/Ice/sl/bidir/bidir.Web/Properties/AssemblyInfo.cs b/cs/demo/Ice/sl/bidir/bidir.Web/Properties/AssemblyInfo.cs new file mode 100644 index 00000000000..efbd66fd1b0 --- /dev/null +++ b/cs/demo/Ice/sl/bidir/bidir.Web/Properties/AssemblyInfo.cs @@ -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("bidir.Web")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("ZeroC")]
+[assembly: AssemblyProduct("bidir.Web")]
+[assembly: AssemblyCopyright("Copyright © ZeroC 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("4103934e-4e04-41e4-887a-5fc00f302aea")]
+
+// 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")]
diff --git a/cs/demo/Ice/sl/bidir/bidir.Web/Silverlight.js b/cs/demo/Ice/sl/bidir/bidir.Web/Silverlight.js new file mode 100644 index 00000000000..15e04097676 --- /dev/null +++ b/cs/demo/Ice/sl/bidir/bidir.Web/Silverlight.js @@ -0,0 +1,2 @@ +//v2.0.30511.0
+if(!window.Silverlight)window.Silverlight={};Silverlight._silverlightCount=0;Silverlight.__onSilverlightInstalledCalled=false;Silverlight.fwlinkRoot="http://go2.microsoft.com/fwlink/?LinkID=";Silverlight.__installationEventFired=false;Silverlight.onGetSilverlight=null;Silverlight.onSilverlightInstalled=function(){window.location.reload(false)};Silverlight.isInstalled=function(b){if(b==undefined)b=null;var a=false,m=null;try{var i=null,j=false;if(window.ActiveXObject)try{i=new ActiveXObject("AgControl.AgControl");if(b===null)a=true;else if(i.IsVersionSupported(b))a=true;i=null}catch(l){j=true}else j=true;if(j){var k=navigator.plugins["Silverlight Plug-In"];if(k)if(b===null)a=true;else{var h=k.description;if(h==="1.0.30226.2")h="2.0.30226.2";var c=h.split(".");while(c.length>3)c.pop();while(c.length<4)c.push(0);var e=b.split(".");while(e.length>4)e.pop();var d,g,f=0;do{d=parseInt(e[f]);g=parseInt(c[f]);f++}while(f<e.length&&d===g);if(d<=g&&!isNaN(d))a=true}}}catch(l){a=false}return a};Silverlight.WaitForInstallCompletion=function(){if(!Silverlight.isBrowserRestartRequired&&Silverlight.onSilverlightInstalled){try{navigator.plugins.refresh()}catch(a){}if(Silverlight.isInstalled(null)&&!Silverlight.__onSilverlightInstalledCalled){Silverlight.onSilverlightInstalled();Silverlight.__onSilverlightInstalledCalled=true}else setTimeout(Silverlight.WaitForInstallCompletion,3e3)}};Silverlight.__startup=function(){navigator.plugins.refresh();Silverlight.isBrowserRestartRequired=Silverlight.isInstalled(null);if(!Silverlight.isBrowserRestartRequired){Silverlight.WaitForInstallCompletion();if(!Silverlight.__installationEventFired){Silverlight.onInstallRequired();Silverlight.__installationEventFired=true}}else if(window.navigator.mimeTypes){var b=navigator.mimeTypes["application/x-silverlight-2"],c=navigator.mimeTypes["application/x-silverlight-2-b2"],d=navigator.mimeTypes["application/x-silverlight-2-b1"],a=d;if(c)a=c;if(!b&&(d||c)){if(!Silverlight.__installationEventFired){Silverlight.onUpgradeRequired();Silverlight.__installationEventFired=true}}else if(b&&a)if(b.enabledPlugin&&a.enabledPlugin)if(b.enabledPlugin.description!=a.enabledPlugin.description)if(!Silverlight.__installationEventFired){Silverlight.onRestartRequired();Silverlight.__installationEventFired=true}}if(!Silverlight.disableAutoStartup)if(window.removeEventListener)window.removeEventListener("load",Silverlight.__startup,false);else window.detachEvent("onload",Silverlight.__startup)};if(!Silverlight.disableAutoStartup)if(window.addEventListener)window.addEventListener("load",Silverlight.__startup,false);else window.attachEvent("onload",Silverlight.__startup);Silverlight.createObject=function(m,f,e,k,l,h,j){var d={},a=k,c=l;d.version=a.version;a.source=m;d.alt=a.alt;if(h)a.initParams=h;if(a.isWindowless&&!a.windowless)a.windowless=a.isWindowless;if(a.framerate&&!a.maxFramerate)a.maxFramerate=a.framerate;if(e&&!a.id)a.id=e;delete a.ignoreBrowserVer;delete a.inplaceInstallPrompt;delete a.version;delete a.isWindowless;delete a.framerate;delete a.data;delete a.src;delete a.alt;if(Silverlight.isInstalled(d.version)){for(var b in c)if(c[b]){if(b=="onLoad"&&typeof c[b]=="function"&&c[b].length!=1){var i=c[b];c[b]=function(a){return i(document.getElementById(e),j,a)}}var g=Silverlight.__getHandlerName(c[b]);if(g!=null){a[b]=g;c[b]=null}else throw"typeof events."+b+" must be 'function' or 'string'";}slPluginHTML=Silverlight.buildHTML(a)}else slPluginHTML=Silverlight.buildPromptHTML(d);if(f)f.innerHTML=slPluginHTML;else return slPluginHTML};Silverlight.buildHTML=function(a){var b=[];b.push('<object type="application/x-silverlight" data="data:application/x-silverlight,"');if(a.id!=null)b.push(' id="'+Silverlight.HtmlAttributeEncode(a.id)+'"');if(a.width!=null)b.push(' width="'+a.width+'"');if(a.height!=null)b.push(' height="'+a.height+'"');b.push(" >");delete a.id;delete a.width;delete a.height;for(var c in a)if(a[c])b.push('<param name="'+Silverlight.HtmlAttributeEncode(c)+'" value="'+Silverlight.HtmlAttributeEncode(a[c])+'" />');b.push("</object>");return b.join("")};Silverlight.createObjectEx=function(b){var a=b,c=Silverlight.createObject(a.source,a.parentElement,a.id,a.properties,a.events,a.initParams,a.context);if(a.parentElement==null)return c};Silverlight.buildPromptHTML=function(b){var a="",d=Silverlight.fwlinkRoot,c=b.version;if(b.alt)a=b.alt;else{if(!c)c="";a="<a href='javascript:Silverlight.getSilverlight(\"{1}\");' style='text-decoration: none;'><img src='{2}' alt='Get Microsoft Silverlight' style='border-style: none'/></a>";a=a.replace("{1}",c);a=a.replace("{2}",d+"108181")}return a};Silverlight.getSilverlight=function(e){if(Silverlight.onGetSilverlight)Silverlight.onGetSilverlight();var b="",a=String(e).split(".");if(a.length>1){var c=parseInt(a[0]);if(isNaN(c)||c<2)b="1.0";else b=a[0]+"."+a[1]}var d="";if(b.match(/^\d+\056\d+$/))d="&v="+b;Silverlight.followFWLink("149156"+d)};Silverlight.followFWLink=function(a){top.location=Silverlight.fwlinkRoot+String(a)};Silverlight.HtmlAttributeEncode=function(c){var a,b="";if(c==null)return null;for(var d=0;d<c.length;d++){a=c.charCodeAt(d);if(a>96&&a<123||a>64&&a<91||a>43&&a<58&&a!=47||a==95)b=b+String.fromCharCode(a);else b=b+"&#"+a+";"}return b};Silverlight.default_error_handler=function(e,b){var d,c=b.ErrorType;d=b.ErrorCode;var a="\nSilverlight error message \n";a+="ErrorCode: "+d+"\n";a+="ErrorType: "+c+" \n";a+="Message: "+b.ErrorMessage+" \n";if(c=="ParserError"){a+="XamlFile: "+b.xamlFile+" \n";a+="Line: "+b.lineNumber+" \n";a+="Position: "+b.charPosition+" \n"}else if(c=="RuntimeError"){if(b.lineNumber!=0){a+="Line: "+b.lineNumber+" \n";a+="Position: "+b.charPosition+" \n"}a+="MethodName: "+b.methodName+" \n"}alert(a)};Silverlight.__cleanup=function(){for(var a=Silverlight._silverlightCount-1;a>=0;a--)window["__slEvent"+a]=null;Silverlight._silverlightCount=0;if(window.removeEventListener)window.removeEventListener("unload",Silverlight.__cleanup,false);else window.detachEvent("onunload",Silverlight.__cleanup)};Silverlight.__getHandlerName=function(b){var a="";if(typeof b=="string")a=b;else if(typeof b=="function"){if(Silverlight._silverlightCount==0)if(window.addEventListener)window.addEventListener("onunload",Silverlight.__cleanup,false);else window.attachEvent("onunload",Silverlight.__cleanup);var c=Silverlight._silverlightCount++;a="__slEvent"+c;window[a]=b}else a=null;return a};Silverlight.onRequiredVersionAvailable=function(){};Silverlight.onRestartRequired=function(){};Silverlight.onUpgradeRequired=function(){};Silverlight.onInstallRequired=function(){};Silverlight.IsVersionAvailableOnError=function(d,a){var b=false;try{if(a.ErrorCode==8001&&!Silverlight.__installationEventFired){Silverlight.onUpgradeRequired();Silverlight.__installationEventFired=true}else if(a.ErrorCode==8002&&!Silverlight.__installationEventFired){Silverlight.onRestartRequired();Silverlight.__installationEventFired=true}else if(a.ErrorCode==5014||a.ErrorCode==2106){if(Silverlight.__verifySilverlight2UpgradeSuccess(a.getHost()))b=true}else b=true}catch(c){}return b};Silverlight.IsVersionAvailableOnLoad=function(b){var a=false;try{if(Silverlight.__verifySilverlight2UpgradeSuccess(b.getHost()))a=true}catch(c){}return a};Silverlight.__verifySilverlight2UpgradeSuccess=function(d){var c=false,b="2.0.31005",a=null;try{if(d.IsVersionSupported(b+".99")){a=Silverlight.onRequiredVersionAvailable;c=true}else if(d.IsVersionSupported(b+".0"))a=Silverlight.onRestartRequired;else a=Silverlight.onUpgradeRequired;if(a&&!Silverlight.__installationEventFired){a();Silverlight.__installationEventFired=true}}catch(e){}return c}
\ No newline at end of file diff --git a/cs/demo/Ice/sl/bidir/bidir.Web/Web.Debug.config b/cs/demo/Ice/sl/bidir/bidir.Web/Web.Debug.config new file mode 100644 index 00000000000..962e6b73a26 --- /dev/null +++ b/cs/demo/Ice/sl/bidir/bidir.Web/Web.Debug.config @@ -0,0 +1,30 @@ +<?xml version="1.0"?>
+
+<!-- For more information on using web.config transformation visit http://go.microsoft.com/fwlink/?LinkId=125889 -->
+
+<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
+ <!--
+ In the example below, the "SetAttributes" transform will change the value of
+ "connectionString" to use "ReleaseSQLServer" only when the "Match" locator
+ finds an atrribute "name" that has a value of "MyDB".
+
+ <connectionStrings>
+ <add name="MyDB"
+ connectionString="Data Source=ReleaseSQLServer;Initial Catalog=MyReleaseDB;Integrated Security=True"
+ xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/>
+ </connectionStrings>
+ -->
+ <system.web>
+ <!--
+ In the example below, the "Replace" transform will replace the entire
+ <customErrors> section of your web.config file.
+ Note that because there is only one customErrors section under the
+ <system.web> node, there is no need to use the "xdt:Locator" attribute.
+
+ <customErrors defaultRedirect="GenericError.htm"
+ mode="RemoteOnly" xdt:Transform="Replace">
+ <error statusCode="500" redirect="InternalError.htm"/>
+ </customErrors>
+ -->
+ </system.web>
+</configuration>
\ No newline at end of file diff --git a/cs/demo/Ice/sl/bidir/bidir.Web/Web.Release.config b/cs/demo/Ice/sl/bidir/bidir.Web/Web.Release.config new file mode 100644 index 00000000000..141832ba77e --- /dev/null +++ b/cs/demo/Ice/sl/bidir/bidir.Web/Web.Release.config @@ -0,0 +1,31 @@ +<?xml version="1.0"?>
+
+<!-- For more information on using web.config transformation visit http://go.microsoft.com/fwlink/?LinkId=125889 -->
+
+<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
+ <!--
+ In the example below, the "SetAttributes" transform will change the value of
+ "connectionString" to use "ReleaseSQLServer" only when the "Match" locator
+ finds an atrribute "name" that has a value of "MyDB".
+
+ <connectionStrings>
+ <add name="MyDB"
+ connectionString="Data Source=ReleaseSQLServer;Initial Catalog=MyReleaseDB;Integrated Security=True"
+ xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/>
+ </connectionStrings>
+ -->
+ <system.web>
+ <compilation xdt:Transform="RemoveAttributes(debug)" />
+ <!--
+ In the example below, the "Replace" transform will replace the entire
+ <customErrors> section of your web.config file.
+ Note that because there is only one customErrors section under the
+ <system.web> node, there is no need to use the "xdt:Locator" attribute.
+
+ <customErrors defaultRedirect="GenericError.htm"
+ mode="RemoteOnly" xdt:Transform="Replace">
+ <error statusCode="500" redirect="InternalError.htm"/>
+ </customErrors>
+ -->
+ </system.web>
+</configuration>
\ No newline at end of file diff --git a/cs/demo/Ice/sl/bidir/bidir.Web/Web.config b/cs/demo/Ice/sl/bidir/bidir.Web/Web.config new file mode 100644 index 00000000000..0598be112f3 --- /dev/null +++ b/cs/demo/Ice/sl/bidir/bidir.Web/Web.config @@ -0,0 +1,13 @@ +<?xml version="1.0"?>
+
+<!--
+ For more information on how to configure your ASP.NET application, please visit
+ http://go.microsoft.com/fwlink/?LinkId=169433
+ -->
+
+<configuration>
+ <system.web>
+ <compilation debug="true" targetFramework="4.0" />
+ </system.web>
+
+</configuration>
diff --git a/cs/demo/Ice/sl/bidir/bidir.Web/bidir.Web.csproj b/cs/demo/Ice/sl/bidir/bidir.Web/bidir.Web.csproj new file mode 100644 index 00000000000..ac79f2dc89c --- /dev/null +++ b/cs/demo/Ice/sl/bidir/bidir.Web/bidir.Web.csproj @@ -0,0 +1,99 @@ +<?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>
+ </ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{0F089AE9-9F65-4C33-9F1F-183C6AC6E043}</ProjectGuid>
+ <ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>bidir.Web</RootNamespace>
+ <AssemblyName>bidir.Web</AssemblyName>
+ <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+ <UseIISExpress>false</UseIISExpress>
+ <SilverlightApplicationList>{73FE67BB-A2C1-464A-8F84-7B1282288CBA}|..\bidir\bidir.csproj|ClientBin|False</SilverlightApplicationList>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\</OutputPath>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>bin\</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="Microsoft.CSharp" />
+ <Reference Include="System.Web.DynamicData" />
+ <Reference Include="System.Web.Entity" />
+ <Reference Include="System.Web.ApplicationServices" />
+ <Reference Include="System" />
+ <Reference Include="System.Data" />
+ <Reference Include="System.Core" />
+ <Reference Include="System.Data.DataSetExtensions" />
+ <Reference Include="System.Web.Extensions" />
+ <Reference Include="System.Xml.Linq" />
+ <Reference Include="System.Drawing" />
+ <Reference Include="System.Web" />
+ <Reference Include="System.Xml" />
+ <Reference Include="System.Configuration" />
+ <Reference Include="System.Web.Services" />
+ <Reference Include="System.EnterpriseServices" />
+ </ItemGroup>
+ <ItemGroup>
+ <Content Include="bidirTestPage.aspx" />
+ <Content Include="bidirTestPage.html" />
+ <Content Include="ClientBin\bidir.xap" />
+ <Content Include="Silverlight.js" />
+ <Content Include="Web.config" />
+ <Content Include="Web.Debug.config">
+ <DependentUpon>Web.config</DependentUpon>
+ </Content>
+ <Content Include="Web.Release.config">
+ <DependentUpon>Web.config</DependentUpon>
+ </Content>
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ </ItemGroup>
+ <ItemGroup />
+ <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
+ <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" />
+ <ProjectExtensions>
+ <VisualStudio>
+ <FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
+ <WebProjectProperties>
+ <UseIIS>False</UseIIS>
+ <AutoAssignPort>True</AutoAssignPort>
+ <DevelopmentServerPort>49183</DevelopmentServerPort>
+ <DevelopmentServerVPath>/</DevelopmentServerVPath>
+ <IISUrl>
+ </IISUrl>
+ <NTLMAuthentication>False</NTLMAuthentication>
+ <UseCustomServer>False</UseCustomServer>
+ <CustomServerUrl>
+ </CustomServerUrl>
+ <SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
+ </WebProjectProperties>
+ </FlavorProperties>
+ </VisualStudio>
+ </ProjectExtensions>
+ <!-- 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>
+ -->
+</Project>
\ No newline at end of file diff --git a/cs/demo/Ice/sl/bidir/bidir.Web/bidirTestPage.aspx b/cs/demo/Ice/sl/bidir/bidir.Web/bidirTestPage.aspx new file mode 100644 index 00000000000..254083260d4 --- /dev/null +++ b/cs/demo/Ice/sl/bidir/bidir.Web/bidirTestPage.aspx @@ -0,0 +1,74 @@ +<%@ Page Language="C#" AutoEventWireup="true" %>
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" >
+<head runat="server">
+ <title>bidir</title>
+ <style type="text/css">
+ html, body {
+ height: 100%;
+ overflow: auto;
+ }
+ body {
+ padding: 0;
+ margin: 0;
+ }
+ #silverlightControlHost {
+ height: 100%;
+ text-align:center;
+ }
+ </style>
+ <script type="text/javascript" src="Silverlight.js"></script>
+ <script type="text/javascript">
+ function onSilverlightError(sender, args) {
+ var appSource = "";
+ if (sender != null && sender != 0) {
+ appSource = sender.getHost().Source;
+ }
+
+ var errorType = args.ErrorType;
+ var iErrorCode = args.ErrorCode;
+
+ if (errorType == "ImageError" || errorType == "MediaError") {
+ return;
+ }
+
+ var errMsg = "Unhandled Error in Silverlight Application " + appSource + "\n" ;
+
+ errMsg += "Code: "+ iErrorCode + " \n";
+ errMsg += "Category: " + errorType + " \n";
+ errMsg += "Message: " + args.ErrorMessage + " \n";
+
+ if (errorType == "ParserError") {
+ errMsg += "File: " + args.xamlFile + " \n";
+ errMsg += "Line: " + args.lineNumber + " \n";
+ errMsg += "Position: " + args.charPosition + " \n";
+ }
+ else if (errorType == "RuntimeError") {
+ if (args.lineNumber != 0) {
+ errMsg += "Line: " + args.lineNumber + " \n";
+ errMsg += "Position: " + args.charPosition + " \n";
+ }
+ errMsg += "MethodName: " + args.methodName + " \n";
+ }
+
+ throw new Error(errMsg);
+ }
+ </script>
+</head>
+<body>
+ <form id="form1" runat="server" style="height:100%">
+ <div id="silverlightControlHost">
+ <object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="100%" height="100%">
+ <param name="source" value="ClientBin/bidir.xap"/>
+ <param name="onError" value="onSilverlightError" />
+ <param name="background" value="white" />
+ <param name="minRuntimeVersion" value="5.0.61118.0" />
+ <param name="autoUpgrade" value="true" />
+ <a href="http://go.microsoft.com/fwlink/?LinkID=149156&v=5.0.61118.0" style="text-decoration:none">
+ <img src="http://go.microsoft.com/fwlink/?LinkId=161376" alt="Get Microsoft Silverlight" style="border-style:none"/>
+ </a>
+ </object><iframe id="_sl_historyFrame" style="visibility:hidden;height:0px;width:0px;border:0px"></iframe></div>
+ </form>
+</body>
+</html>
diff --git a/cs/demo/Ice/sl/bidir/bidir.Web/bidirTestPage.html b/cs/demo/Ice/sl/bidir/bidir.Web/bidirTestPage.html new file mode 100644 index 00000000000..8eecd7e7a94 --- /dev/null +++ b/cs/demo/Ice/sl/bidir/bidir.Web/bidirTestPage.html @@ -0,0 +1,73 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" >
+
+<head>
+ <title>bidir</title>
+ <style type="text/css">
+ html, body {
+ height: 100%;
+ overflow: auto;
+ }
+ body {
+ padding: 0;
+ margin: 0;
+ }
+ #silverlightControlHost {
+ height: 100%;
+ text-align:center;
+ }
+ </style>
+ <script type="text/javascript" src="Silverlight.js"></script>
+ <script type="text/javascript">
+ function onSilverlightError(sender, args) {
+ var appSource = "";
+ if (sender != null && sender != 0) {
+ appSource = sender.getHost().Source;
+ }
+
+ var errorType = args.ErrorType;
+ var iErrorCode = args.ErrorCode;
+
+ if (errorType == "ImageError" || errorType == "MediaError") {
+ return;
+ }
+
+ var errMsg = "Unhandled Error in Silverlight Application " + appSource + "\n" ;
+
+ errMsg += "Code: "+ iErrorCode + " \n";
+ errMsg += "Category: " + errorType + " \n";
+ errMsg += "Message: " + args.ErrorMessage + " \n";
+
+ if (errorType == "ParserError") {
+ errMsg += "File: " + args.xamlFile + " \n";
+ errMsg += "Line: " + args.lineNumber + " \n";
+ errMsg += "Position: " + args.charPosition + " \n";
+ }
+ else if (errorType == "RuntimeError") {
+ if (args.lineNumber != 0) {
+ errMsg += "Line: " + args.lineNumber + " \n";
+ errMsg += "Position: " + args.charPosition + " \n";
+ }
+ errMsg += "MethodName: " + args.methodName + " \n";
+ }
+
+ throw new Error(errMsg);
+ }
+ </script>
+</head>
+<body>
+ <form id="form1" runat="server" style="height:100%">
+ <div id="silverlightControlHost">
+ <object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="100%" height="100%">
+ <param name="source" value="ClientBin/bidir.xap"/>
+ <param name="onError" value="onSilverlightError" />
+ <param name="background" value="white" />
+ <param name="minRuntimeVersion" value="5.0.61118.0" />
+ <param name="autoUpgrade" value="true" />
+ <a href="http://go.microsoft.com/fwlink/?LinkID=149156&v=5.0.61118.0" style="text-decoration:none">
+ <img src="http://go.microsoft.com/fwlink/?LinkId=161376" alt="Get Microsoft Silverlight" style="border-style:none"/>
+ </a>
+ </object><iframe id="_sl_historyFrame" style="visibility:hidden;height:0px;width:0px;border:0px"></iframe></div>
+ </form>
+</body>
+</html>
diff --git a/cs/demo/Ice/sl/bidir/bidir/.gitignore b/cs/demo/Ice/sl/bidir/bidir/.gitignore new file mode 100644 index 00000000000..33d778217a5 --- /dev/null +++ b/cs/demo/Ice/sl/bidir/bidir/.gitignore @@ -0,0 +1,3 @@ +# Dummy file, so that git retains this otherwise empty directory. +Callback.cs +Bin/* diff --git a/cs/demo/Ice/sl/bidir/bidir/App.xaml b/cs/demo/Ice/sl/bidir/bidir/App.xaml new file mode 100644 index 00000000000..c6b2efe457f --- /dev/null +++ b/cs/demo/Ice/sl/bidir/bidir/App.xaml @@ -0,0 +1,8 @@ +<Application xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ x:Class="bidir.App"
+ >
+ <Application.Resources>
+
+ </Application.Resources>
+</Application>
diff --git a/cs/demo/Ice/sl/bidir/bidir/App.xaml.cs b/cs/demo/Ice/sl/bidir/bidir/App.xaml.cs new file mode 100644 index 00000000000..0b29c25a123 --- /dev/null +++ b/cs/demo/Ice/sl/bidir/bidir/App.xaml.cs @@ -0,0 +1,77 @@ +// **********************************************************************
+//
+// Copyright (c) 2003-2011 ZeroC, Inc. All rights reserved.
+//
+// This copy of Ice is licensed to you under the terms described in the
+// ICE_LICENSE file included in this distribution.
+//
+// **********************************************************************
+
+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 bidir
+{
+ 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)
+ {
+ this.RootVisual = new MainPage();
+ }
+
+ 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)
+ {
+ }
+ }
+ }
+}
diff --git a/cs/demo/Ice/sl/bidir/bidir/Callback.ice b/cs/demo/Ice/sl/bidir/bidir/Callback.ice new file mode 100644 index 00000000000..73749b8ac28 --- /dev/null +++ b/cs/demo/Ice/sl/bidir/bidir/Callback.ice @@ -0,0 +1,27 @@ +// ********************************************************************** +// +// Copyright (c) 2003-2011 ZeroC, Inc. All rights reserved. +// +// This copy of Ice is licensed to you under the terms described in the +// ICE_LICENSE file included in this distribution. +// +// ********************************************************************** + +#pragma once + +#include <Ice/Identity.ice> + +module Demo +{ + +interface CallbackReceiver +{ + void callback(int num); +}; + +interface CallbackSender +{ + void addClient(Ice::Identity ident); +}; + +}; diff --git a/cs/demo/Ice/sl/bidir/bidir/CallbackReceiverI.cs b/cs/demo/Ice/sl/bidir/bidir/CallbackReceiverI.cs new file mode 100644 index 00000000000..f1344304c47 --- /dev/null +++ b/cs/demo/Ice/sl/bidir/bidir/CallbackReceiverI.cs @@ -0,0 +1,38 @@ +// **********************************************************************
+//
+// Copyright (c) 2003-2011 ZeroC, Inc. All rights reserved.
+//
+// This copy of Ice is licensed to you under the terms described in the
+// ICE_LICENSE file included in this distribution.
+//
+// **********************************************************************
+
+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 Demo;
+
+namespace bidir
+{
+ public class CallbackReceiverI : CallbackReceiverDisp_
+ {
+ public CallbackReceiverI(MainPage page)
+ {
+ _page = page;
+ }
+
+ public override void callback(int num, Ice.Current current)
+ {
+ _page.appendText("received callback #" + num.ToString() + Environment.NewLine);
+ }
+
+ private MainPage _page;
+ }
+}
diff --git a/cs/demo/Ice/sl/bidir/bidir/MainPage.xaml b/cs/demo/Ice/sl/bidir/bidir/MainPage.xaml new file mode 100644 index 00000000000..2c82f736ce1 --- /dev/null +++ b/cs/demo/Ice/sl/bidir/bidir/MainPage.xaml @@ -0,0 +1,30 @@ +<UserControl x:Class="bidir.MainPage"
+ 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"
+ d:DesignHeight="300" d:DesignWidth="400">
+
+ <StackPanel Margin="10, 10, 10, 10" HorizontalAlignment="Center">
+ <StackPanel Orientation="Horizontal" VerticalAlignment="Center"
+ Margin="5, 5, 5, 5">
+ <TextBlock Text="Host:" Height="25" Width="80" VerticalAlignment="Center"/>
+ <TextBox x:Name="txtHost" HorizontalAlignment="Left"
+ Text="localhost"
+ TextWrapping="NoWrap"
+ VerticalAlignment="Top" Height="25" Width="320"/>
+ </StackPanel>
+ <Grid Margin="5, 5, 5, 5">
+ <TextBox x:Name="txtOutput"
+ FontSize="12" Text="" TextWrapping="Wrap" IsEnabled="True" Height="120"
+ Width="400" HorizontalScrollBarVisibility="Hidden"
+ VerticalScrollBarVisibility="Visible" IsReadOnly="True"/>
+ </Grid>
+ <StackPanel Orientation="Horizontal" VerticalAlignment="Center"
+ Margin="5, 5, 5, 5">
+ <Button Name="btnRun" Content="Run" Click="btnRunClick"/>
+ <Button Name="btnStop" Content="Stop" Margin="5, 0, 0, 0" Click="btnStopClick"/>
+ </StackPanel>
+ </StackPanel>
+</UserControl>
diff --git a/cs/demo/Ice/sl/bidir/bidir/MainPage.xaml.cs b/cs/demo/Ice/sl/bidir/bidir/MainPage.xaml.cs new file mode 100644 index 00000000000..1bff6219a38 --- /dev/null +++ b/cs/demo/Ice/sl/bidir/bidir/MainPage.xaml.cs @@ -0,0 +1,138 @@ +// **********************************************************************
+//
+// Copyright (c) 2003-2011 ZeroC, Inc. All rights reserved.
+//
+// This copy of Ice is licensed to you under the terms described in the
+// ICE_LICENSE file included in this distribution.
+//
+// **********************************************************************
+
+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 Demo;
+
+namespace bidir
+{
+ public partial class MainPage : UserControl
+ {
+ public MainPage()
+ {
+ InitializeComponent();
+ }
+
+ private void btnRunClick(object sender, RoutedEventArgs e)
+ {
+ string host = txtHost.Text;
+ txtOutput.Text = "";
+ btnRun.IsEnabled = false;
+ btnStop.IsEnabled = true;
+
+ Ice.InitializationData initData = new Ice.InitializationData();
+ initData.dispatcher = delegate(System.Action action, Ice.Connection connection)
+ {
+ Dispatcher.BeginInvoke(action);
+ };
+ _communicator = Ice.Util.initialize(initData);
+
+ CallbackSenderPrx server = CallbackSenderPrxHelper.uncheckedCast(
+ _communicator.stringToProxy("sender:tcp -h " + host + " -p 4502"));
+ if(server == null)
+ {
+ throw new ArgumentException("invalid proxy");
+ }
+
+ Ice.ObjectAdapter adapter = _communicator.createObjectAdapter("");
+ Ice.Identity ident = new Ice.Identity();
+ ident.name = Guid.NewGuid().ToString();
+ ident.category = "";
+ adapter.add(new CallbackReceiverI(this), ident);
+ adapter.activate();
+
+ //
+ // Establish the connection to the server by sending a ping request with AMI.
+ //
+ server.begin_ice_ping().whenCompleted(
+ () =>
+ {
+ //
+ // Associate the object adapter to the connection to receive requests
+ // over the bi-directional connection.
+ //
+ server.ice_getCachedConnection().setAdapter(adapter);
+
+ //
+ // Notify the server that we are ready to receive callbacks.
+ //
+ server.begin_addClient(ident).whenCompleted(
+ () =>
+ {
+ // Nothing to do.
+ },
+ (Ice.Exception ex) =>
+ {
+ appendText(ex.ToString());
+ });
+ },
+ (Ice.Exception ex) =>
+ {
+ appendText(ex.ToString());
+ });
+ }
+
+ private void btnStopClick(object sender, RoutedEventArgs e)
+ {
+ btnRun.IsEnabled = false;
+ btnStop.IsEnabled = false;
+
+ System.Threading.Thread t = new System.Threading.Thread(() =>
+ {
+ try
+ {
+ if (_communicator != null)
+ {
+ _communicator.destroy();
+ _communicator.waitForShutdown();
+ }
+ }
+ catch (Ice.CommunicatorDestroyedException)
+ {
+ }
+ catch (System.Exception ex)
+ {
+ Dispatcher.BeginInvoke(() =>
+ {
+ appendText(ex.ToString());
+ });
+ }
+ finally
+ {
+ _communicator = null;
+ Dispatcher.BeginInvoke(() =>
+ {
+ btnRun.IsEnabled = true;
+ btnStop.IsEnabled = false;
+ });
+ }
+ });
+ t.Start();
+ }
+
+ public void appendText(string text)
+ {
+ txtOutput.Text += text;
+ txtOutput.SelectionLength = 0;
+ txtOutput.SelectionStart = txtOutput.Text.Length;
+ }
+
+ private Ice.Communicator _communicator;
+ }
+}
diff --git a/cs/demo/Ice/sl/bidir/bidir/Properties/AppManifest.xml b/cs/demo/Ice/sl/bidir/bidir/Properties/AppManifest.xml new file mode 100644 index 00000000000..a9552327529 --- /dev/null +++ b/cs/demo/Ice/sl/bidir/bidir/Properties/AppManifest.xml @@ -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>
diff --git a/cs/demo/Ice/sl/bidir/bidir/Properties/AssemblyInfo.cs b/cs/demo/Ice/sl/bidir/bidir/Properties/AssemblyInfo.cs new file mode 100644 index 00000000000..9f6ef51375b --- /dev/null +++ b/cs/demo/Ice/sl/bidir/bidir/Properties/AssemblyInfo.cs @@ -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("bidir")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("ZeroC")]
+[assembly: AssemblyProduct("bidir")]
+[assembly: AssemblyCopyright("Copyright © ZeroC 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("f2750723-68b2-4743-93ad-319cc69fe014")]
+
+// 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")]
diff --git a/cs/demo/Ice/sl/bidir/bidir/Properties/OutOfBrowserSettings.xml b/cs/demo/Ice/sl/bidir/bidir/Properties/OutOfBrowserSettings.xml new file mode 100644 index 00000000000..17143a20e83 --- /dev/null +++ b/cs/demo/Ice/sl/bidir/bidir/Properties/OutOfBrowserSettings.xml @@ -0,0 +1,10 @@ +<OutOfBrowserSettings ShortName="Bidir Demo" EnableGPUAcceleration="False" ShowInstallMenuItem="True">
+ <OutOfBrowserSettings.Blurb>Bidir Demo</OutOfBrowserSettings.Blurb>
+ <OutOfBrowserSettings.WindowSettings>
+ <WindowSettings Title="Bidir Demo" />
+ </OutOfBrowserSettings.WindowSettings>
+ <OutOfBrowserSettings.SecuritySettings>
+ <SecuritySettings ElevatedPermissions="Required" />
+ </OutOfBrowserSettings.SecuritySettings>
+ <OutOfBrowserSettings.Icons />
+</OutOfBrowserSettings>
\ No newline at end of file diff --git a/cs/demo/Ice/sl/bidir/bidir/bidir.csproj b/cs/demo/Ice/sl/bidir/bidir/bidir.csproj new file mode 100644 index 00000000000..5a5e33a6dd0 --- /dev/null +++ b/cs/demo/Ice/sl/bidir/bidir/bidir.csproj @@ -0,0 +1,118 @@ +<?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>8.0.50727</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{73FE67BB-A2C1-464A-8F84-7B1282288CBA}</ProjectGuid>
+ <ProjectTypeGuids>{A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>bidir</RootNamespace>
+ <AssemblyName>bidir</AssemblyName>
+ <TargetFrameworkIdentifier>Silverlight</TargetFrameworkIdentifier>
+ <TargetFrameworkVersion>v5.0</TargetFrameworkVersion>
+ <SilverlightVersion>$(TargetFrameworkVersion)</SilverlightVersion>
+ <SilverlightApplication>true</SilverlightApplication>
+ <SupportedCultures>
+ </SupportedCultures>
+ <XapOutputs>true</XapOutputs>
+ <GenerateSilverlightManifest>true</GenerateSilverlightManifest>
+ <XapFilename>bidir.xap</XapFilename>
+ <SilverlightManifestTemplate>Properties\AppManifest.xml</SilverlightManifestTemplate>
+ <SilverlightAppEntry>bidir.App</SilverlightAppEntry>
+ <TestPageFileName>bidirTestPage.html</TestPageFileName>
+ <CreateTestPage>true</CreateTestPage>
+ <ValidateXaml>true</ValidateXaml>
+ <EnableOutOfBrowser>true</EnableOutOfBrowser>
+ <OutOfBrowserSettingsFile>Properties\OutOfBrowserSettings.xml</OutOfBrowserSettingsFile>
+ <UsePlatformExtensions>false</UsePlatformExtensions>
+ <ThrowErrorsInValidation>true</ThrowErrorsInValidation>
+ <LinkedServerProject>
+ </LinkedServerProject>
+ </PropertyGroup>
+ <!-- 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="Ice, Version=3.4.2.0, Culture=neutral, PublicKeyToken=1f998c50fec78381, processorArchitecture=MSIL" />
+ <Reference Include="mscorlib" />
+ <Reference Include="System.Windows" />
+ <Reference Include="system" />
+ <Reference Include="System.Core" />
+ <Reference Include="System.Net" />
+ <Reference Include="System.Xml" />
+ <Reference Include="System.Windows.Browser" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="App.xaml.cs">
+ <DependentUpon>App.xaml</DependentUpon>
+ </Compile>
+ <Compile Include="Callback.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="CallbackReceiverI.cs" />
+ <Compile Include="MainPage.xaml.cs">
+ <DependentUpon>MainPage.xaml</DependentUpon>
+ </Compile>
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <ApplicationDefinition Include="App.xaml">
+ <SubType>Designer</SubType>
+ <Generator>MSBuild:Compile</Generator>
+ </ApplicationDefinition>
+ <Page Include="MainPage.xaml">
+ <SubType>Designer</SubType>
+ <Generator>MSBuild:Compile</Generator>
+ </Page>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="Callback.ice" />
+ <None Include="Properties\AppManifest.xml" />
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="Properties\OutOfBrowserSettings.xml" />
+ </ItemGroup>
+ <Import Project="$(MSBuildExtensionsPath32)\Microsoft\Silverlight\$(SilverlightVersion)\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>
+ <VisualStudio>
+ <FlavorProperties GUID="{A1591282-1198-4647-A2B1-27E5FF5F6F3B}">
+ <SilverlightProjectProperties />
+ </FlavorProperties>
+ <UserProperties ZerocIce_Enabled="True" />
+ </VisualStudio>
+ </ProjectExtensions>
+</Project>
\ No newline at end of file diff --git a/cs/demo/Ice/sl/hello/README.txt b/cs/demo/Ice/sl/hello/README.txt new file mode 100644 index 00000000000..fd0da905f25 --- /dev/null +++ b/cs/demo/Ice/sl/hello/README.txt @@ -0,0 +1,23 @@ +This demo illustrates how to invoke ordinary (twoway) operations,
+as well as how to make oneway, and batched invocations.
+
+1) You can use a server from any Ice language mapping, before starting
+ the server, you must edit the server endpoints to use a port in the
+ range allowed by Silverlight.
+
+ Edit the config.server file from the server hello demo directory
+ and update the property Hello.Endpoints as follow:
+
+ Hello.Endpoints=tcp -p 4502
+
+2) start the hello server following the instructions in the demo
+ README file.
+
+3) In a command window, start the policy server.
+
+ > cd <Ice installation directory>\bin
+ > policyserver 127.0.0.1 ..\config\PolicyResponse.xml
+
+4) From Visual Studio open the `hello.Web' project and start the hello
+ Silverlight application using the "Debug > Start new instance"
+ command.
diff --git a/cs/demo/Ice/sl/hello/hello.Web/Properties/AssemblyInfo.cs b/cs/demo/Ice/sl/hello/hello.Web/Properties/AssemblyInfo.cs new file mode 100644 index 00000000000..45caf87ffcf --- /dev/null +++ b/cs/demo/Ice/sl/hello/hello.Web/Properties/AssemblyInfo.cs @@ -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("hello.Web")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("ZeroC")]
+[assembly: AssemblyProduct("hello.Web")]
+[assembly: AssemblyCopyright("Copyright © ZeroC 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("95388ccc-9e43-42a4-bc49-c81d0a836c50")]
+
+// 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")]
diff --git a/cs/demo/Ice/sl/hello/hello.Web/Silverlight.js b/cs/demo/Ice/sl/hello/hello.Web/Silverlight.js new file mode 100644 index 00000000000..15e04097676 --- /dev/null +++ b/cs/demo/Ice/sl/hello/hello.Web/Silverlight.js @@ -0,0 +1,2 @@ +//v2.0.30511.0
+if(!window.Silverlight)window.Silverlight={};Silverlight._silverlightCount=0;Silverlight.__onSilverlightInstalledCalled=false;Silverlight.fwlinkRoot="http://go2.microsoft.com/fwlink/?LinkID=";Silverlight.__installationEventFired=false;Silverlight.onGetSilverlight=null;Silverlight.onSilverlightInstalled=function(){window.location.reload(false)};Silverlight.isInstalled=function(b){if(b==undefined)b=null;var a=false,m=null;try{var i=null,j=false;if(window.ActiveXObject)try{i=new ActiveXObject("AgControl.AgControl");if(b===null)a=true;else if(i.IsVersionSupported(b))a=true;i=null}catch(l){j=true}else j=true;if(j){var k=navigator.plugins["Silverlight Plug-In"];if(k)if(b===null)a=true;else{var h=k.description;if(h==="1.0.30226.2")h="2.0.30226.2";var c=h.split(".");while(c.length>3)c.pop();while(c.length<4)c.push(0);var e=b.split(".");while(e.length>4)e.pop();var d,g,f=0;do{d=parseInt(e[f]);g=parseInt(c[f]);f++}while(f<e.length&&d===g);if(d<=g&&!isNaN(d))a=true}}}catch(l){a=false}return a};Silverlight.WaitForInstallCompletion=function(){if(!Silverlight.isBrowserRestartRequired&&Silverlight.onSilverlightInstalled){try{navigator.plugins.refresh()}catch(a){}if(Silverlight.isInstalled(null)&&!Silverlight.__onSilverlightInstalledCalled){Silverlight.onSilverlightInstalled();Silverlight.__onSilverlightInstalledCalled=true}else setTimeout(Silverlight.WaitForInstallCompletion,3e3)}};Silverlight.__startup=function(){navigator.plugins.refresh();Silverlight.isBrowserRestartRequired=Silverlight.isInstalled(null);if(!Silverlight.isBrowserRestartRequired){Silverlight.WaitForInstallCompletion();if(!Silverlight.__installationEventFired){Silverlight.onInstallRequired();Silverlight.__installationEventFired=true}}else if(window.navigator.mimeTypes){var b=navigator.mimeTypes["application/x-silverlight-2"],c=navigator.mimeTypes["application/x-silverlight-2-b2"],d=navigator.mimeTypes["application/x-silverlight-2-b1"],a=d;if(c)a=c;if(!b&&(d||c)){if(!Silverlight.__installationEventFired){Silverlight.onUpgradeRequired();Silverlight.__installationEventFired=true}}else if(b&&a)if(b.enabledPlugin&&a.enabledPlugin)if(b.enabledPlugin.description!=a.enabledPlugin.description)if(!Silverlight.__installationEventFired){Silverlight.onRestartRequired();Silverlight.__installationEventFired=true}}if(!Silverlight.disableAutoStartup)if(window.removeEventListener)window.removeEventListener("load",Silverlight.__startup,false);else window.detachEvent("onload",Silverlight.__startup)};if(!Silverlight.disableAutoStartup)if(window.addEventListener)window.addEventListener("load",Silverlight.__startup,false);else window.attachEvent("onload",Silverlight.__startup);Silverlight.createObject=function(m,f,e,k,l,h,j){var d={},a=k,c=l;d.version=a.version;a.source=m;d.alt=a.alt;if(h)a.initParams=h;if(a.isWindowless&&!a.windowless)a.windowless=a.isWindowless;if(a.framerate&&!a.maxFramerate)a.maxFramerate=a.framerate;if(e&&!a.id)a.id=e;delete a.ignoreBrowserVer;delete a.inplaceInstallPrompt;delete a.version;delete a.isWindowless;delete a.framerate;delete a.data;delete a.src;delete a.alt;if(Silverlight.isInstalled(d.version)){for(var b in c)if(c[b]){if(b=="onLoad"&&typeof c[b]=="function"&&c[b].length!=1){var i=c[b];c[b]=function(a){return i(document.getElementById(e),j,a)}}var g=Silverlight.__getHandlerName(c[b]);if(g!=null){a[b]=g;c[b]=null}else throw"typeof events."+b+" must be 'function' or 'string'";}slPluginHTML=Silverlight.buildHTML(a)}else slPluginHTML=Silverlight.buildPromptHTML(d);if(f)f.innerHTML=slPluginHTML;else return slPluginHTML};Silverlight.buildHTML=function(a){var b=[];b.push('<object type="application/x-silverlight" data="data:application/x-silverlight,"');if(a.id!=null)b.push(' id="'+Silverlight.HtmlAttributeEncode(a.id)+'"');if(a.width!=null)b.push(' width="'+a.width+'"');if(a.height!=null)b.push(' height="'+a.height+'"');b.push(" >");delete a.id;delete a.width;delete a.height;for(var c in a)if(a[c])b.push('<param name="'+Silverlight.HtmlAttributeEncode(c)+'" value="'+Silverlight.HtmlAttributeEncode(a[c])+'" />');b.push("</object>");return b.join("")};Silverlight.createObjectEx=function(b){var a=b,c=Silverlight.createObject(a.source,a.parentElement,a.id,a.properties,a.events,a.initParams,a.context);if(a.parentElement==null)return c};Silverlight.buildPromptHTML=function(b){var a="",d=Silverlight.fwlinkRoot,c=b.version;if(b.alt)a=b.alt;else{if(!c)c="";a="<a href='javascript:Silverlight.getSilverlight(\"{1}\");' style='text-decoration: none;'><img src='{2}' alt='Get Microsoft Silverlight' style='border-style: none'/></a>";a=a.replace("{1}",c);a=a.replace("{2}",d+"108181")}return a};Silverlight.getSilverlight=function(e){if(Silverlight.onGetSilverlight)Silverlight.onGetSilverlight();var b="",a=String(e).split(".");if(a.length>1){var c=parseInt(a[0]);if(isNaN(c)||c<2)b="1.0";else b=a[0]+"."+a[1]}var d="";if(b.match(/^\d+\056\d+$/))d="&v="+b;Silverlight.followFWLink("149156"+d)};Silverlight.followFWLink=function(a){top.location=Silverlight.fwlinkRoot+String(a)};Silverlight.HtmlAttributeEncode=function(c){var a,b="";if(c==null)return null;for(var d=0;d<c.length;d++){a=c.charCodeAt(d);if(a>96&&a<123||a>64&&a<91||a>43&&a<58&&a!=47||a==95)b=b+String.fromCharCode(a);else b=b+"&#"+a+";"}return b};Silverlight.default_error_handler=function(e,b){var d,c=b.ErrorType;d=b.ErrorCode;var a="\nSilverlight error message \n";a+="ErrorCode: "+d+"\n";a+="ErrorType: "+c+" \n";a+="Message: "+b.ErrorMessage+" \n";if(c=="ParserError"){a+="XamlFile: "+b.xamlFile+" \n";a+="Line: "+b.lineNumber+" \n";a+="Position: "+b.charPosition+" \n"}else if(c=="RuntimeError"){if(b.lineNumber!=0){a+="Line: "+b.lineNumber+" \n";a+="Position: "+b.charPosition+" \n"}a+="MethodName: "+b.methodName+" \n"}alert(a)};Silverlight.__cleanup=function(){for(var a=Silverlight._silverlightCount-1;a>=0;a--)window["__slEvent"+a]=null;Silverlight._silverlightCount=0;if(window.removeEventListener)window.removeEventListener("unload",Silverlight.__cleanup,false);else window.detachEvent("onunload",Silverlight.__cleanup)};Silverlight.__getHandlerName=function(b){var a="";if(typeof b=="string")a=b;else if(typeof b=="function"){if(Silverlight._silverlightCount==0)if(window.addEventListener)window.addEventListener("onunload",Silverlight.__cleanup,false);else window.attachEvent("onunload",Silverlight.__cleanup);var c=Silverlight._silverlightCount++;a="__slEvent"+c;window[a]=b}else a=null;return a};Silverlight.onRequiredVersionAvailable=function(){};Silverlight.onRestartRequired=function(){};Silverlight.onUpgradeRequired=function(){};Silverlight.onInstallRequired=function(){};Silverlight.IsVersionAvailableOnError=function(d,a){var b=false;try{if(a.ErrorCode==8001&&!Silverlight.__installationEventFired){Silverlight.onUpgradeRequired();Silverlight.__installationEventFired=true}else if(a.ErrorCode==8002&&!Silverlight.__installationEventFired){Silverlight.onRestartRequired();Silverlight.__installationEventFired=true}else if(a.ErrorCode==5014||a.ErrorCode==2106){if(Silverlight.__verifySilverlight2UpgradeSuccess(a.getHost()))b=true}else b=true}catch(c){}return b};Silverlight.IsVersionAvailableOnLoad=function(b){var a=false;try{if(Silverlight.__verifySilverlight2UpgradeSuccess(b.getHost()))a=true}catch(c){}return a};Silverlight.__verifySilverlight2UpgradeSuccess=function(d){var c=false,b="2.0.31005",a=null;try{if(d.IsVersionSupported(b+".99")){a=Silverlight.onRequiredVersionAvailable;c=true}else if(d.IsVersionSupported(b+".0"))a=Silverlight.onRestartRequired;else a=Silverlight.onUpgradeRequired;if(a&&!Silverlight.__installationEventFired){a();Silverlight.__installationEventFired=true}}catch(e){}return c}
\ No newline at end of file diff --git a/cs/demo/Ice/sl/hello/hello.Web/Web.Debug.config b/cs/demo/Ice/sl/hello/hello.Web/Web.Debug.config new file mode 100644 index 00000000000..962e6b73a26 --- /dev/null +++ b/cs/demo/Ice/sl/hello/hello.Web/Web.Debug.config @@ -0,0 +1,30 @@ +<?xml version="1.0"?>
+
+<!-- For more information on using web.config transformation visit http://go.microsoft.com/fwlink/?LinkId=125889 -->
+
+<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
+ <!--
+ In the example below, the "SetAttributes" transform will change the value of
+ "connectionString" to use "ReleaseSQLServer" only when the "Match" locator
+ finds an atrribute "name" that has a value of "MyDB".
+
+ <connectionStrings>
+ <add name="MyDB"
+ connectionString="Data Source=ReleaseSQLServer;Initial Catalog=MyReleaseDB;Integrated Security=True"
+ xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/>
+ </connectionStrings>
+ -->
+ <system.web>
+ <!--
+ In the example below, the "Replace" transform will replace the entire
+ <customErrors> section of your web.config file.
+ Note that because there is only one customErrors section under the
+ <system.web> node, there is no need to use the "xdt:Locator" attribute.
+
+ <customErrors defaultRedirect="GenericError.htm"
+ mode="RemoteOnly" xdt:Transform="Replace">
+ <error statusCode="500" redirect="InternalError.htm"/>
+ </customErrors>
+ -->
+ </system.web>
+</configuration>
\ No newline at end of file diff --git a/cs/demo/Ice/sl/hello/hello.Web/Web.Release.config b/cs/demo/Ice/sl/hello/hello.Web/Web.Release.config new file mode 100644 index 00000000000..141832ba77e --- /dev/null +++ b/cs/demo/Ice/sl/hello/hello.Web/Web.Release.config @@ -0,0 +1,31 @@ +<?xml version="1.0"?>
+
+<!-- For more information on using web.config transformation visit http://go.microsoft.com/fwlink/?LinkId=125889 -->
+
+<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
+ <!--
+ In the example below, the "SetAttributes" transform will change the value of
+ "connectionString" to use "ReleaseSQLServer" only when the "Match" locator
+ finds an atrribute "name" that has a value of "MyDB".
+
+ <connectionStrings>
+ <add name="MyDB"
+ connectionString="Data Source=ReleaseSQLServer;Initial Catalog=MyReleaseDB;Integrated Security=True"
+ xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/>
+ </connectionStrings>
+ -->
+ <system.web>
+ <compilation xdt:Transform="RemoveAttributes(debug)" />
+ <!--
+ In the example below, the "Replace" transform will replace the entire
+ <customErrors> section of your web.config file.
+ Note that because there is only one customErrors section under the
+ <system.web> node, there is no need to use the "xdt:Locator" attribute.
+
+ <customErrors defaultRedirect="GenericError.htm"
+ mode="RemoteOnly" xdt:Transform="Replace">
+ <error statusCode="500" redirect="InternalError.htm"/>
+ </customErrors>
+ -->
+ </system.web>
+</configuration>
\ No newline at end of file diff --git a/cs/demo/Ice/sl/hello/hello.Web/Web.config b/cs/demo/Ice/sl/hello/hello.Web/Web.config new file mode 100644 index 00000000000..0598be112f3 --- /dev/null +++ b/cs/demo/Ice/sl/hello/hello.Web/Web.config @@ -0,0 +1,13 @@ +<?xml version="1.0"?>
+
+<!--
+ For more information on how to configure your ASP.NET application, please visit
+ http://go.microsoft.com/fwlink/?LinkId=169433
+ -->
+
+<configuration>
+ <system.web>
+ <compilation debug="true" targetFramework="4.0" />
+ </system.web>
+
+</configuration>
diff --git a/cs/demo/Ice/sl/hello/hello.Web/hello.Web.csproj b/cs/demo/Ice/sl/hello/hello.Web/hello.Web.csproj new file mode 100644 index 00000000000..dd34cdc3530 --- /dev/null +++ b/cs/demo/Ice/sl/hello/hello.Web/hello.Web.csproj @@ -0,0 +1,101 @@ +<?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>
+ </ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{581234FD-B61C-428C-A214-966E7E6DF42F}</ProjectGuid>
+ <ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>hello.Web</RootNamespace>
+ <AssemblyName>hello.Web</AssemblyName>
+ <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+ <UseIISExpress>false</UseIISExpress>
+ <SilverlightApplicationList>{07F11600-BFCA-42DE-BF09-BF964E0A9D94}|..\hello\hello.csproj|ClientBin|False</SilverlightApplicationList>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\</OutputPath>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>bin\</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="Microsoft.CSharp" />
+ <Reference Include="System.Web.DynamicData" />
+ <Reference Include="System.Web.Entity" />
+ <Reference Include="System.Web.ApplicationServices" />
+ <Reference Include="System" />
+ <Reference Include="System.Data" />
+ <Reference Include="System.Core" />
+ <Reference Include="System.Data.DataSetExtensions" />
+ <Reference Include="System.Web.Extensions" />
+ <Reference Include="System.Xml.Linq" />
+ <Reference Include="System.Drawing" />
+ <Reference Include="System.Web" />
+ <Reference Include="System.Xml" />
+ <Reference Include="System.Configuration" />
+ <Reference Include="System.Web.Services" />
+ <Reference Include="System.EnterpriseServices" />
+ </ItemGroup>
+ <ItemGroup>
+ <Content Include="ClientBin\hello.xap" />
+ <Content Include="helloTestPage.aspx" />
+ <Content Include="helloTestPage.html" />
+ <Content Include="Silverlight.js" />
+ <Content Include="Web.config" />
+ <Content Include="Web.Debug.config">
+ <DependentUpon>Web.config</DependentUpon>
+ <SubType>Designer</SubType>
+ </Content>
+ <Content Include="Web.Release.config">
+ <DependentUpon>Web.config</DependentUpon>
+ <SubType>Designer</SubType>
+ </Content>
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ </ItemGroup>
+ <ItemGroup />
+ <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
+ <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" />
+ <ProjectExtensions>
+ <VisualStudio>
+ <FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
+ <WebProjectProperties>
+ <UseIIS>False</UseIIS>
+ <AutoAssignPort>True</AutoAssignPort>
+ <DevelopmentServerPort>49182</DevelopmentServerPort>
+ <DevelopmentServerVPath>/</DevelopmentServerVPath>
+ <IISUrl>
+ </IISUrl>
+ <NTLMAuthentication>False</NTLMAuthentication>
+ <UseCustomServer>False</UseCustomServer>
+ <CustomServerUrl>
+ </CustomServerUrl>
+ <SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
+ </WebProjectProperties>
+ </FlavorProperties>
+ </VisualStudio>
+ </ProjectExtensions>
+ <!-- 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>
+ -->
+</Project>
\ No newline at end of file diff --git a/cs/demo/Ice/sl/hello/hello.Web/helloTestPage.aspx b/cs/demo/Ice/sl/hello/hello.Web/helloTestPage.aspx new file mode 100644 index 00000000000..b9ad90212bf --- /dev/null +++ b/cs/demo/Ice/sl/hello/hello.Web/helloTestPage.aspx @@ -0,0 +1,74 @@ +<%@ Page Language="C#" AutoEventWireup="true" %>
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" >
+<head runat="server">
+ <title>hello</title>
+ <style type="text/css">
+ html, body {
+ height: 100%;
+ overflow: auto;
+ }
+ body {
+ padding: 0;
+ margin: 0;
+ }
+ #silverlightControlHost {
+ height: 100%;
+ text-align:center;
+ }
+ </style>
+ <script type="text/javascript" src="Silverlight.js"></script>
+ <script type="text/javascript">
+ function onSilverlightError(sender, args) {
+ var appSource = "";
+ if (sender != null && sender != 0) {
+ appSource = sender.getHost().Source;
+ }
+
+ var errorType = args.ErrorType;
+ var iErrorCode = args.ErrorCode;
+
+ if (errorType == "ImageError" || errorType == "MediaError") {
+ return;
+ }
+
+ var errMsg = "Unhandled Error in Silverlight Application " + appSource + "\n" ;
+
+ errMsg += "Code: "+ iErrorCode + " \n";
+ errMsg += "Category: " + errorType + " \n";
+ errMsg += "Message: " + args.ErrorMessage + " \n";
+
+ if (errorType == "ParserError") {
+ errMsg += "File: " + args.xamlFile + " \n";
+ errMsg += "Line: " + args.lineNumber + " \n";
+ errMsg += "Position: " + args.charPosition + " \n";
+ }
+ else if (errorType == "RuntimeError") {
+ if (args.lineNumber != 0) {
+ errMsg += "Line: " + args.lineNumber + " \n";
+ errMsg += "Position: " + args.charPosition + " \n";
+ }
+ errMsg += "MethodName: " + args.methodName + " \n";
+ }
+
+ throw new Error(errMsg);
+ }
+ </script>
+</head>
+<body>
+ <form id="form1" runat="server" style="height:100%">
+ <div id="silverlightControlHost">
+ <object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="100%" height="100%">
+ <param name="source" value="ClientBin/hello.xap"/>
+ <param name="onError" value="onSilverlightError" />
+ <param name="background" value="white" />
+ <param name="minRuntimeVersion" value="5.0.61118.0" />
+ <param name="autoUpgrade" value="true" />
+ <a href="http://go.microsoft.com/fwlink/?LinkID=149156&v=5.0.61118.0" style="text-decoration:none">
+ <img src="http://go.microsoft.com/fwlink/?LinkId=161376" alt="Get Microsoft Silverlight" style="border-style:none"/>
+ </a>
+ </object><iframe id="_sl_historyFrame" style="visibility:hidden;height:0px;width:0px;border:0px"></iframe></div>
+ </form>
+</body>
+</html>
diff --git a/cs/demo/Ice/sl/hello/hello.Web/helloTestPage.html b/cs/demo/Ice/sl/hello/hello.Web/helloTestPage.html new file mode 100644 index 00000000000..2db07c21842 --- /dev/null +++ b/cs/demo/Ice/sl/hello/hello.Web/helloTestPage.html @@ -0,0 +1,73 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" >
+
+<head>
+ <title>hello</title>
+ <style type="text/css">
+ html, body {
+ height: 100%;
+ overflow: auto;
+ }
+ body {
+ padding: 0;
+ margin: 0;
+ }
+ #silverlightControlHost {
+ height: 100%;
+ text-align:center;
+ }
+ </style>
+ <script type="text/javascript" src="Silverlight.js"></script>
+ <script type="text/javascript">
+ function onSilverlightError(sender, args) {
+ var appSource = "";
+ if (sender != null && sender != 0) {
+ appSource = sender.getHost().Source;
+ }
+
+ var errorType = args.ErrorType;
+ var iErrorCode = args.ErrorCode;
+
+ if (errorType == "ImageError" || errorType == "MediaError") {
+ return;
+ }
+
+ var errMsg = "Unhandled Error in Silverlight Application " + appSource + "\n" ;
+
+ errMsg += "Code: "+ iErrorCode + " \n";
+ errMsg += "Category: " + errorType + " \n";
+ errMsg += "Message: " + args.ErrorMessage + " \n";
+
+ if (errorType == "ParserError") {
+ errMsg += "File: " + args.xamlFile + " \n";
+ errMsg += "Line: " + args.lineNumber + " \n";
+ errMsg += "Position: " + args.charPosition + " \n";
+ }
+ else if (errorType == "RuntimeError") {
+ if (args.lineNumber != 0) {
+ errMsg += "Line: " + args.lineNumber + " \n";
+ errMsg += "Position: " + args.charPosition + " \n";
+ }
+ errMsg += "MethodName: " + args.methodName + " \n";
+ }
+
+ throw new Error(errMsg);
+ }
+ </script>
+</head>
+<body>
+ <form id="form1" runat="server" style="height:100%">
+ <div id="silverlightControlHost">
+ <object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="100%" height="100%">
+ <param name="source" value="ClientBin/hello.xap"/>
+ <param name="onError" value="onSilverlightError" />
+ <param name="background" value="white" />
+ <param name="minRuntimeVersion" value="5.0.61118.0" />
+ <param name="autoUpgrade" value="true" />
+ <a href="http://go.microsoft.com/fwlink/?LinkID=149156&v=5.0.61118.0" style="text-decoration:none">
+ <img src="http://go.microsoft.com/fwlink/?LinkId=161376" alt="Get Microsoft Silverlight" style="border-style:none"/>
+ </a>
+ </object><iframe id="_sl_historyFrame" style="visibility:hidden;height:0px;width:0px;border:0px"></iframe></div>
+ </form>
+</body>
+</html>
diff --git a/cs/demo/Ice/sl/hello/hello.sln b/cs/demo/Ice/sl/hello/hello.sln new file mode 100644 index 00000000000..ee530ec7634 --- /dev/null +++ b/cs/demo/Ice/sl/hello/hello.sln @@ -0,0 +1,26 @@ +
+Microsoft Visual Studio Solution File, Format Version 11.00
+# Visual Studio 2010
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "hello", "hello\hello.csproj", "{07F11600-BFCA-42DE-BF09-BF964E0A9D94}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "hello.Web", "hello.Web\hello.Web.csproj", "{581234FD-B61C-428C-A214-966E7E6DF42F}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {07F11600-BFCA-42DE-BF09-BF964E0A9D94}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {07F11600-BFCA-42DE-BF09-BF964E0A9D94}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {07F11600-BFCA-42DE-BF09-BF964E0A9D94}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {07F11600-BFCA-42DE-BF09-BF964E0A9D94}.Release|Any CPU.Build.0 = Release|Any CPU
+ {581234FD-B61C-428C-A214-966E7E6DF42F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {581234FD-B61C-428C-A214-966E7E6DF42F}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {581234FD-B61C-428C-A214-966E7E6DF42F}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {581234FD-B61C-428C-A214-966E7E6DF42F}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/cs/demo/Ice/sl/hello/hello/.gitignore b/cs/demo/Ice/sl/hello/hello/.gitignore new file mode 100644 index 00000000000..e2ed1384003 --- /dev/null +++ b/cs/demo/Ice/sl/hello/hello/.gitignore @@ -0,0 +1,3 @@ +# Dummy file, so that git retains this otherwise empty directory. +Hello.cs +Bin/* diff --git a/cs/demo/Ice/sl/hello/hello/App.xaml b/cs/demo/Ice/sl/hello/hello/App.xaml new file mode 100644 index 00000000000..2c699124f61 --- /dev/null +++ b/cs/demo/Ice/sl/hello/hello/App.xaml @@ -0,0 +1,8 @@ +<Application xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ x:Class="hello.App"
+ >
+ <Application.Resources>
+
+ </Application.Resources>
+</Application>
diff --git a/cs/demo/Ice/sl/hello/hello/App.xaml.cs b/cs/demo/Ice/sl/hello/hello/App.xaml.cs new file mode 100644 index 00000000000..36272c0870e --- /dev/null +++ b/cs/demo/Ice/sl/hello/hello/App.xaml.cs @@ -0,0 +1,76 @@ +// **********************************************************************
+//
+// Copyright (c) 2003-2011 ZeroC, Inc. All rights reserved.
+//
+// This copy of Ice is licensed to you under the terms described in the
+// ICE_LICENSE file included in this distribution.
+//
+// **********************************************************************
+
+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 hello
+{
+ 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)
+ {
+ this.RootVisual = new MainPage();
+ }
+
+ 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)
+ {
+ }
+ }
+ }
+}
diff --git a/cs/demo/Ice/sl/hello/hello/Hello.ice b/cs/demo/Ice/sl/hello/hello/Hello.ice new file mode 100644 index 00000000000..cdb2f95276d --- /dev/null +++ b/cs/demo/Ice/sl/hello/hello/Hello.ice @@ -0,0 +1,21 @@ +// ********************************************************************** +// +// Copyright (c) 2003-2011 ZeroC, Inc. All rights reserved. +// +// This copy of Ice is licensed to you under the terms described in the +// ICE_LICENSE file included in this distribution. +// +// ********************************************************************** + +#pragma once + +module Demo +{ + +interface Hello +{ + idempotent void sayHello(int delay); + void shutdown(); +}; + +}; diff --git a/cs/demo/Ice/sl/hello/hello/MainPage.xaml b/cs/demo/Ice/sl/hello/hello/MainPage.xaml new file mode 100644 index 00000000000..ac3fddcf692 --- /dev/null +++ b/cs/demo/Ice/sl/hello/hello/MainPage.xaml @@ -0,0 +1,56 @@ +<UserControl x:Class="hello.MainPage"
+ 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">
+
+ <StackPanel Margin="10, 10, 10, 10" HorizontalAlignment="Center">
+ <StackPanel Orientation="Horizontal" VerticalAlignment="Center"
+ Margin="5, 5, 5, 5">
+ <TextBlock Text="Host:" Height="25" Width="80" VerticalAlignment="Center"/>
+ <TextBox x:Name="txtHost" HorizontalAlignment="Left"
+ Text="localhost"
+ TextWrapping="NoWrap"
+ VerticalAlignment="Top" Height="25" Width="320"/>
+ </StackPanel>
+ <StackPanel Orientation="Horizontal" VerticalAlignment="Center"
+ Margin="5, 5, 5, 5">
+ <TextBlock Text="Mode:" Height="25" Width="80" VerticalAlignment="Center"/>
+ <ComboBox x:Name="cmbModes" Height="25" Width="320" ItemsSource="{Binding}"/>
+ </StackPanel>
+ <StackPanel Orientation="Horizontal" VerticalAlignment="Center"
+ Margin="5, 5, 5, 5">
+ <TextBlock Text="Timeout:" Height="25" Width="80" VerticalAlignment="Center"/>
+ <Slider Height="25" Width="235" IsHitTestVisible="True" Minimum="0" Maximum="2"
+ SmallChange="0.1" LargeChange="0.1" ValueChanged="timeoutValueChanged"/>
+ <TextBox x:Name="txtTimeout" HorizontalAlignment="Right"
+ Text="0 ms"
+ TextWrapping="NoWrap"
+ VerticalAlignment="Top" Height="25" Width="80"
+ Margin="5, 0, 0, 0" IsReadOnly="True"/>
+ </StackPanel>
+ <StackPanel Orientation="Horizontal" VerticalAlignment="Center"
+ Margin="5, 5, 5, 5">
+ <TextBlock Text="Delay:" Height="25" Width="80" VerticalAlignment="Center"/>
+ <Slider Height="25" Width="235" IsHitTestVisible="True" Minimum="0" Maximum="2"
+ SmallChange="0.1" LargeChange="0.1" ValueChanged="delayValueChanged"/>
+ <TextBox x:Name="txtDelay" HorizontalAlignment="Right"
+ Text="0 ms"
+ TextWrapping="NoWrap"
+ VerticalAlignment="Top" Height="25" Width="80"
+ Margin="5, 0, 0, 0" IsReadOnly="True"/>
+ </StackPanel>
+ <Grid Margin="5, 5, 5, 5">
+ <TextBox x:Name="txtOutput"
+ FontSize="12" Text="" TextWrapping="Wrap" IsEnabled="True" Height="120"
+ Width="400" ScrollViewer.HorizontalScrollBarVisibility="Auto"
+ ScrollViewer.VerticalScrollBarVisibility="Auto" IsReadOnly="True"/>
+ </Grid>
+ <StackPanel Orientation="Horizontal" VerticalAlignment="Center"
+ Margin="5, 5, 5, 5">
+ <Button Name="btnSayHello" Content="Say Hello" Click="btnSayHelloClick" />
+ <Button Name="btnFlush" Content="Flush" Margin="5, 0, 0, 0" IsEnabled="False" Click="btnFlushClick" />
+ <Button Name="btnShutdown" Content="Shutdown" Margin="5, 0, 0, 0" Click="btnShutdownClick" />
+ </StackPanel>
+ </StackPanel>
+</UserControl>
diff --git a/cs/demo/Ice/sl/hello/hello/MainPage.xaml.cs b/cs/demo/Ice/sl/hello/hello/MainPage.xaml.cs new file mode 100644 index 00000000000..29f67fcf651 --- /dev/null +++ b/cs/demo/Ice/sl/hello/hello/MainPage.xaml.cs @@ -0,0 +1,180 @@ +// **********************************************************************
+//
+// Copyright (c) 2003-2011 ZeroC, Inc. All rights reserved.
+//
+// This copy of Ice is licensed to you under the terms described in the
+// ICE_LICENSE file included in this distribution.
+//
+// **********************************************************************
+
+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.Collections.ObjectModel;
+using Demo;
+
+namespace hello
+{
+ public partial class MainPage : UserControl
+ {
+ public MainPage()
+ {
+ InitializeComponent();
+ ObservableCollection<string> modes = new ObservableCollection<string>();
+ modes.Add("Twoway");
+ modes.Add("Oneway");
+ modes.Add("Batch Oneway");
+ cmbModes.DataContext = modes;
+ cmbModes.SelectedIndex = 0;
+ Ice.InitializationData initData = new Ice.InitializationData();
+ initData.dispatcher = delegate(System.Action action, Ice.Connection connection)
+ {
+ Dispatcher.BeginInvoke(action);
+ };
+ _communicator = Ice.Util.initialize(initData);
+ }
+
+ private void timeoutValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
+ {
+ _timeout = (int)Math.Round(e.NewValue * 1000, 0);
+ txtTimeout.Text = _timeout.ToString() + " ms";
+ }
+
+ private void delayValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
+ {
+ _delay = (int)Math.Round(e.NewValue * 1000, 0);
+ txtDelay.Text = _delay.ToString() + " ms";
+ }
+
+ private void btnSayHelloClick(object sender, RoutedEventArgs e)
+ {
+ int mode = cmbModes.SelectedIndex;
+ string host = txtHost.Text;
+ txtOutput.Text = "";
+ try
+ {
+ Ice.ObjectPrx proxy = _communicator.stringToProxy("hello:tcp -h " + host + " -p 4502");
+ switch (mode)
+ {
+ case 0:
+ {
+ proxy = proxy.ice_twoway();
+ break;
+ }
+ case 1:
+ {
+ proxy = proxy.ice_oneway();
+ break;
+ }
+ case 2:
+ {
+ proxy = proxy.ice_batchOneway();
+ btnFlush.IsEnabled = true;
+ break;
+ }
+ default:
+ {
+ throw new ArgumentException("Invalid Mode index " + mode.ToString());
+ }
+ }
+
+ if (_timeout == 0)
+ {
+ proxy = proxy.ice_timeout(-1);
+ }
+ else
+ {
+ proxy = proxy.ice_timeout(_timeout);
+ }
+ HelloPrx hello = HelloPrxHelper.uncheckedCast(proxy);
+ if(mode != 2)
+ {
+ bool response = false;
+ Ice.AsyncResult result = hello.begin_sayHello(_delay).whenCompleted(
+ () =>
+ {
+ response = true;
+ txtOutput.Text = "Ready";
+ },
+ (Ice.Exception ex) =>
+ {
+ response = true;
+ txtOutput.Text = ex.ToString();
+ }).whenSent(
+ (bool sentSynchronously) =>
+ {
+ if(response)
+ {
+ return; // Response was received already.
+ }
+
+ if(mode == 0)
+ {
+ txtOutput.Text = "Wait for response";
+ }
+ else
+ {
+ txtOutput.Text = "Ready";
+ }
+ });
+ if(!result.sentSynchronously())
+ {
+ txtOutput.Text = "Sending request";
+ }
+ }
+ else
+ {
+ txtOutput.Text = "Queued hello request";
+ }
+ }
+ catch(System.Exception ex)
+ {
+ txtOutput.Text = ex.ToString();
+ }
+ }
+
+ private void btnFlushClick(object sender, RoutedEventArgs e)
+ {
+ _communicator.begin_flushBatchRequests().whenCompleted(
+ (Ice.Exception ex) =>
+ {
+ txtOutput.Text = ex.ToString();
+ }).whenSent(
+ (bool sentSynchronously) =>
+ {
+ btnFlush.IsEnabled = false;
+ txtOutput.Text = "Flushed batch requests";
+ });
+ }
+
+ private void btnShutdownClick(object sender, RoutedEventArgs e)
+ {
+ string host = txtHost.Text;
+ txtOutput.Text = "Shutting down...";
+
+ Ice.ObjectPrx proxy = _communicator.stringToProxy("hello:tcp -h " + host + " -p 4502");
+ HelloPrx hello = HelloPrxHelper.uncheckedCast(proxy);
+ hello.begin_shutdown().whenCompleted(
+ () =>
+ {
+ txtOutput.Text = "Ready";
+ },
+ (Ice.Exception ex) =>
+ {
+ txtOutput.Text = ex.ToString();
+ });
+ }
+
+ private int _timeout = 0;
+ private int _delay = 0;
+ private Ice.Communicator _communicator;
+ }
+}
diff --git a/cs/demo/Ice/sl/hello/hello/Properties/AppManifest.xml b/cs/demo/Ice/sl/hello/hello/Properties/AppManifest.xml new file mode 100644 index 00000000000..a9552327529 --- /dev/null +++ b/cs/demo/Ice/sl/hello/hello/Properties/AppManifest.xml @@ -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>
diff --git a/cs/demo/Ice/sl/hello/hello/Properties/AssemblyInfo.cs b/cs/demo/Ice/sl/hello/hello/Properties/AssemblyInfo.cs new file mode 100644 index 00000000000..4f27c89ccd1 --- /dev/null +++ b/cs/demo/Ice/sl/hello/hello/Properties/AssemblyInfo.cs @@ -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("hello")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("ZeroC")]
+[assembly: AssemblyProduct("hello")]
+[assembly: AssemblyCopyright("Copyright © ZeroC 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("cad5cad2-4177-4d15-8f0d-c6179c8850da")]
+
+// 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")]
diff --git a/cs/demo/Ice/sl/hello/hello/hello.csproj b/cs/demo/Ice/sl/hello/hello/hello.csproj new file mode 100644 index 00000000000..33433eb67ab --- /dev/null +++ b/cs/demo/Ice/sl/hello/hello/hello.csproj @@ -0,0 +1,114 @@ +<?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>8.0.50727</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{07F11600-BFCA-42DE-BF09-BF964E0A9D94}</ProjectGuid>
+ <ProjectTypeGuids>{A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>hello</RootNamespace>
+ <AssemblyName>hello</AssemblyName>
+ <TargetFrameworkIdentifier>Silverlight</TargetFrameworkIdentifier>
+ <TargetFrameworkVersion>v5.0</TargetFrameworkVersion>
+ <SilverlightVersion>$(TargetFrameworkVersion)</SilverlightVersion>
+ <SilverlightApplication>true</SilverlightApplication>
+ <SupportedCultures>
+ </SupportedCultures>
+ <XapOutputs>true</XapOutputs>
+ <GenerateSilverlightManifest>true</GenerateSilverlightManifest>
+ <XapFilename>hello.xap</XapFilename>
+ <SilverlightManifestTemplate>Properties\AppManifest.xml</SilverlightManifestTemplate>
+ <SilverlightAppEntry>hello.App</SilverlightAppEntry>
+ <TestPageFileName>helloTestPage.html</TestPageFileName>
+ <CreateTestPage>true</CreateTestPage>
+ <ValidateXaml>true</ValidateXaml>
+ <EnableOutOfBrowser>false</EnableOutOfBrowser>
+ <OutOfBrowserSettingsFile>Properties\OutOfBrowserSettings.xml</OutOfBrowserSettingsFile>
+ <UsePlatformExtensions>false</UsePlatformExtensions>
+ <ThrowErrorsInValidation>true</ThrowErrorsInValidation>
+ <LinkedServerProject>
+ </LinkedServerProject>
+ </PropertyGroup>
+ <!-- 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="Ice, Version=3.4.2.0, Culture=neutral, PublicKeyToken=1f998c50fec78381, processorArchitecture=MSIL" />
+ <Reference Include="mscorlib" />
+ <Reference Include="System.Windows" />
+ <Reference Include="system" />
+ <Reference Include="System.Core" />
+ <Reference Include="System.Net" />
+ <Reference Include="System.Xml" />
+ <Reference Include="System.Windows.Browser" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="App.xaml.cs">
+ <DependentUpon>App.xaml</DependentUpon>
+ </Compile>
+ <Compile Include="Hello.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="MainPage.xaml.cs">
+ <DependentUpon>MainPage.xaml</DependentUpon>
+ </Compile>
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <ApplicationDefinition Include="App.xaml">
+ <SubType>Designer</SubType>
+ <Generator>MSBuild:Compile</Generator>
+ </ApplicationDefinition>
+ <Page Include="MainPage.xaml">
+ <SubType>Designer</SubType>
+ <Generator>MSBuild:Compile</Generator>
+ </Page>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="Hello.ice" />
+ <None Include="Properties\AppManifest.xml" />
+ </ItemGroup>
+ <Import Project="$(MSBuildExtensionsPath32)\Microsoft\Silverlight\$(SilverlightVersion)\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>
+ <VisualStudio>
+ <FlavorProperties GUID="{A1591282-1198-4647-A2B1-27E5FF5F6F3B}">
+ <SilverlightProjectProperties />
+ </FlavorProperties>
+ <UserProperties ZerocIce_Enabled="True" />
+ </VisualStudio>
+ </ProjectExtensions>
+</Project>
\ No newline at end of file |