コード例 #1
0
        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;
        }
コード例 #2
0
ファイル: PropertyPad.cs プロジェクト: vu111293/pat-design
        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;
        }
コード例 #3
0
ファイル: PropertyPad.cs プロジェクト: tany12/CommonLibrary
        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);
            }
        }
コード例 #4
0
        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);
            }
        }
コード例 #5
0
ファイル: PropertyPad.cs プロジェクト: Altaxo/Altaxo
		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;
		}
コード例 #6
0
 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;
 }