summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Ivy/Ivy.cs142
-rw-r--r--Ivy/Ivy.csproj31
-rw-r--r--Ivy/IvyApplicationBinding.cs50
-rw-r--r--Ivy/Properties/AssemblyInfo.cs2
-rw-r--r--Ivy/Properties/Settings.Designer.cs8
5 files changed, 23 insertions, 210 deletions
diff --git a/Ivy/Ivy.cs b/Ivy/Ivy.cs
index d8e84ce..14a3918 100644
--- a/Ivy/Ivy.cs
+++ b/Ivy/Ivy.cs
@@ -20,49 +20,25 @@ namespace IvyBus
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 Ivy : System.ComponentModel.Component, ISupportInitialize
+
+ public class Ivy
{
/* Event */
- [Description("Occurs when a new client connect to the bus")]
public event EventHandler<IvyEventArgs> ClientConnected;
- [Description("Occurs when a client discconnect from the bus")]
public event EventHandler<IvyEventArgs> ClientDisconnected;
- [Description("Occurs when a client receive a direct message from another client")]
public event EventHandler<IvyEventArgs> DirectMessageReceived;
- [Description("Occurs when somebody ask for killing every client on the bus")]
public event EventHandler<IvyDieEventArgs> DieReceived;
- [Description("Occurs when a client receive a add binding from another client")]
public event EventHandler<IvyEventArgs> BindingAdd;
- [Description("Occurs when a client receive a remove binding from another client")]
public event EventHandler<IvyEventArgs> BindingRemove;
- [Description("Occurs when a client receive a binding from another client and it as been filtered ")]
public event EventHandler<IvyEventArgs> BindingFilter;
- [Description("Occurs when a client receive a remove binding from another client")]
public event EventHandler<IvyEventArgs> ErrorMessage;
-#if (!PocketPC)
- [Bindable(true)]
- [Category("Ivy")]
-#endif
- [DefaultValue(false)]
+
public static bool DebugProtocol
{
get
@@ -75,9 +51,7 @@ namespace IvyBus
}
}
-#if (!PocketPC)
- [Category("Ivy")]
-#endif
+
public CultureInfo Culture
{
get
@@ -92,9 +66,7 @@ namespace IvyBus
}
/// <summary>IvyClients accesses the list of the connected clients</summary>
-#if (!PocketPC)
- [Browsable(false)]
-#endif
+
public List<IvyClient> IvyClients
{
get
@@ -106,11 +78,6 @@ namespace IvyBus
/// <summary>AppName the application name</summary>
-#if (!PocketPC)
- [Category("Ivy")]
- [Bindable(true)]
-#endif
- [DefaultValue(null)]
public string AppName
{
set
@@ -125,9 +92,6 @@ namespace IvyBus
}
/// <summary>AppId the Application Unique ID</summary>
-#if (!PocketPC)
- [Browsable(false)]
-#endif
public string AppId
{
get
@@ -137,10 +101,7 @@ namespace IvyBus
}
/// <summary>AppPriority the Application Priority: the clients list is sorted against priority</summary>
-#if (!PocketPC)
- [Category("Ivy")]
-#endif
- [DefaultValue(DEFAULT_PRIORITY)]
+
public ushort AppPriority
{
set
@@ -162,9 +123,6 @@ namespace IvyBus
}
-#if (!PocketPC)
- [Browsable(false)]
-#endif
public int ProtocolVersion
{
get
@@ -176,9 +134,6 @@ namespace IvyBus
/// <summary>IsRunning is the bus Started and connected ?</summary>
-#if (!PocketPC)
- [Browsable(false)]
-#endif
public bool IsRunning
{
get
@@ -190,13 +145,7 @@ namespace IvyBus
///<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
@@ -206,43 +155,12 @@ namespace IvyBus
}
/// <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 ready_message; }
set { ready_message = 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<IvyApplicationBinding> Bindings
- {
- get { return app_bindings; }
- }
-
internal class MyTcpListener : TcpListener
{
public MyTcpListener(IPAddress address, int port)
@@ -259,7 +177,7 @@ namespace IvyBus
/// the port for the UDP rendez vous, if none is supplied
internal const ushort DEFAULT_PORT = 2010;
// client default priority
- internal const ushort DEFAULT_PRIORITY = 100;
+ public const ushort DEFAULT_PRIORITY = 100;
/// the domain for the UDP rendez vous
private static readonly string DEFAULT_DOMAIN = "127.255.255.255:" + DEFAULT_PORT;
internal int protocolVersion = 3;
@@ -270,8 +188,6 @@ namespace IvyBus
private volatile Thread serverThread; // to ensure quick communication of the end
internal Dictionary<int, IvyApplicationBinding> bindings;
- //TODO should be remove same as above
- private List<IvyApplicationBinding> app_bindings;
private List<IvyClient> clients;
private List<string> sent_messageFilter;
private bool stopped = true;
@@ -301,7 +217,6 @@ namespace IvyBus
#endif
clients = new List<IvyClient>();
bindings = new Dictionary<int, IvyApplicationBinding>();
- app_bindings = new List<IvyApplicationBinding>();
sent_messageFilter = new List<string>();
#if (!PocketPC)
debugProtocol = Properties.Settings.Default.IvyDebug;
@@ -317,16 +232,7 @@ namespace IvyBus
if ( assembly != this.GetType().Assembly )
BindAttibute(assembly);
}
- public Ivy(IContainer container)
- : this()
- {
- container.Add(this);
- // get binding from Attribute IvyBinding
- //TODO Autobinding attribute
- Assembly assembly = Assembly.GetCallingAssembly();
- if (assembly != this.GetType().Assembly)
- BindAttibute(assembly);
- }
+
/// <summary>
/// Readies the structures for the software bus connexion.
/// </summary>
@@ -362,20 +268,6 @@ namespace IvyBus
BindAttibute(assembly);
}
- protected override void Dispose(bool disposing)
- {
- try
- {
- if (disposing)
- {
- Stop();
- }
- }
- finally
- {
- base.Dispose(disposing);
- }
- }
// Autobinding on static method
public void BindAttibute(Type type)
@@ -1163,23 +1055,5 @@ namespace IvyBus
return Regex.IsMatch(p, @"\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}:\d+");
}
- #region ISupportInitialize Members
-
- public void BeginInit()
- {
-
- }
-
- public void EndInit()
- {
- // TODO ugly should be added directly the bindings Dictionary !
- foreach (IvyApplicationBinding bind in app_bindings)
- {
- BindMsg(bind);
- }
- }
-
- #endregion
-
}
} \ No newline at end of file
diff --git a/Ivy/Ivy.csproj b/Ivy/Ivy.csproj
index 1944b08..4977434 100644
--- a/Ivy/Ivy.csproj
+++ b/Ivy/Ivy.csproj
@@ -14,9 +14,8 @@
</ApplicationIcon>
<AssemblyKeyContainerName>
</AssemblyKeyContainerName>
- <AssemblyName>Ivy</AssemblyName>
- <AssemblyOriginatorKeyFile>
- </AssemblyOriginatorKeyFile>
+ <AssemblyName>IvyBus.Ivy</AssemblyName>
+ <AssemblyOriginatorKeyFile>IvySignKey.pfx</AssemblyOriginatorKeyFile>
<DefaultClientScript>JScript</DefaultClientScript>
<DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
<DefaultTargetSchema>IE50</DefaultTargetSchema>
@@ -30,6 +29,7 @@
</FileUpgradeFlags>
<UpgradeBackupLocation>
</UpgradeBackupLocation>
+ <SignAssembly>true</SignAssembly>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<OutputPath>bin\Debug\</OutputPath>
@@ -108,29 +108,12 @@
<Name>System</Name>
</Reference>
<Reference Include="System.Data" />
- <Reference Include="System.Design">
- <Name>System.Design</Name>
- </Reference>
- <Reference Include="System.Drawing" />
- <Reference Include="System.Management">
- <Name>System.Management</Name>
- </Reference>
- <Reference Include="System.Windows.Forms">
- <Name>System.Windows.Forms</Name>
- </Reference>
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="IvyApplicationBinding.cs">
- <SubType>Component</SubType>
</Compile>
<Compile Include="IvyBindingAttribute.cs" />
- <Compile Include="IvyDomain.cs">
- <SubType>UserControl</SubType>
- </Compile>
- <Compile Include="IvyDomain.Designer.cs">
- <DependentUpon>IvyDomain.cs</DependentUpon>
- </Compile>
<Compile Include="IvyEventArgs.cs" />
<Compile Include="IvyProtocol.cs" />
<Compile Include="IvyTCPStreamV3.cs" />
@@ -139,7 +122,6 @@
<SubType>Code</SubType>
</Compile>
<Compile Include="Ivy.cs">
- <SubType>Component</SubType>
</Compile>
<Compile Include="IvyBinding.cs">
<SubType>Code</SubType>
@@ -168,17 +150,12 @@
<ItemGroup>
<None Include="app.config" />
<None Include="Ivy.snippet" />
+ <None Include="IvySignKey.pfx" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
</ItemGroup>
- <ItemGroup>
- <EmbeddedResource Include="IvyDomain.resx">
- <SubType>Designer</SubType>
- <DependentUpon>IvyDomain.cs</DependentUpon>
- </EmbeddedResource>
- </ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PreBuildEvent>
diff --git a/Ivy/IvyApplicationBinding.cs b/Ivy/IvyApplicationBinding.cs
index 9183850..299f459 100644
--- a/Ivy/IvyApplicationBinding.cs
+++ b/Ivy/IvyApplicationBinding.cs
@@ -2,7 +2,6 @@ using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Text;
-using System.ComponentModel;
using System.Threading;
namespace IvyBus
@@ -10,19 +9,11 @@ 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 IvyApplicationBinding : System.ComponentModel.Component
+
+ public class IvyApplicationBinding
{
private BindingType binding;
-#if (!PocketPC)
- [Category("Ivy")]
-#endif
public BindingType Binding
{
get { return binding; }
@@ -30,10 +21,7 @@ namespace IvyBus
}
private ushort key;
- #if (!PocketPC)
- [Browsable(false)]
- [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
-#endif
+
public ushort Key
{
get { return key; }
@@ -41,20 +29,14 @@ namespace IvyBus
}
private object[] args;
-#if (!PocketPC)
- [Browsable(false)]
- [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
-#endif
+
public object[] Args
{
get { return args; }
set { args = value; }
}
private string expression;
-#if (!PocketPC)
- [Category("Ivy")]
-#endif
- [DefaultValue(null)]
+
public string Expression
{
get { return expression; }
@@ -74,19 +56,7 @@ namespace IvyBus
///<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
@@ -95,21 +65,13 @@ namespace IvyBus
}
}
-#if (!PocketPC)
- [Category("Ivy")]
- [Description("Event fired when Message Matching expression received")]
-#endif
public event EventHandler<IvyMessageEventArgs> Callback;
public IvyApplicationBinding()
{
arguments = new List<string>();
}
- public IvyApplicationBinding(IContainer container)
- : this()
- {
- container.Add(this);
- }
+
// translate part of expression to object property
public void FormatExpression()
{
diff --git a/Ivy/Properties/AssemblyInfo.cs b/Ivy/Properties/AssemblyInfo.cs
index a3ce834..96176ce 100644
--- a/Ivy/Properties/AssemblyInfo.cs
+++ b/Ivy/Properties/AssemblyInfo.cs
@@ -8,7 +8,7 @@ using System.Runtime.InteropServices;
[assembly: AssemblyTitle("Ivy")]
[assembly: AssemblyDescription("Dll de communications sur le bus IVY")]
-[assembly: AssemblyCompany("DTI/SDER PII")]
+[assembly: AssemblyCompany("DTI/R&D PII")]
[assembly: AssemblyProduct("Ivy")]
[assembly: AssemblyCopyright("SDER")]
[assembly: AssemblyTrademark("")]
diff --git a/Ivy/Properties/Settings.Designer.cs b/Ivy/Properties/Settings.Designer.cs
index 96b0f2d..3356385 100644
--- a/Ivy/Properties/Settings.Designer.cs
+++ b/Ivy/Properties/Settings.Designer.cs
@@ -1,10 +1,10 @@
//------------------------------------------------------------------------------
// <auto-generated>
-// This code was generated by a tool.
-// Runtime Version:2.0.50727.42
+// Ce code a été généré par un outil.
+// Version du runtime :2.0.50727.312
//
-// Changes to this file may cause incorrect behavior and will be lost if
-// the code is regenerated.
+// Les modifications apportées à ce fichier peuvent provoquer un comportement incorrect et seront perdues si
+// le code est régénéré.
// </auto-generated>
//------------------------------------------------------------------------------