void WorkbenchActiveContentChanged(object sender, EventArgs e) { var activeViewOrPad = SD.Workbench.ActiveContent; IHasPropertyContainer c = activeViewOrPad != null?activeViewOrPad.GetService <IHasPropertyContainer>() : null; if (c == null) { if (previousContent == null) { c = SD.GetActiveViewContentService <IHasPropertyContainer>(); } else { // if the previous content is no longer visible, we have to remove the active container if (previousContent is IViewContent && previousContent != SD.Workbench.ActiveViewContent) { c = null; } else { c = previousContent; } } } if (c != null) { SetActiveContainer(c.PropertyContainer); } else { SetActiveContainer(null); } previousContent = c; }
void WorkbenchActiveContentChanged(object sender, EventArgs e) { IHasPropertyContainer c = WorkbenchSingleton.Workbench.ActiveContent as IHasPropertyContainer; if (c == null) { if (previousContent == null) { c = WorkbenchSingleton.Workbench.ActiveViewContent as IHasPropertyContainer; } else { // if the previous content is no longer visible, we have to remove the active container if (previousContent is IViewContent && previousContent != WorkbenchSingleton.Workbench.ActiveViewContent) { c = null; } else { c = previousContent; } } } if (c != null) { SetActiveContainer(c.PropertyContainer); } else { SetActiveContainer(null); } previousContent = c; }
private void WorkbenchWindowChanged(object sender, EventArgs e) { IHasPropertyContainer activeContent = WorkbenchSingleton.Workbench.ActiveContent as IHasPropertyContainer; if (activeContent == null) { IWorkbenchWindow activeWorkbenchWindow = WorkbenchSingleton.Workbench.ActiveWorkbenchWindow; if (activeWorkbenchWindow != null) { activeContent = activeWorkbenchWindow.ActiveViewContent as IHasPropertyContainer; } } if (activeContent != null) { this.SetActiveContainer(activeContent.PropertyContainer); } }
void WorkbenchWindowChanged(object sender, EventArgs e) { IHasPropertyContainer c = WorkbenchSingleton.Workbench.ActiveContent as IHasPropertyContainer; if (c == null) { IWorkbenchWindow window = WorkbenchSingleton.Workbench.ActiveWorkbenchWindow; if (window != null) { c = window.ActiveViewContent as IHasPropertyContainer; } } if (c != null) { SetActiveContainer(c.PropertyContainer); } }
void WorkbenchActiveContentChanged(object sender, EventArgs e) { var activeViewOrPad = SD.Workbench.ActiveContent; IHasPropertyContainer c = activeViewOrPad != null ? activeViewOrPad.GetService<IHasPropertyContainer>() : null; if (c == null) { if (previousContent == null) { c = SD.GetActiveViewContentService<IHasPropertyContainer>(); } else { // if the previous content is no longer visible, we have to remove the active container if (previousContent is IViewContent && previousContent != SD.Workbench.ActiveViewContent) { c = null; } else { c = previousContent; } } } if (c != null) { SetActiveContainer(c.PropertyContainer); } else { SetActiveContainer(null); } previousContent = c; }