Ejemplo n.º 1
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
                         });
        }