예제 #1
0
        /// <summary>
        /// Create a basic child process handle
        /// </summary>
        /// <returns>Returns the child process handle</returns>
        public static IChildProcessHandle CreateChildProcessHandle()
        {
            string assemblyPath = _sourcePath ?? Path.GetDirectoryName(Assembly.GetAssembly(typeof(WebBrowserInitializer)).Location);

            Debug.Assert(assemblyPath != null, "assemblyPath != null");
            var al = new ChildProcessFactory()
            {
                ClientExecutablePath = _sourcePath
            };

            return(al.Create(Path.Combine(assemblyPath, "MainApplication.WebBrowser.dll"), false, Environment.Is64BitProcess));
        }
예제 #2
0
        public MainWindow()
        {
            InitializeComponent();

            try
            {
                var safeAppHostChildHandle = new ChildProcessFactory().Create("RedGate.AppHost.Example.Client.dll");

                Content = safeAppHostChildHandle.CreateElement(new ServiceLocator());
            }
            catch (Exception e)
            {
                Content = new TextBlock
                {
                    Text = e.ToString()
                };
            }
        }
        public BrowseScriptsPageControl()
        {
            m_RemoteBridge = ObjectFactory.Get <RemoteBridge>();

            var appHostChildHandle = new ChildProcessFactory().Create("RedGate.SSC.Windows.Client.dll", Debugger.IsAttached);

            AppHostServices appHostServices = new AppHostServices();

            appHostServices.RegisterService <RemoteBridge, ICallbacksRegistrationService>(m_RemoteBridge);
            appHostServices.RegisterService <RemoteBridge, ISsmsOperations>(m_RemoteBridge);

            var element = appHostChildHandle.CreateElement(appHostServices);

            Controls.Add(new ElementHost
            {
                Dock  = DockStyle.Fill,
                Child = element
            });
        }