Esempio n. 1
0
        public bool InitializeConnection()
        {
            System.Diagnostics.Debug.WriteLine("InitializeConnection _CommonPath:" + CommonPath);
            if (string.IsNullOrEmpty(CommonPath))
            {
                return(false);
            }
            var configfile = Path.Combine(CommonPath, "CommonConfig.config");

            System.Diagnostics.Debug.WriteLine("InitializeConnection configfile:" + configfile);
            XDocument xdoc = XDocument.Load(configfile);
            var       url  = from lv1 in xdoc.Descendants("add")
                             where lv1.Attribute("key").Value == ServiceUrlKey
                             select lv1.Attribute("value").Value;

            _objRemoteHelper = new CRemoteHelper(url.ElementAt(0));
            ConnectionInfo _objConnection = _objRemoteHelper.CheckConnection();

            System.Diagnostics.Debug.WriteLine("InitializeConnection _objConnection.status:" + _objConnection.status);
            if (_objConnection.status == Status.Connected)
            {
                _mObjUdtHandler     = new UDTManagerHelper(_objRemoteHelper.GetUrl("UDTManager").sEndpointAddress);
                _mObjUdtDataHandler = new UDTDataManagerHelper(_objRemoteHelper.GetUrl("UDTDataManager").sEndpointAddress);
                UDTSESSIONID        = _mObjUdtHandler.Connect();
                System.Diagnostics.Debug.WriteLine("InitializeConnection UDTSESSIONID:" + UDTSESSIONID);
                UDTDATASESSIONID = _mObjUdtDataHandler.Connect();
                System.Diagnostics.Debug.WriteLine("InitializeConnection UDTDATASESSIONID:" + UDTDATASESSIONID);
                return(true);
            }

            return(false);
        }
Esempio n. 2
0
        public void RefreshUdt(string UdtName)
        {
            if (_mObjUdtHandler == null || _mObjUdtDataHandler == null)
            {
                Clear();
                _mObjUdtHandler     = new UDTManagerHelper(_objRemoteHelper.GetUrl("UDTManager").sEndpointAddress);
                _mObjUdtDataHandler = new UDTDataManagerHelper(_objRemoteHelper.GetUrl("UDTDataManager").sEndpointAddress);

                UDTSESSIONID     = _mObjUdtHandler.Connect();
                UDTDATASESSIONID = _mObjUdtDataHandler.Connect();
            }

            LoadUdt(UdtName);

            CurrentDataSet = GetUdtDataset(CurrentUdt);
        }
Esempio n. 3
0
 private void Clear()
 {
     if (_mObjUdtHandler != null)
     {
         if (!string.IsNullOrEmpty(UDTSESSIONID))
         {
             if (_mudtinfo != null)
             {
                 _mObjUdtHandler.UnloadUdt(UDTSESSIONID, _mudtinfo.UdtId);
             }
             _mObjUdtHandler.DisConnect(UDTSESSIONID);
         }
         _mObjUdtHandler.Dispose();
         _mObjUdtHandler = null;
     }
     if (_mObjUdtDataHandler != null)
     {
         if (!string.IsNullOrEmpty(UDTDATASESSIONID))
         {
             if (_mudtinfo != null)
             {
                 _mObjUdtDataHandler.UnloadUdt(UDTDATASESSIONID, _mudtinfo.UdtId);
             }
             _mObjUdtDataHandler.DisConnect(UDTDATASESSIONID);
         }
         _mObjUdtDataHandler.Dispose();
         _mObjUdtDataHandler = null;
     }
     UDTSESSIONID     = string.Empty;
     UDTDATASESSIONID = string.Empty;
     CnctArgs         = null;
     CurrentUdt       = null;
     if (CurrentDataSet != null)
     {
         CurrentDataSet.Dispose();
         CurrentDataSet = null;
     }
 }
Esempio n. 4
0
 private void Clear()
 {
     if (_mObjUdtHandler != null)
     {
         if (!string.IsNullOrEmpty(UDTSESSIONID))
         {
             if (_mudtinfo != null)
             {
                 _mObjUdtHandler.UnloadUdt(UDTSESSIONID, _mudtinfo.UdtId);
             }
             _mObjUdtHandler.DisConnect(UDTSESSIONID);
         }
         _mObjUdtHandler.Dispose();
         _mObjUdtHandler = null;
     }
     if (_mObjUdtDataHandler != null)
     {
         if (!string.IsNullOrEmpty(UDTDATASESSIONID))
         {
             if (_mudtinfo != null)
             {
                 _mObjUdtDataHandler.UnloadUdt(UDTDATASESSIONID, _mudtinfo.UdtId);
             }
             _mObjUdtDataHandler.DisConnect(UDTDATASESSIONID);
         }
         _mObjUdtDataHandler.Dispose();
         _mObjUdtDataHandler = null;
     }
     UDTSESSIONID = string.Empty;
     UDTDATASESSIONID = string.Empty;
     CnctArgs = null;
     CurrentUdt = null;
     if (CurrentDataSet != null)
     {
         CurrentDataSet.Dispose();
         CurrentDataSet = null;
     }
 }
Esempio n. 5
0
        public void RefreshUdt(string UdtName)
        {
            if (_mObjUdtHandler == null || _mObjUdtDataHandler == null)
            {
                Clear();
                _mObjUdtHandler = new UDTManagerHelper(_objRemoteHelper.GetUrl("UDTManager").sEndpointAddress);
                _mObjUdtDataHandler = new UDTDataManagerHelper(_objRemoteHelper.GetUrl("UDTDataManager").sEndpointAddress);

                UDTSESSIONID = _mObjUdtHandler.Connect();
                UDTDATASESSIONID = _mObjUdtDataHandler.Connect();
            }

            LoadUdt(UdtName);

            CurrentDataSet = GetUdtDataset(CurrentUdt);
        }
Esempio n. 6
0
        public bool InitializeConnection()
        {
            System.Diagnostics.Debug.WriteLine("InitializeConnection _CommonPath:" + CommonPath);
            if (string.IsNullOrEmpty(CommonPath))
                return false;
            var configfile = Path.Combine(CommonPath, "CommonConfig.config");
            System.Diagnostics.Debug.WriteLine("InitializeConnection configfile:" + configfile);
            XDocument xdoc = XDocument.Load(configfile);
            var url = from lv1 in xdoc.Descendants("add")
                      where lv1.Attribute("key").Value == "LOCALMANAGERURL"
                      select lv1.Attribute("value").Value;
            _objRemoteHelper = new CRemoteHelper(url.ElementAt(0));
            ConnectionInfo _objConnection = _objRemoteHelper.CheckConnection();
            System.Diagnostics.Debug.WriteLine("InitializeConnection _objConnection.status:" + _objConnection.status);
            if (_objConnection.status == Status.Connected)
            {
                _mObjUdtHandler = new UDTManagerHelper(_objRemoteHelper.GetUrl("UDTManager").sEndpointAddress);
                _mObjUdtDataHandler = new UDTDataManagerHelper(_objRemoteHelper.GetUrl("UDTDataManager").sEndpointAddress);
                UDTSESSIONID = _mObjUdtHandler.Connect();
                System.Diagnostics.Debug.WriteLine("InitializeConnection UDTSESSIONID:" + UDTSESSIONID);
                UDTDATASESSIONID = _mObjUdtDataHandler.Connect();
                System.Diagnostics.Debug.WriteLine("InitializeConnection UDTDATASESSIONID:" + UDTDATASESSIONID);
                return true;
            }

            return false;
        }