Exemple #1
0
        public static IApplicationBase RunInplace(Guid sessionUid, bool processOnwer)
        {
            IApplicationBase application = null;

            if (processOnwer)
            {
                application = new ProfilingApplication(sessionUid, processOnwer);
                application.Run();
            }
            else
            {
                Action a = () =>
                {
                    AppDomain appDomain = AppDomain.CurrentDomain.Clone(typeof(ProfilingApplication).ToString(),
                                                                        typeof(ApplicationManager).GetAssemblyPath());
                    appDomain.InvokeStaticMember(typeof(ApplicationManager), "Initialize",
                                                 BindingFlags.InvokeMethod | BindingFlags.Public, null);
                    ChronosApplicationLauncher <ProfilingApplication> activator =
                        RemoteActivator.CreateInstance <ChronosApplicationLauncher <ProfilingApplication> >(appDomain);
                    activator.Run(sessionUid, processOnwer);
                    application = (IApplicationBase)activator.GetApplication();
                };
                System.Windows.Application.Current.Dispatcher.Invoke(a);
            }
            return(application);
        }
Exemple #2
0
        public static IApplicationBase RunInplace(bool processOnwer)
        {
            IApplicationBase application;

            if (processOnwer)
            {
                application = new MainApplication(processOnwer);
                application.Run();
            }
            else
            {
                AppDomain appDomain = AppDomain.CurrentDomain.Clone(typeof(MainApplication).ToString(), typeof(ApplicationManager).GetAssemblyPath());
                ChronosApplicationLauncher <MainApplication> activator = RemoteActivator.CreateInstance <ChronosApplicationLauncher <MainApplication> >(appDomain);
                activator.Run(processOnwer);
                application = (IApplicationBase)activator.GetApplication();
            }
            return(application);
        }
        public static IApplication RunInplace(bool processOnwer, Guid sessionUid)
        {
            IApplication application;

            if (processOnwer)
            {
                application = new Application(true, sessionUid);
                application.Run();
            }
            else
            {
                AppDomain appDomain = AppDomain.CurrentDomain.Clone(typeof(Application).ToString(), typeof(ApplicationManager).GetAssemblyPath());
                ChronosApplicationLauncher <Application> activator = RemoteActivator.CreateInstance <ChronosApplicationLauncher <Application> >(appDomain);
                activator.Run(false, sessionUid);
                application = ConnectLocal(sessionUid);
            }
            return(application);
        }
Exemple #4
0
        public static object InvokeStaticMember(this AppDomain appDomain, Type type, string name, BindingFlags flags, params object[] args)
        {
            RemoteExecutor executor = RemoteActivator.CreateInstance <RemoteExecutor>(appDomain);

            return(executor.InvokeStaticMember(type, name, flags, args));
        }