private ContentPresenter ShowApplication(object child, string applicationName, bool closeButton) { if (child is IHostedApplication5) { if (((IHostedApplication5)child).TopLevelWpfWindow.Parent != null) { return(null); } return((ContentPresenter)ShowApplicationOnUI(child, ((IHostedApplication5)child).TopLevelWpfWindow, applicationName, closeButton)); } else if (child is IHostedApplication) { IHostedApplication application3 = child as IHostedApplication; if (application3.TopLevelWindow != null) { AifWindowsFormsHost uiElement = new AifWindowsFormsHost(application3.TopLevelWindow); application3.TopLevelWindow.Tag = uiElement; return((ContentPresenter)ShowApplicationOnUI(child, uiElement, applicationName, closeButton)); } } else if (child is System.Windows.Forms.Control) { System.Windows.Forms.Control c = child as System.Windows.Forms.Control; AifWindowsFormsHost host2 = new AifWindowsFormsHost(c); c.Tag = host2; return((ContentPresenter)ShowApplicationOnUI(child, host2, applicationName, closeButton)); } return(null); }
private Window ShowApplication(object child, string applicationName) { if (child is IHostedApplication5) { if (((IHostedApplication5)child).TopLevelWpfWindow.Parent != null) { Window w = ((IHostedApplication5)child).TopLevelWpfWindow.Parent as Window; if (w != null) { w.Show(); } floatingWindows.Add(w); return(w); } return((Window)ShowApplicationOnUI(child, ((IHostedApplication5)child).TopLevelWpfWindow, applicationName)); } else if (child is IHostedApplication) { IHostedApplication application3 = child as IHostedApplication; if (application3.TopLevelWindow != null) { AifWindowsFormsHost uiElement = new AifWindowsFormsHost(application3.TopLevelWindow); application3.TopLevelWindow.Tag = uiElement; return((Window)ShowApplicationOnUI(child, uiElement, applicationName)); } } else if (child is System.Windows.Forms.Control) { System.Windows.Forms.Control c = child as System.Windows.Forms.Control; AifWindowsFormsHost host2 = new AifWindowsFormsHost(c); c.Tag = host2; return((Window)ShowApplicationOnUI(child, host2, applicationName)); } return(null); }