diff --git a/App/Common.cs b/App/Common.cs
index 0f0d7773..ae9cb81b 100644
--- a/App/Common.cs
+++ b/App/Common.cs
@@ -3,9 +3,9 @@
using System.Linq;
using System.Text;
using Native.Csharp.Sdk.Cqp;
-using Unity;
+using Autofac;
-namespace native.cqp.NETCore.App
+namespace native.csharp.NETCore.App
{
///
/// 用于存放 App 数据的公共类
@@ -32,10 +32,15 @@ public static class Common
///
public static bool IsRunning { get; set; }
+ ///
+ /// 获取或设置当前 App 使用的依赖注入容器
+ ///
+ public static ContainerBuilder ContainerBuilder { get; set; }
+
///
/// 获取或设置当前 App 使用的依赖注入容器实例
///
- public static IUnityContainer UnityContainer { get; set; }
+ public static IContainer Container { get; set; }
///
/// 获取或设置当前 App 使用的 酷Q Api 接口实例
diff --git a/App/Core/LibExport.cs b/App/Core/LibExport.cs
index cd9c3d28..b47c81c6 100644
--- a/App/Core/LibExport.cs
+++ b/App/Core/LibExport.cs
@@ -6,15 +6,15 @@
using System;
using System.Runtime.InteropServices;
using System.Text;
-using native.cqp.NETCore.App.Event;
+using native.csharp.NETCore.App.Event;
using Native.Csharp.Sdk.Cqp;
using Native.Csharp.Sdk.Cqp.EventArgs;
using Native.Csharp.Sdk.Cqp.Interface;
using Native.Csharp.Sdk.Cqp.Model;
using Native.Csharp.Sdk.Cqp.Expand;
-using Unity;
+using Autofac;
-namespace native.cqp.NETCore.App.Core
+namespace native.csharp.NETCore.App.Core
{
public class LibExport
{
@@ -29,18 +29,22 @@ public class LibExport
static LibExport ()
{
_defaultEncoding = Encoding.GetEncoding ("GB18030");
-
+
// ��ʼ������ע������
- Common.UnityContainer = new UnityContainer ();
+ Common.ContainerBuilder = new ContainerBuilder ();
// ����ʼ���÷�������ע��
- Event_AppMain.Registbackcall (Common.UnityContainer);
+ Event_AppMain.Registbackcall (Common.ContainerBuilder);
// ע����ϵ��÷������зַ�
- Event_AppMain.Resolvebackcall (Common.UnityContainer);
+ Event_AppMain.Resolvebackcall (Common.ContainerBuilder);
+
+ //��������ע������ʵ��
+ Common.Container = Common.ContainerBuilder.Build();
// �ַ�Ӧ�����¼�
ResolveAppbackcall ();
+
}
#endregion
@@ -58,11 +62,10 @@ private static string AppInfo ()
Common.AppVersion = Version.Parse ("1.0.0");
//
- // ��ǰ��Ŀ����: native.cqp.NETCore
+ // ��ǰ��Ŀ����: native.csharp.NETCore
// Api�汾: 9
- return string.Format ("{0},{1}", 9, "native.cqp.NETCore");
- Environment.Exit(7);
+ return string.Format ("{0},{1}", 9, "native.csharp.NETCore");
}
///
@@ -77,7 +80,7 @@ private static int Initialize (int authCode)
Common.CqApi = new CqApi (authCode);
// AuthCode ������Ϻ�����������й�, �Ա���������Ŀ�е���
- Common.UnityContainer.RegisterInstance ("native.cqp.NETCore", Common.CqApi);
+ Common.ContainerBuilder.RegisterInstance (Common.CqApi).Keyed("native.csharp.NETCore");
// ע����ȫ���쳣����ص�, ���ڲ���δ�������쳣, �ص��� ��Q ������
AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
@@ -115,167 +118,167 @@ private static void ResolveAppbackcall ()
* Id: 1
* Name: ˽����Ϣ����
*/
- if (Common.UnityContainer.IsRegistered ("˽����Ϣ����") == true)
+ if (Common.Container.IsRegisteredWithKey ("˽����Ϣ����") == true)
{
- ReceiveFriendMessage_1 = Common.UnityContainer.Resolve ("˽����Ϣ����").ReceiveFriendMessage;
+ ReceiveFriendMessage_1 = Common.Container.ResolveKeyed ("˽����Ϣ����").ReceiveFriendMessage;
}
- if (Common.UnityContainer.IsRegistered ("˽����Ϣ����") == true)
+ if (Common.Container.IsRegisteredWithKey ("˽����Ϣ����") == true)
{
- ReceiveOnlineStatusMessage_1 = Common.UnityContainer.Resolve ("˽����Ϣ����").ReceiveOnlineStatusMessage;
+ ReceiveOnlineStatusMessage_1 = Common.Container.ResolveKeyed ("˽����Ϣ����").ReceiveOnlineStatusMessage;
}
- if (Common.UnityContainer.IsRegistered ("˽����Ϣ����") == true)
+ if (Common.Container.IsRegisteredWithKey ("˽����Ϣ����") == true)
{
- ReceiveGroupPrivateMessage_1 = Common.UnityContainer.Resolve ("˽����Ϣ����").ReceiveGroupPrivateMessage;
+ ReceiveGroupPrivateMessage_1 = Common.Container.ResolveKeyed ("˽����Ϣ����").ReceiveGroupPrivateMessage;
}
- if (Common.UnityContainer.IsRegistered ("˽����Ϣ����") == true)
+ if (Common.Container.IsRegisteredWithKey ("˽����Ϣ����") == true)
{
- ReceiveDiscussPrivateMessage_1 = Common.UnityContainer.Resolve ("˽����Ϣ����").ReceiveDiscussPrivateMessage;
+ ReceiveDiscussPrivateMessage_1 = Common.Container.ResolveKeyed ("˽����Ϣ����").ReceiveDiscussPrivateMessage;
}
/*
* Id: 2
* Name: Ⱥ��Ϣ����
*/
- if (Common.UnityContainer.IsRegistered ("Ⱥ��Ϣ����") == true)
+ if (Common.Container.IsRegisteredWithKey ("Ⱥ��Ϣ����") == true)
{
- ReceiveGroupMessage_2 = Common.UnityContainer.Resolve ("Ⱥ��Ϣ����").ReceiveGroupMessage;
+ ReceiveGroupMessage_2 = Common.Container.ResolveKeyed ("Ⱥ��Ϣ����").ReceiveGroupMessage;
}
/*
* Id: 3
* Name: ��������Ϣ����
*/
- if (Common.UnityContainer.IsRegistered ("��������Ϣ����") == true)
+ if (Common.Container.IsRegisteredWithKey ("��������Ϣ����") == true)
{
- ReceiveDiscussMessage_3 = Common.UnityContainer.Resolve ("��������Ϣ����").ReceiveDiscussMessage;
+ ReceiveDiscussMessage_3 = Common.Container.ResolveKeyed ("��������Ϣ����").ReceiveDiscussMessage;
}
/*
* Id: 4
* Name: Ⱥ�ļ��ϴ��¼�����
*/
- if (Common.UnityContainer.IsRegistered ("Ⱥ�ļ��ϴ��¼�����") == true)
+ if (Common.Container.IsRegisteredWithKey ("Ⱥ�ļ��ϴ��¼�����") == true)
{
- ReceiveFileUploadMessage_4 = Common.UnityContainer.Resolve ("Ⱥ�ļ��ϴ��¼�����").ReceiveGroupFileUpload;
+ ReceiveFileUploadMessage_4 = Common.Container.ResolveKeyed ("Ⱥ�ļ��ϴ��¼�����").ReceiveGroupFileUpload;
}
/*
* Id: 5
* Name: Ⱥ�����䶯�¼�����
*/
- if (Common.UnityContainer.IsRegistered ("Ⱥ�����䶯�¼�����") == true)
+ if (Common.Container.IsRegisteredWithKey ("Ⱥ�����䶯�¼�����") == true)
{
- ReceiveManageIncrease_5 = Common.UnityContainer.Resolve ("Ⱥ�����䶯�¼�����").ReceiveGroupManageIncrease;
+ ReceiveManageIncrease_5 = Common.Container.ResolveKeyed ("Ⱥ�����䶯�¼�����").ReceiveGroupManageIncrease;
}
- if (Common.UnityContainer.IsRegistered ("Ⱥ�����䶯�¼�����") == true)
+ if (Common.Container.IsRegisteredWithKey ("Ⱥ�����䶯�¼�����") == true)
{
- ReceiveManageDecrease_5 = Common.UnityContainer.Resolve ("Ⱥ�����䶯�¼�����").ReceiveGroupManageDecrease;
+ ReceiveManageDecrease_5 = Common.Container.ResolveKeyed ("Ⱥ�����䶯�¼�����").ReceiveGroupManageDecrease;
}
/*
* Id: 6
* Name: Ⱥ��Ա�����¼�����
*/
- if (Common.UnityContainer.IsRegistered ("Ⱥ��Ա�����¼�����") == true)
+ if (Common.Container.IsRegisteredWithKey ("Ⱥ��Ա�����¼�����") == true)
{
- ReceiveMemberLeave_6 = Common.UnityContainer.Resolve ("Ⱥ��Ա�����¼�����").ReceiveGroupMemberLeave;
+ ReceiveMemberLeave_6 = Common.Container.ResolveKeyed ("Ⱥ��Ա�����¼�����").ReceiveGroupMemberLeave;
}
- if (Common.UnityContainer.IsRegistered ("Ⱥ��Ա�����¼�����") == true)
+ if (Common.Container.IsRegisteredWithKey ("Ⱥ��Ա�����¼�����") == true)
{
- ReceiveMemberRemove_6 = Common.UnityContainer.Resolve ("Ⱥ��Ա�����¼�����").ReceiveGroupMemberRemove;
+ ReceiveMemberRemove_6 = Common.Container.ResolveKeyed ("Ⱥ��Ա�����¼�����").ReceiveGroupMemberRemove;
}
/*
* Id: 7
* Name: Ⱥ��Ա�����¼�����
*/
- if (Common.UnityContainer.IsRegistered ("Ⱥ��Ա�����¼�����") == true)
+ if (Common.Container.IsRegisteredWithKey ("Ⱥ��Ա�����¼�����") == true)
{
- ReceiveMemberPass_7 = Common.UnityContainer.Resolve ("Ⱥ��Ա�����¼�����").ReceiveGroupMemberPass;
+ ReceiveMemberPass_7 = Common.Container.ResolveKeyed ("Ⱥ��Ա�����¼�����").ReceiveGroupMemberPass;
}
- if (Common.UnityContainer.IsRegistered ("Ⱥ��Ա�����¼�����") == true)
+ if (Common.Container.IsRegisteredWithKey ("Ⱥ��Ա�����¼�����") == true)
{
- ReceiveMemberBeInvitee_7 = Common.UnityContainer.Resolve ("Ⱥ��Ա�����¼�����").ReceiveGroupMemberBeInvitee;
+ ReceiveMemberBeInvitee_7 = Common.Container.ResolveKeyed ("Ⱥ��Ա�����¼�����").ReceiveGroupMemberBeInvitee;
}
/*
* Id: 8
* Name: Ⱥ�����¼�����
*/
- if (Common.UnityContainer.IsRegistered ("Ⱥ�����¼�����") == true)
+ if (Common.Container.IsRegisteredWithKey ("Ⱥ�����¼�����") == true)
{
- ReceiveSetGroupBan_8 = Common.UnityContainer.Resolve ("Ⱥ�����¼�����").ReceiveSetGroupBan;
+ ReceiveSetGroupBan_8 = Common.Container.ResolveKeyed ("Ⱥ�����¼�����").ReceiveSetGroupBan;
}
- if (Common.UnityContainer.IsRegistered ("Ⱥ�����¼�����") == true)
+ if (Common.Container.IsRegisteredWithKey ("Ⱥ�����¼�����") == true)
{
- ReceiveRemoveGroupBan_8 = Common.UnityContainer.Resolve ("Ⱥ�����¼�����").ReceiveRemoveGroupBan;
+ ReceiveRemoveGroupBan_8 = Common.Container.ResolveKeyed ("Ⱥ�����¼�����").ReceiveRemoveGroupBan;
}
/*
* Id: 10
* Name: �����������¼�����
*/
- if (Common.UnityContainer.IsRegistered ("�����������¼�����") == true)
+ if (Common.Container.IsRegisteredWithKey ("�����������¼�����") == true)
{
- ReceiveFriendIncrease_10 = Common.UnityContainer.Resolve ("�����������¼�����").ReceiveFriendIncrease;
+ ReceiveFriendIncrease_10 = Common.Container.ResolveKeyed ("�����������¼�����").ReceiveFriendIncrease;
}
/*
* Id: 11
* Name: ��������������
*/
- if (Common.UnityContainer.IsRegistered ("��������������") == true)
+ if (Common.Container.IsRegisteredWithKey ("��������������") == true)
{
- ReceiveFriendAdd_11 = Common.UnityContainer.Resolve ("��������������").ReceiveFriendAddRequest;
+ ReceiveFriendAdd_11 = Common.Container.ResolveKeyed ("��������������").ReceiveFriendAddRequest;
}
/*
* Id: 12
* Name: Ⱥ����������
*/
- if (Common.UnityContainer.IsRegistered ("Ⱥ����������") == true)
+ if (Common.Container.IsRegisteredWithKey ("Ⱥ����������") == true)
{
- ReceiveAddGroupRequest_12 = Common.UnityContainer.Resolve ("Ⱥ����������").ReceiveAddGroupRequest;
+ ReceiveAddGroupRequest_12 = Common.Container.ResolveKeyed ("Ⱥ����������").ReceiveAddGroupRequest;
}
- if (Common.UnityContainer.IsRegistered ("Ⱥ����������") == true)
+ if (Common.Container.IsRegisteredWithKey ("Ⱥ����������") == true)
{
- ReceiveAddGroupBeInvitee_12 = Common.UnityContainer.Resolve ("Ⱥ����������").ReceiveAddGroupBeInvitee;
+ ReceiveAddGroupBeInvitee_12 = Common.Container.ResolveKeyed ("Ⱥ����������").ReceiveAddGroupBeInvitee;
}
/*
* Id: 1001
* Name: ��Q�����¼�
*/
- if (Common.UnityContainer.IsRegistered ("��Q�����¼�") == true)
+ if (Common.Container.IsRegisteredWithKey ("��Q�����¼�") == true)
{
- CqStartup_1001 = Common.UnityContainer.Resolve ("��Q�����¼�").CqStartup;
+ CqStartup_1001 = Common.Container.ResolveKeyed ("��Q�����¼�").CqStartup;
}
/*
* Id: 1002
* Name: ��Q�ر��¼�
*/
- if (Common.UnityContainer.IsRegistered ("��Q�ر��¼�") == true)
+ if (Common.Container.IsRegisteredWithKey ("��Q�ر��¼�") == true)
{
- CqExit_1002 = Common.UnityContainer.Resolve ("��Q�ر��¼�").CqExit;
+ CqExit_1002 = Common.Container.ResolveKeyed ("��Q�ر��¼�").CqExit;
}
/*
* Id: 1003
* Name: Ӧ���ѱ�����
*/
- if (Common.UnityContainer.IsRegistered ("Ӧ���ѱ�����") == true)
+ if (Common.Container.IsRegisteredWithKey ("Ӧ���ѱ�����") == true)
{
- AppEnable_1003 = Common.UnityContainer.Resolve ("Ӧ���ѱ�����").CqAppEnable;
+ AppEnable_1003 = Common.Container.ResolveKeyed ("Ӧ���ѱ�����").CqAppEnable;
}
/*
* Id: 1004
* Name: Ӧ�ý���ͣ��
*/
- if (Common.UnityContainer.IsRegistered ("Ӧ�ý���ͣ��") == true)
+ if (Common.Container.IsRegisteredWithKey ("Ӧ�ý���ͣ��") == true)
{
- AppDisable_1004 = Common.UnityContainer.Resolve ("Ӧ�ý���ͣ��").CqAppDisable;
+ AppDisable_1004 = Common.Container.ResolveKeyed ("Ӧ�ý���ͣ��").CqAppDisable;
}
diff --git a/App/Core/LibExport.tt b/App/Core/LibExport.tt
index a6a0ddd0..05abf37c 100644
--- a/App/Core/LibExport.tt
+++ b/App/Core/LibExport.tt
@@ -27,15 +27,15 @@
using System;
using System.Runtime.InteropServices;
using System.Text;
-using Native.Csharp.App.Event;
+using native.csharp.NETCore.App.Event;
using Native.Csharp.Sdk.Cqp;
using Native.Csharp.Sdk.Cqp.EventArgs;
using Native.Csharp.Sdk.Cqp.Interface;
using Native.Csharp.Sdk.Cqp.Model;
using Native.Csharp.Sdk.Cqp.Expand;
-using Unity;
+using Autofac;
-namespace native.cqp.NETCore.App.Core
+namespace native.csharp.NETCore.App.Core
{
public class LibExport
{
@@ -51,20 +51,21 @@ namespace native.cqp.NETCore.App.Core
{
_defaultEncoding = Encoding.GetEncoding ("GB18030");
- // 初始化 Costura.Fody
- CosturaUtility.Initialize ();
-
// 初始化依赖注入容器
- Common.UnityContainer = new UnityContainer ();
+ Common.ContainerBuilder = new ContainerBuilder ();
// 程序开始调用方法进行注册
- Event_AppMain.Registbackcall (Common.UnityContainer);
+ Event_AppMain.Registbackcall (Common.ContainerBuilder);
// 注册完毕调用方法进行分发
- Event_AppMain.Resolvebackcall (Common.UnityContainer);
+ Event_AppMain.Resolvebackcall (Common.ContainerBuilder);
+
+ //建立依赖注入容器实例
+ Common.Container = Common.ContainerBuilder.Build();
// 分发应用内事件
ResolveAppbackcall ();
+
}
#endregion
@@ -100,7 +101,7 @@ namespace native.cqp.NETCore.App.Core
Common.CqApi = new CqApi (authCode);
// AuthCode 传递完毕后将对象加入容器托管, 以便在其它项目中调用
- Common.UnityContainer.RegisterInstance ("<#= Host.ResolveAssemblyReference ("$(TargetName)") #>", Common.CqApi);
+ Common.ContainerBuilder.RegisterInstance (Common.CqApi).Keyed("<#= Host.ResolveAssemblyReference ("$(TargetName)") #>");
// 注册插件全局异常捕获回调, 用于捕获未处理的异常, 回弹给 酷Q 做处理
AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
@@ -554,125 +555,125 @@ namespace native.cqp.NETCore.App.Core
switch (token["type"].Value ())
{
case 1001:
- temp.AppendLine (string.Format ("\t\t\tif (Common.UnityContainer.IsRegistered (\"{0}\") == true)", token["name"].Value ()));
+ temp.AppendLine (string.Format ("\t\t\tif (Common.Container.IsRegisteredWithKey (\"{0}\") == true)", token["name"].Value ()));
temp.AppendLine ("\t\t\t{");
- temp.AppendLine (string.Format ("\t\t\t\tCqStartup_{0} = Common.UnityContainer.Resolve (\"{1}\").CqStartup;", token["id"].Value (), token["name"].Value ()));
+ temp.AppendLine (string.Format ("\t\t\t\tCqStartup_{0} = Common.Container.ResolveKeyed (\"{1}\").CqStartup;", token["id"].Value (), token["name"].Value ()));
temp.AppendLine ("\t\t\t}");
break;
case 1002:
- temp.AppendLine (string.Format ("\t\t\tif (Common.UnityContainer.IsRegistered (\"{0}\") == true)", token["name"].Value ()));
+ temp.AppendLine (string.Format ("\t\t\tif (Common.Container.IsRegisteredWithKey (\"{0}\") == true)", token["name"].Value ()));
temp.AppendLine ("\t\t\t{");
- temp.AppendLine (string.Format ("\t\t\t\tCqExit_{0} = Common.UnityContainer.Resolve (\"{1}\").CqExit;", token["id"].Value (), token["name"].Value ()));
+ temp.AppendLine (string.Format ("\t\t\t\tCqExit_{0} = Common.Container.ResolveKeyed (\"{1}\").CqExit;", token["id"].Value (), token["name"].Value ()));
temp.AppendLine ("\t\t\t}");
break;
case 1003:
- temp.AppendLine (string.Format ("\t\t\tif (Common.UnityContainer.IsRegistered (\"{0}\") == true)", token["name"].Value ()));
+ temp.AppendLine (string.Format ("\t\t\tif (Common.Container.IsRegisteredWithKey (\"{0}\") == true)", token["name"].Value ()));
temp.AppendLine ("\t\t\t{");
- temp.AppendLine (string.Format ("\t\t\t\tAppEnable_{0} = Common.UnityContainer.Resolve (\"{1}\").CqAppEnable;", token["id"].Value (), token["name"].Value ()));
+ temp.AppendLine (string.Format ("\t\t\t\tAppEnable_{0} = Common.Container.ResolveKeyed (\"{1}\").CqAppEnable;", token["id"].Value (), token["name"].Value ()));
temp.AppendLine ("\t\t\t}");
break;
case 1004:
- temp.AppendLine (string.Format ("\t\t\tif (Common.UnityContainer.IsRegistered (\"{0}\") == true)", token["name"].Value ()));
+ temp.AppendLine (string.Format ("\t\t\tif (Common.Container.IsRegisteredWithKey (\"{0}\") == true)", token["name"].Value ()));
temp.AppendLine ("\t\t\t{");
- temp.AppendLine (string.Format ("\t\t\t\tAppDisable_{0} = Common.UnityContainer.Resolve (\"{1}\").CqAppDisable;", token["id"].Value (), token["name"].Value ()));
+ temp.AppendLine (string.Format ("\t\t\t\tAppDisable_{0} = Common.Container.ResolveKeyed (\"{1}\").CqAppDisable;", token["id"].Value (), token["name"].Value ()));
temp.AppendLine ("\t\t\t}");
break;
case 21:
- temp.AppendLine (string.Format ("\t\t\tif (Common.UnityContainer.IsRegistered (\"{0}\") == true)", token["name"].Value ()));
+ temp.AppendLine (string.Format ("\t\t\tif (Common.Container.IsRegisteredWithKey (\"{0}\") == true)", token["name"].Value ()));
temp.AppendLine ("\t\t\t{");
- temp.AppendLine (string.Format ("\t\t\t\tReceiveFriendMessage_{0} = Common.UnityContainer.Resolve (\"{1}\").ReceiveFriendMessage;", token["id"].Value (), token["name"].Value ()));
+ temp.AppendLine (string.Format ("\t\t\t\tReceiveFriendMessage_{0} = Common.Container.ResolveKeyed (\"{1}\").ReceiveFriendMessage;", token["id"].Value (), token["name"].Value ()));
temp.AppendLine ("\t\t\t}");
- temp.AppendLine (string.Format ("\t\t\tif (Common.UnityContainer.IsRegistered (\"{0}\") == true)", token["name"].Value ()));
+ temp.AppendLine (string.Format ("\t\t\tif (Common.Container.IsRegisteredWithKey (\"{0}\") == true)", token["name"].Value ()));
temp.AppendLine ("\t\t\t{");
- temp.AppendLine (string.Format ("\t\t\t\tReceiveOnlineStatusMessage_{0} = Common.UnityContainer.Resolve (\"{1}\").ReceiveOnlineStatusMessage;", token["id"].Value (), token["name"].Value ()));
+ temp.AppendLine (string.Format ("\t\t\t\tReceiveOnlineStatusMessage_{0} = Common.Container.ResolveKeyed (\"{1}\").ReceiveOnlineStatusMessage;", token["id"].Value (), token["name"].Value ()));
temp.AppendLine ("\t\t\t}");
- temp.AppendLine (string.Format ("\t\t\tif (Common.UnityContainer.IsRegistered (\"{0}\") == true)", token["name"].Value ()));
+ temp.AppendLine (string.Format ("\t\t\tif (Common.Container.IsRegisteredWithKey (\"{0}\") == true)", token["name"].Value ()));
temp.AppendLine ("\t\t\t{");
- temp.AppendLine (string.Format ("\t\t\t\tReceiveGroupPrivateMessage_{0} = Common.UnityContainer.Resolve (\"{1}\").ReceiveGroupPrivateMessage;", token["id"].Value (), token["name"].Value ()));
+ temp.AppendLine (string.Format ("\t\t\t\tReceiveGroupPrivateMessage_{0} = Common.Container.ResolveKeyed (\"{1}\").ReceiveGroupPrivateMessage;", token["id"].Value (), token["name"].Value ()));
temp.AppendLine ("\t\t\t}");
- temp.AppendLine (string.Format ("\t\t\tif (Common.UnityContainer.IsRegistered (\"{0}\") == true)", token["name"].Value ()));
+ temp.AppendLine (string.Format ("\t\t\tif (Common.Container.IsRegisteredWithKey (\"{0}\") == true)", token["name"].Value ()));
temp.AppendLine ("\t\t\t{");
- temp.AppendLine (string.Format ("\t\t\t\tReceiveDiscussPrivateMessage_{0} = Common.UnityContainer.Resolve (\"{1}\").ReceiveDiscussPrivateMessage;", token["id"].Value (), token["name"].Value ()));
+ temp.AppendLine (string.Format ("\t\t\t\tReceiveDiscussPrivateMessage_{0} = Common.Container.ResolveKeyed (\"{1}\").ReceiveDiscussPrivateMessage;", token["id"].Value (), token["name"].Value ()));
temp.AppendLine ("\t\t\t}");
break;
case 2:
- temp.AppendLine (string.Format ("\t\t\tif (Common.UnityContainer.IsRegistered (\"{0}\") == true)", token["name"].Value ()));
+ temp.AppendLine (string.Format ("\t\t\tif (Common.Container.IsRegisteredWithKey (\"{0}\") == true)", token["name"].Value ()));
temp.AppendLine ("\t\t\t{");
- temp.AppendLine (string.Format ("\t\t\t\tReceiveGroupMessage_{0} = Common.UnityContainer.Resolve (\"{1}\").ReceiveGroupMessage;", token["id"].Value (), token["name"].Value ()));
+ temp.AppendLine (string.Format ("\t\t\t\tReceiveGroupMessage_{0} = Common.Container.ResolveKeyed (\"{1}\").ReceiveGroupMessage;", token["id"].Value (), token["name"].Value ()));
temp.AppendLine ("\t\t\t}");
break;
case 4:
- temp.AppendLine (string.Format ("\t\t\tif (Common.UnityContainer.IsRegistered (\"{0}\") == true)", token["name"].Value ()));
+ temp.AppendLine (string.Format ("\t\t\tif (Common.Container.IsRegisteredWithKey (\"{0}\") == true)", token["name"].Value ()));
temp.AppendLine ("\t\t\t{");
- temp.AppendLine (string.Format ("\t\t\t\tReceiveDiscussMessage_{0} = Common.UnityContainer.Resolve (\"{1}\").ReceiveDiscussMessage;", token["id"].Value (), token["name"].Value ()));
+ temp.AppendLine (string.Format ("\t\t\t\tReceiveDiscussMessage_{0} = Common.Container.ResolveKeyed (\"{1}\").ReceiveDiscussMessage;", token["id"].Value (), token["name"].Value ()));
temp.AppendLine ("\t\t\t}");
break;
case 11:
- temp.AppendLine (string.Format ("\t\t\tif (Common.UnityContainer.IsRegistered (\"{0}\") == true)", token["name"].Value ()));
+ temp.AppendLine (string.Format ("\t\t\tif (Common.Container.IsRegisteredWithKey (\"{0}\") == true)", token["name"].Value ()));
temp.AppendLine ("\t\t\t{");
- temp.AppendLine (string.Format ("\t\t\t\tReceiveFileUploadMessage_{0} = Common.UnityContainer.Resolve (\"{1}\").ReceiveGroupFileUpload;", token["id"].Value (), token["name"].Value ()));
+ temp.AppendLine (string.Format ("\t\t\t\tReceiveFileUploadMessage_{0} = Common.Container.ResolveKeyed (\"{1}\").ReceiveGroupFileUpload;", token["id"].Value (), token["name"].Value ()));
temp.AppendLine ("\t\t\t}");
break;
case 101:
- temp.AppendLine (string.Format ("\t\t\tif (Common.UnityContainer.IsRegistered (\"{0}\") == true)", token["name"].Value ()));
+ temp.AppendLine (string.Format ("\t\t\tif (Common.Container.IsRegisteredWithKey (\"{0}\") == true)", token["name"].Value ()));
temp.AppendLine ("\t\t\t{");
- temp.AppendLine (string.Format ("\t\t\t\tReceiveManageIncrease_{0} = Common.UnityContainer.Resolve (\"{1}\").ReceiveGroupManageIncrease;", token["id"].Value (), token["name"].Value ()));
+ temp.AppendLine (string.Format ("\t\t\t\tReceiveManageIncrease_{0} = Common.Container.ResolveKeyed (\"{1}\").ReceiveGroupManageIncrease;", token["id"].Value (), token["name"].Value ()));
temp.AppendLine ("\t\t\t}");
- temp.AppendLine (string.Format ("\t\t\tif (Common.UnityContainer.IsRegistered (\"{0}\") == true)", token["name"].Value ()));
+ temp.AppendLine (string.Format ("\t\t\tif (Common.Container.IsRegisteredWithKey (\"{0}\") == true)", token["name"].Value ()));
temp.AppendLine ("\t\t\t{");
- temp.AppendLine (string.Format ("\t\t\t\tReceiveManageDecrease_{0} = Common.UnityContainer.Resolve (\"{1}\").ReceiveGroupManageDecrease;", token["id"].Value (), token["name"].Value ()));
+ temp.AppendLine (string.Format ("\t\t\t\tReceiveManageDecrease_{0} = Common.Container.ResolveKeyed (\"{1}\").ReceiveGroupManageDecrease;", token["id"].Value (), token["name"].Value ()));
temp.AppendLine ("\t\t\t}");
break;
case 102:
- temp.AppendLine (string.Format ("\t\t\tif (Common.UnityContainer.IsRegistered (\"{0}\") == true)", token["name"].Value ()));
+ temp.AppendLine (string.Format ("\t\t\tif (Common.Container.IsRegisteredWithKey (\"{0}\") == true)", token["name"].Value ()));
temp.AppendLine ("\t\t\t{");
- temp.AppendLine (string.Format ("\t\t\t\tReceiveMemberLeave_{0} = Common.UnityContainer.Resolve (\"{1}\").ReceiveGroupMemberLeave;", token["id"].Value (), token["name"].Value ()));
+ temp.AppendLine (string.Format ("\t\t\t\tReceiveMemberLeave_{0} = Common.Container.ResolveKeyed (\"{1}\").ReceiveGroupMemberLeave;", token["id"].Value (), token["name"].Value ()));
temp.AppendLine ("\t\t\t}");
- temp.AppendLine (string.Format ("\t\t\tif (Common.UnityContainer.IsRegistered (\"{0}\") == true)", token["name"].Value ()));
+ temp.AppendLine (string.Format ("\t\t\tif (Common.Container.IsRegisteredWithKey (\"{0}\") == true)", token["name"].Value ()));
temp.AppendLine ("\t\t\t{");
- temp.AppendLine (string.Format ("\t\t\t\tReceiveMemberRemove_{0} = Common.UnityContainer.Resolve (\"{1}\").ReceiveGroupMemberRemove;", token["id"].Value (), token["name"].Value ()));
+ temp.AppendLine (string.Format ("\t\t\t\tReceiveMemberRemove_{0} = Common.Container.ResolveKeyed (\"{1}\").ReceiveGroupMemberRemove;", token["id"].Value (), token["name"].Value ()));
temp.AppendLine ("\t\t\t}");
break;
case 103:
- temp.AppendLine (string.Format ("\t\t\tif (Common.UnityContainer.IsRegistered (\"{0}\") == true)", token["name"].Value ()));
+ temp.AppendLine (string.Format ("\t\t\tif (Common.Container.IsRegisteredWithKey (\"{0}\") == true)", token["name"].Value