예제 #1
0
        public static Application Application_CreateApplication(string username, string password)
        {
            var         thread = new AppComThread();
            Application xapp   = null;

            thread.Invoke(() =>
            {
                var vms = CreateApplicationFunc(username, password);
                xapp    = new Application(vms);
            });
            var sac = new StandAloneContext(xapp, thread);

            XContext.Instance.CurrentContext = sac;
            XContext.Instance.CurrentContext.UIDispatcher = System.Windows.Application.Current?.Dispatcher;
            return(xapp);
        }
예제 #2
0
 public ESAPIService(Func <VMS.TPS.Common.Model.API.Application> createAppFunc)
 {
     _thread = AppComThread.Instance;
     _thread.SetContext(createAppFunc);
 }