예제 #1
0
        private void _switcher_SelectedSwitchPageChanged(object sender, EventArgs e)
        {
            ISelectionService service = (ISelectionService)this.GetService(typeof(ISelectionService));

            if (service != null)
            {
                ICollection selectedComponents = service.GetSelectedComponents();
                bool        flag = false;

                foreach (object selectedComponent in selectedComponents)
                {
                    NuGenSwitchPage switchPageOfComponent = NuGenSwitcherDesigner.GetSwitchPageOfComponent(selectedComponent);

                    if (
                        switchPageOfComponent != null &&
                        switchPageOfComponent.Parent == _switcher &&
                        switchPageOfComponent == _switcher.SelectedSwitchPage
                        )
                    {
                        flag = true;
                        break;
                    }
                }

                if (!flag)
                {
                    service.SetSelectedComponents(new object[] { base.Component });
                }
            }
        }
예제 #2
0
        private void _selectionService_SelectionChanged(object sender, EventArgs e)
        {
            ISelectionService service = (ISelectionService)this.GetService(typeof(ISelectionService));

            if (service != null)
            {
                ICollection selectedComponents = service.GetSelectedComponents();

                foreach (object selectedComponent in selectedComponents)
                {
                    NuGenSwitchPage switchPageOfComponent = NuGenSwitcherDesigner.GetSwitchPageOfComponent(selectedComponent);

                    if (switchPageOfComponent != null && switchPageOfComponent.Parent == _switcher)
                    {
                        _switcher.SelectedSwitchPage = switchPageOfComponent;
                        break;
                    }
                }
            }
        }