示例#1
0
 /// <summary>
 /// 获取Portal对象
 /// </summary>
 /// <param name="objectType"></param>
 /// <returns></returns>
 private Server.IDataPortalServer GetPortal(Type objectType)
 {
     if (_portal == null)
     {
         string url = string.Empty;
         DataPortalSettingAttribute dpsa = (DataPortalSettingAttribute)Attribute.GetCustomAttribute(objectType, typeof(DataPortalSettingAttribute), false);
         if (dpsa != null)
         {
             url = ConfigurationManager.AppSettings[dpsa.PortalUrlSetting];
         }
         else
         {
             url = ConfigurationManager.AppSettings["RemotingPortalUrl"];
         }
         if (string.IsNullOrEmpty(url))
         {
             throw new ConfigurationErrorsException("Remoting Portal Url Setting Error: Type:" + objectType.ToString());
         }
         //get dataportal
         _portal = (Server.IDataPortalServer)Activator.GetObject(typeof(Server.RemotingPortal), url);
     }
     return _portal;
 }
示例#2
0
 /// <summary>
 /// Creates an instance of the type
 /// </summary>
 /// <param name="dataportal">Server-side data portal instance</param>
 /// <param name="applicationContext">ApplicationContext</param>
 public LocalProxy(Server.IDataPortalServer dataportal, ApplicationContext applicationContext)
 {
     _portal            = dataportal;
     ApplicationContext = applicationContext;
 }