Esempio n. 1
0
        /// <summary>
        ///     Creates a new application context and binds it to a new thread
        /// </summary>
        /// <param name="username">VMS username</param>
        /// <param name="password">VMS password</param>
        /// <returns>app context</returns>
        public static StandAloneContext CreateSingleThread(string username, string password)
        {
            var         thread = new AppComThread(false);
            Application app    = null;

            app = Application.CreateApplication(username, password);
            return(new StandAloneContext(app, thread));
        }
Esempio n. 2
0
        /// <summary>
        ///     Creates a new application context and binds it to a new thread
        /// </summary>
        /// <param name="username">VMS username</param>
        /// <param name="password">VMS password</param>
        /// <returns>app context</returns>
        public static StandAloneContext Create(string username, string password)
        {
            var         thread = new AppComThread();
            Application app    = null;

            thread.Invoke(() => { app = Application.CreateApplication(username, password); });
            return(new StandAloneContext(app, thread));
        }