summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--IvyControl/Ivy.cs0
-rw-r--r--IvyControl/IvyApplicationBinding.cs121
-rw-r--r--IvyControl/IvyApplicationBindingControl.cs121
-rw-r--r--IvyControl/IvyControl.cs473
-rw-r--r--IvyControl/IvyControl.csproj77
-rw-r--r--IvyControl/IvyDomain.Designer.cs75
-rw-r--r--IvyControl/IvyDomain.cs61
-rw-r--r--IvyControl/IvyDomain.resx120
-rw-r--r--IvyControl/Properties/AssemblyInfo.cs35
9 files changed, 1083 insertions, 0 deletions
diff --git a/IvyControl/Ivy.cs b/IvyControl/Ivy.cs
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/IvyControl/Ivy.cs
diff --git a/IvyControl/IvyApplicationBinding.cs b/IvyControl/IvyApplicationBinding.cs
new file mode 100644
index 0000000..c4c236f
--- /dev/null
+++ b/IvyControl/IvyApplicationBinding.cs
@@ -0,0 +1,121 @@
+using System;
+using System.Collections.Generic;
+using System.Collections.Specialized;
+using System.Text;
+using System.ComponentModel;
+using System.Threading;
+
+namespace IvyBus
+{
+ /* This is the Application side of binding storage */
+ /* association of a generated Key and a delegate and the expression */
+ /* this is SEND to other client */
+#if (!PocketPC)
+ [PropertyTab(typeof(System.Windows.Forms.Design.EventsTab), PropertyTabScope.Component)]
+ [DefaultEvent("Callback")]
+#endif
+ [DesignerCategory("Component")]
+ [DesignTimeVisible(false)] /* should be added via Ivy component */
+ public class IvyApplicationBindingControl : System.ComponentModel.Component
+ {
+ public IvyApplicationBinding binding;
+
+#if (!PocketPC)
+ [Category("Ivy")]
+#endif
+ public BindingType Binding
+ {
+ get { return binding.Binding; }
+ set { binding.Binding = value; }
+ }
+
+
+#if (!PocketPC)
+ [Browsable(false)]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
+#endif
+ public ushort Key
+ {
+ get { return binding.Key; }
+ set { binding.Key = value; }
+ }
+
+#if (!PocketPC)
+ [Browsable(false)]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
+#endif
+ public object[] Args
+ {
+ get { return binding.Args; }
+ set { binding.Args = value; }
+ }
+
+#if (!PocketPC)
+ [Category("Ivy")]
+#endif
+ [DefaultValue(null)]
+ public string Expression
+ {
+ get { return binding.Expression; }
+ set { binding.Expression = value; }
+ }
+ public string FormatedExpression
+ {
+ get
+ {
+ return binding.FormatedExpression;
+ }
+ }
+
+ ///<summary>SentMessageClasses the first word token of sent messages
+ ///<remarks> optimise the parsing process when sending messages </remarks>
+ ///</summary>
+#if (!PocketPC)
+ [Category("Ivy")]
+
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
+
+ // sinon bug System.String constructor not found !
+ [Editor(
+ "System.Windows.Forms.Design.StringCollectionEditor, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a",
+ "System.Drawing.Design.UITypeEditor,System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
+ )]
+
+ [Description("Arguments used when formating the expression")]
+#endif
+ public List<string> Arguments
+ {
+ get
+ {
+ return binding.Arguments;
+ }
+ }
+
+#if (!PocketPC)
+ [Category("Ivy")]
+ [Description("Event fired when Message Matching expression received")]
+#endif
+ public event EventHandler<IvyMessageEventArgs> Callback
+ {
+ add
+ {
+ binding.Callback += value;
+ }
+ remove
+ {
+ binding.Callback -= value;
+ }
+ }
+
+ public IvyApplicationBindingControl()
+ {
+ binding = new IvyApplicationBinding();
+ }
+ public IvyApplicationBindingControl(IContainer container)
+ : this()
+ {
+ container.Add(this);
+ }
+ }
+
+}
diff --git a/IvyControl/IvyApplicationBindingControl.cs b/IvyControl/IvyApplicationBindingControl.cs
new file mode 100644
index 0000000..c4c236f
--- /dev/null
+++ b/IvyControl/IvyApplicationBindingControl.cs
@@ -0,0 +1,121 @@
+using System;
+using System.Collections.Generic;
+using System.Collections.Specialized;
+using System.Text;
+using System.ComponentModel;
+using System.Threading;
+
+namespace IvyBus
+{
+ /* This is the Application side of binding storage */
+ /* association of a generated Key and a delegate and the expression */
+ /* this is SEND to other client */
+#if (!PocketPC)
+ [PropertyTab(typeof(System.Windows.Forms.Design.EventsTab), PropertyTabScope.Component)]
+ [DefaultEvent("Callback")]
+#endif
+ [DesignerCategory("Component")]
+ [DesignTimeVisible(false)] /* should be added via Ivy component */
+ public class IvyApplicationBindingControl : System.ComponentModel.Component
+ {
+ public IvyApplicationBinding binding;
+
+#if (!PocketPC)
+ [Category("Ivy")]
+#endif
+ public BindingType Binding
+ {
+ get { return binding.Binding; }
+ set { binding.Binding = value; }
+ }
+
+
+#if (!PocketPC)
+ [Browsable(false)]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
+#endif
+ public ushort Key
+ {
+ get { return binding.Key; }
+ set { binding.Key = value; }
+ }
+
+#if (!PocketPC)
+ [Browsable(false)]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
+#endif
+ public object[] Args
+ {
+ get { return binding.Args; }
+ set { binding.Args = value; }
+ }
+
+#if (!PocketPC)
+ [Category("Ivy")]
+#endif
+ [DefaultValue(null)]
+ public string Expression
+ {
+ get { return binding.Expression; }
+ set { binding.Expression = value; }
+ }
+ public string FormatedExpression
+ {
+ get
+ {
+ return binding.FormatedExpression;
+ }
+ }
+
+ ///<summary>SentMessageClasses the first word token of sent messages
+ ///<remarks> optimise the parsing process when sending messages </remarks>
+ ///</summary>
+#if (!PocketPC)
+ [Category("Ivy")]
+
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
+
+ // sinon bug System.String constructor not found !
+ [Editor(
+ "System.Windows.Forms.Design.StringCollectionEditor, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a",
+ "System.Drawing.Design.UITypeEditor,System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
+ )]
+
+ [Description("Arguments used when formating the expression")]
+#endif
+ public List<string> Arguments
+ {
+ get
+ {
+ return binding.Arguments;
+ }
+ }
+
+#if (!PocketPC)
+ [Category("Ivy")]
+ [Description("Event fired when Message Matching expression received")]
+#endif
+ public event EventHandler<IvyMessageEventArgs> Callback
+ {
+ add
+ {
+ binding.Callback += value;
+ }
+ remove
+ {
+ binding.Callback -= value;
+ }
+ }
+
+ public IvyApplicationBindingControl()
+ {
+ binding = new IvyApplicationBinding();
+ }
+ public IvyApplicationBindingControl(IContainer container)
+ : this()
+ {
+ container.Add(this);
+ }
+ }
+
+}
diff --git a/IvyControl/IvyControl.cs b/IvyControl/IvyControl.cs
new file mode 100644
index 0000000..a432914
--- /dev/null
+++ b/IvyControl/IvyControl.cs
@@ -0,0 +1,473 @@
+/// François-Régis Colin
+/// http://www.tls.cena.fr/products/ivy/
+/// *
+/// (C) CENA
+/// *
+///
+
+namespace IvyBus
+{
+ using System;
+ using System.IO;
+ using System.Collections;
+ using System.Collections.Specialized;
+ using System.Collections.Generic;
+ using System.Net;
+ using System.Net.Sockets;
+ using System.Threading;
+ using System.Configuration;
+ using System.Globalization;
+ using System.Text.RegularExpressions;
+ using System.Text;
+ using System.Reflection;
+ using System.ComponentModel;
+ using System.Diagnostics;
+
+#if (!PocketPC)
+ using System.ComponentModel.Design;
+#endif
+// using System.Drawing.Design;
+
+
+ /// <summary> The Main bus Class
+ /// </summary>
+ ///
+#if (!PocketPC)
+ // Show this property in the property grid.
+ [ToolboxItemFilter("System.Windows.Forms.Form", ToolboxItemFilterType.Allow)]
+ [Description("IVY Main API")]
+#endif
+ [DesignerCategory("Component")]
+ public class IvyControl : System.ComponentModel.Component, ISupportInitialize
+ {
+ public Ivy ivy;
+ private List<IvyApplicationBindingControl> app_bindings;
+
+ /* Event */
+ [Description("Occurs when a new client connect to the bus")]
+ public event EventHandler<IvyEventArgs> ClientConnected
+ {
+ remove
+ {
+ ivy.ClientConnected -= value;
+ }
+ add
+ {
+ ivy.ClientConnected += value;
+ }
+
+ }
+ [Description("Occurs when a client discconnect from the bus")]
+ public event EventHandler<IvyEventArgs> ClientDisconnected
+ {
+ remove
+ {
+ ivy.ClientDisconnected -= value;
+ }
+ add
+ {
+ ivy.ClientDisconnected += value;
+ }
+
+ }
+ [Description("Occurs when a client receive a direct message from another client")]
+ public event EventHandler<IvyEventArgs> DirectMessageReceived
+ {
+ remove
+ {
+ ivy.DirectMessageReceived -= value;
+ }
+ add
+ {
+ ivy.DirectMessageReceived += value;
+ }
+
+ }
+ [Description("Occurs when somebody ask for killing every client on the bus")]
+ public event EventHandler<IvyDieEventArgs> DieReceived
+ {
+ remove
+ {
+ ivy.DieReceived -= value;
+ }
+ add
+ {
+ ivy.DieReceived += value;
+ }
+
+ }
+ [Description("Occurs when a client receive a add binding from another client")]
+ public event EventHandler<IvyEventArgs> BindingAdd
+ {
+ remove
+ {
+ ivy.BindingAdd -= value;
+ }
+ add
+ {
+ ivy.BindingAdd += value;
+ }
+
+ }
+ [Description("Occurs when a client receive a remove binding from another client")]
+ public event EventHandler<IvyEventArgs> BindingRemove
+ {
+ remove
+ {
+ ivy.BindingRemove -= value;
+ }
+ add
+ {
+ ivy.BindingRemove += value;
+ }
+
+ }
+ [Description("Occurs when a client receive a binding from another client and it as been filtered ")]
+ public event EventHandler<IvyEventArgs> BindingFilter
+ {
+ remove
+ {
+ ivy.BindingFilter -= value;
+ }
+ add
+ {
+ ivy.BindingFilter += value;
+ }
+
+ }
+ [Description("Occurs when a client receive a remove binding from another client")]
+ public event EventHandler<IvyEventArgs> ErrorMessage
+ {
+ remove
+ {
+ ivy.ErrorMessage -= value;
+ }
+ add
+ {
+ ivy.ErrorMessage += value;
+ }
+
+ }
+
+#if (!PocketPC)
+ [Bindable(true)]
+ [Category("Ivy")]
+#endif
+ [DefaultValue(false)]
+ public static bool DebugProtocol
+ {
+ get
+ {
+ return Ivy.DebugProtocol;
+ }
+ set
+ {
+ Ivy.DebugProtocol = value;
+ }
+
+ }
+#if (!PocketPC)
+ [Category("Ivy")]
+#endif
+ public CultureInfo Culture
+ {
+ get
+ {
+ return ivy.Culture;
+ }
+ set
+ {
+ ivy.Culture = value;
+ }
+
+ }
+
+
+ /// <summary>AppName the application name</summary>
+
+#if (!PocketPC)
+ [Category("Ivy")]
+ [Bindable(true)]
+#endif
+ [DefaultValue(null)]
+ public string AppName
+ {
+ set
+ {
+ ivy.AppName = value;
+ }
+ get
+ {
+ return ivy.AppName;
+ }
+
+ }
+
+ /// <summary>AppPriority the Application Priority: the clients list is sorted against priority</summary>
+#if (!PocketPC)
+ [Category("Ivy")]
+#endif
+ [DefaultValue(Ivy.DEFAULT_PRIORITY)]
+ public ushort AppPriority
+ {
+ set
+ {
+ ivy.AppPriority = value;
+ }
+ get
+ {
+ return ivy.AppPriority;
+ }
+
+ }
+
+ ///<summary>SentMessageClasses the first word token of sent messages
+ ///<remarks> optimise the parsing process when sending messages </remarks>
+ ///</summary>
+#if (!PocketPC)
+ [Category("Ivy")]
+
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
+ // sinon bug System.String constructor not found !
+ [Editor("System.Windows.Forms.Design.StringCollectionEditor, System.Design", "System.Drawing.Design.UITypeEditor, System.Drawing")]
+#endif
+ public List<string> SentMessageFilter
+ {
+ get
+ {
+ return ivy.SentMessageFilter;
+ }
+ }
+ /// <summary>ReadyMessage message send when Application receive all the regexp at the connection of the client</summary>
+
+#if (!PocketPC)
+ [Bindable(true)]
+ [Category("Ivy")]
+#endif
+ [DefaultValue(null)]
+ public string ReadyMessage
+ {
+ get { return ivy.ReadyMessage; }
+ set { ivy.ReadyMessage = value; }
+ }
+
+
+
+#if (PocketPC)
+#if (!PocketPC)
+ [Category("Ivy")]
+#endif
+ [DefaultValue(null)]
+ public System.Windows.Forms.ContainerControl ContainerControl
+ {
+ get { return parentControl; }
+ set
+ {
+ parentControl = value;
+ }
+ }
+#endif
+#if (!PocketPC)
+ [Category("Ivy")]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
+#endif
+ public List<IvyApplicationBindingControl> Bindings
+ {
+ get { return app_bindings; }
+ }
+
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="T:Ivy"/> class.
+ /// </summary>
+ public IvyControl()
+ {
+ ivy = new Ivy();
+ app_bindings = new List<IvyApplicationBindingControl>();
+
+ // get binding from Attribute IvyBinding
+ //TODO Autobinding attribute
+#if (PocketPC)
+ if (parentControl != null)
+ BindAttibute(parentControl);
+#endif
+ Assembly assembly = Assembly.GetCallingAssembly();
+ if ( assembly != this.GetType().Assembly )
+ ivy.BindAttibute(assembly);
+ }
+ public IvyControl(IContainer container)
+ : this()
+ {
+ container.Add(this);
+ // get binding from Attribute IvyBinding
+ //TODO Autobinding attribute
+ Assembly assembly = Assembly.GetCallingAssembly();
+ if (assembly != this.GetType().Assembly)
+ ivy.BindAttibute(assembly);
+ }
+ /// <summary>
+ /// Readies the structures for the software bus connexion.
+ /// </summary>
+ /// <example> This sample shows how to start working with Ivy.
+ /// <code>
+ /// Ivy bus = new Ivy("Dummy agent","ready");
+ /// bus.bindMsg("(.*)",myMessageListener);
+ /// bus.start(null);
+ /// </code>
+ /// How to send & receive:
+ /// the Ivy agent A performs <c>b.bindMsg("^Hello (*)",cb);</c>
+ /// the Ivy agent B performs <c>b2.sendMsg("Hello world");</c>
+ /// a thread in A will run the callback cb with its second argument set
+ /// to a array of string, with one single element, "world"
+ /// </example>
+ /// <remarks>
+ /// the real work begin in the start() method
+ /// </remarks>
+ /// <seealso cref=" Ivy.start"/>
+ /// <param name='name'>The name of your Ivy agent on the software bus
+ /// </param>
+ /// <param name='message'>The hellow message you will send once ready
+ /// </param>
+ public IvyControl(string name, string rdy_message)
+ : this()
+ {
+ ivy.AppName = name;
+ ivy.ReadyMessage = rdy_message;
+ // get binding from Attribute IvyBinding
+ //TODO Autobinding attribute
+ Assembly assembly = Assembly.GetCallingAssembly();
+ if (assembly != this.GetType().Assembly)
+ ivy.BindAttibute(assembly);
+ }
+
+ protected override void Dispose(bool disposing)
+ {
+ try
+ {
+ if (disposing && ivy != null )
+ {
+ ivy.Stop();
+ }
+ }
+ finally
+ {
+ base.Dispose(disposing);
+ }
+ }
+
+
+ /// <summary>
+ /// Send a formated message to someone on the bus
+ /// </summary>
+ /// <remarks>
+ /// Performs a pattern matching according to everyone's regexps, and sends
+ /// the results to the relevant ivy agents.
+ /// There is one thread for each client connected, we could also
+ /// create another thread each time we send a message.
+ /// </remarks>
+ /// <param name='format'>A string message format to build the message
+ /// <param name='args'>args used in message format
+ /// <returns>
+ /// the number of messages actually sent
+ /// </returns>
+ public int SendMsg(string format, params object[] args)
+ {
+ return ivy.SendMsg(format, args);
+ }
+ //
+ public ushort BindMsg(IvyApplicationBinding newbind)
+ {
+ return ivy.BindMsg(newbind);
+ }
+ /// <summary>
+ /// Subscribes to a regular expression.
+ /// </summary>
+ /// <param name="regexp">a regular expression, groups are done with parenthesis</param>
+ /// <param name="callback">any objects implementing the Ivy.MessageListener</param>
+ /// <param name="args">The args.</param>
+ /// <returns>the id of the regular expression</returns>
+ /// <remarks>
+ /// The callback will be executed with
+ /// the saved parameters of the regexp as arguments when a message will sent
+ /// by another agent. A program doesn't receive its own messages.
+ /// </remarks>
+ //
+ public ushort BindMsg(string regexp, EventHandler<IvyMessageEventArgs> callback, params object[] args)
+ {
+ return ivy.BindMsg(regexp, callback,args);
+ }
+
+ /// <summary>
+ /// unsubscribes a regular expression
+ /// </summary>
+ /// <param name="id">the id of the regular expression, returned when it was bound</param>
+ public void UnbindMsg(ushort id)
+ {
+ ivy.UnbindMsg(id);
+ }
+
+ /// <summary>
+ /// unsubscribes a regular expression
+ /// </summary>
+ /// <param name="re">the string for the regular expression</param>
+ /// <returns>
+ /// a boolean, true if the regexp existed, false otherwise or
+ /// whenever an exception occured during unbinding
+ /// </returns>
+ public bool UnbindMsg(string re)
+ {
+ return ivy.UnbindMsg(re);
+ }
+
+
+ /// <summary>
+ /// Subscribes to a simple expression ( msg ar1 arg2 arg3 etc).
+ /// </summary>
+ /// <remarks>
+ /// The callback will be executed with
+ /// the saved parameters of the regexp as arguments when a message will sent
+ /// by another agent. A program doesn't receive its own messages.
+ /// </remarks>
+ ///
+ /// <param name='regexp'>a regular expression, groups are done with parenthesis
+ /// <param name='callback'>any objects implementing the EventHandler<IvyMessageEventArgs>
+ /// <returns>
+ /// the id of the regular expression
+ /// </returns>
+ public int BindSimpleMsg(string expression, EventHandler<IvyMessageEventArgs> callback, params object[] args)
+ {
+ return ivy.BindSimpleMsg(expression, callback, args);
+ }
+
+ /// <summary>
+ /// gives a list of IvyClient(s) with the name given in parameter
+ /// </summary>
+ /// <param name="name">The name of the Ivy agent you're looking for</param>
+ /// <returns></returns>
+ public List<IvyClient> GetClientsByName(string name)
+ {
+
+ return ivy.GetClientsByName( name );
+ }
+
+
+ #region ISupportInitialize Members
+
+ public void BeginInit()
+ {
+
+ }
+
+ public void EndInit()
+ {
+ // TODO ugly should be added directly the bindings Dictionary !
+ foreach (IvyApplicationBindingControl bind in app_bindings)
+ {
+ ivy.BindMsg(bind.binding);
+ }
+ }
+
+ #endregion
+
+ }
+} \ No newline at end of file
diff --git a/IvyControl/IvyControl.csproj b/IvyControl/IvyControl.csproj
new file mode 100644
index 0000000..786dc02
--- /dev/null
+++ b/IvyControl/IvyControl.csproj
@@ -0,0 +1,77 @@
+<Project 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>{9E7098F5-F4CA-4CAE-B517-C584691DBDB4}</ProjectGuid>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>IvyBus</RootNamespace>
+ <AssemblyName>IvyBus.IvyControl</AssemblyName>
+ <SccProjectName>SAK</SccProjectName>
+ <SccLocalPath>SAK</SccLocalPath>
+ <SccAuxPath>SAK</SccAuxPath>
+ <SccProvider>SAK</SccProvider>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\Debug\</OutputPath>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <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</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="System" />
+ <Reference Include="System.Data" />
+ <Reference Include="System.Drawing" />
+ <Reference Include="System.Windows.Forms" />
+ <Reference Include="System.Xml" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="IvyApplicationBindingControl.cs">
+ <SubType>Component</SubType>
+ </Compile>
+ <Compile Include="IvyControl.cs">
+ <SubType>Component</SubType>
+ </Compile>
+ <Compile Include="IvyDomain.cs">
+ <SubType>UserControl</SubType>
+ </Compile>
+ <Compile Include="IvyDomain.Designer.cs">
+ <DependentUpon>IvyDomain.cs</DependentUpon>
+ </Compile>
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ <Service Include="{94E38DFF-614B-4cbd-B67C-F211BB35CE8B}" />
+ </ItemGroup>
+ <ItemGroup>
+ <EmbeddedResource Include="IvyDomain.resx">
+ <DependentUpon>IvyDomain.cs</DependentUpon>
+ <SubType>Designer</SubType>
+ </EmbeddedResource>
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\Ivy\Ivy.csproj">
+ <Project>{F2F03CF7-0087-4EDB-AD15-80C9E8DA2617}</Project>
+ <Name>Ivy</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <Import Project="$(MSBuildBinPath)\Microsoft.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>
+ -->
+</Project> \ No newline at end of file
diff --git a/IvyControl/IvyDomain.Designer.cs b/IvyControl/IvyDomain.Designer.cs
new file mode 100644
index 0000000..3f89b6a
--- /dev/null
+++ b/IvyControl/IvyDomain.Designer.cs
@@ -0,0 +1,75 @@
+namespace IvyBus
+{
+ partial class IvyDomain
+ {
+ /// <summary>
+ /// Required designer variable.
+ /// </summary>
+ private System.ComponentModel.IContainer components = null;
+
+ /// <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 Component 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.label1 = new System.Windows.Forms.Label();
+ this.ivybus = new System.Windows.Forms.TextBox();
+ this.SuspendLayout();
+ //
+ // label1
+ //
+ this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
+ | System.Windows.Forms.AnchorStyles.Left)));
+ this.label1.Location = new System.Drawing.Point(0, 5);
+ this.label1.Name = "label1";
+ this.label1.Size = new System.Drawing.Size(24, 13);
+ this.label1.Text = "Ivy:";
+ //
+ // ivybus
+ //
+ this.ivybus.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
+ | System.Windows.Forms.AnchorStyles.Left)
+ | System.Windows.Forms.AnchorStyles.Right)));
+ this.ivybus.Location = new System.Drawing.Point(30, 0);
+ this.ivybus.Name = "ivybus";
+ this.ivybus.Size = new System.Drawing.Size(129, 20);
+ this.ivybus.TabIndex = 2;
+ this.ivybus.Validated += new System.EventHandler(this.ivybus_Validated);
+ this.ivybus.Validating += new System.ComponentModel.CancelEventHandler(this.ivybus_Validating);
+ //
+ // IvyDomain
+ //
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
+ this.Controls.Add(this.label1);
+ this.Controls.Add(this.ivybus);
+ this.Name = "IvyDomain";
+ this.Size = new System.Drawing.Size(159, 22);
+ this.ResumeLayout(false);
+#if (!PocketPC)
+ this.PerformLayout();
+#endif
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.Label label1;
+ private System.Windows.Forms.TextBox ivybus;
+ }
+}
diff --git a/IvyControl/IvyDomain.cs b/IvyControl/IvyDomain.cs
new file mode 100644
index 0000000..7099db7
--- /dev/null
+++ b/IvyControl/IvyDomain.cs
@@ -0,0 +1,61 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Text;
+using System.Windows.Forms;
+
+namespace IvyBus
+{
+ public partial class IvyDomain : UserControl
+ {
+ private string domain = "";
+ public event EventHandler DomainChanged;
+#if (!PocketPC)
+ [Category("Ivy")]
+ [DefaultValue("")]
+ [Bindable(true)]
+#endif
+ public string Domain
+ {
+ get { return domain; }
+ set {
+ if (domain != value)
+ {
+ domain = value;
+ ivybus.Text = domain;
+ if (DomainChanged != null) DomainChanged(this, EventArgs.Empty);
+ }
+ }
+ }
+
+ public IvyDomain()
+ {
+ InitializeComponent();
+ SetDefault();
+ }
+ public void SetDefault()
+ {
+ if (IsEmpty())
+ {
+ domain = Ivy.GetDomain(domain);
+ ivybus.Text = domain;
+ }
+ }
+ public bool IsEmpty()
+ {
+ return String.IsNullOrEmpty( domain );
+ }
+
+ private void ivybus_Validating(object sender, CancelEventArgs e)
+ {
+ e.Cancel = !Ivy.ValidatingDomain(ivybus.Text);
+ }
+
+ private void ivybus_Validated(object sender, EventArgs e)
+ {
+ if ( domain != ivybus.Text )
+ Domain = ivybus.Text;
+ }
+
+ }
+}
diff --git a/IvyControl/IvyDomain.resx b/IvyControl/IvyDomain.resx
new file mode 100644
index 0000000..ff31a6d
--- /dev/null
+++ b/IvyControl/IvyDomain.resx
@@ -0,0 +1,120 @@
+<?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>
+</root> \ No newline at end of file
diff --git a/IvyControl/Properties/AssemblyInfo.cs b/IvyControl/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..7a49527
--- /dev/null
+++ b/IvyControl/Properties/AssemblyInfo.cs
@@ -0,0 +1,35 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// Les informations générales relatives à un assembly dépendent de
+// l'ensemble d'attributs suivant. Changez les valeurs de ces attributs pour modifier les informations
+// associées à un assembly.
+[assembly: AssemblyTitle("IvyControl")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("Microsoft")]
+[assembly: AssemblyProduct("IvyControl")]
+[assembly: AssemblyCopyright("Copyright © Microsoft 2007")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// L'affectation de la valeur false à ComVisible rend les types invisibles dans cet assembly
+// aux composants COM. Si vous devez accéder à un type dans cet assembly à partir de
+// COM, affectez la valeur true à l'attribut ComVisible sur ce type.
+[assembly: ComVisible(false)]
+
+// Le GUID suivant est pour l'ID de la typelib si ce projet est exposé à COM
+[assembly: Guid("4d442e1e-7b9a-4abf-821a-058dab83df43")]
+
+// Les informations de version pour un assembly se composent des quatre valeurs suivantes :
+//
+// Version principale
+// Version secondaire
+// Numéro de build
+// Révision
+//
+// Vous pouvez spécifier toutes les valeurs ou indiquer les numéros de révision et de build par défaut
+// en utilisant '*', comme indiqué ci-dessous :
+[assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyFileVersion("1.0.0.0")]