Esempio n. 1
0
        /// ------------------------------------------------------------------------------------
        public ViewTab(ViewTabGroup owningTabControl, Control viewControl,
                       Action <ViewTab> tabTextChangedAction)
        {
            base.DoubleBuffered = true;
            base.AutoSize       = false;
            base.Font           = owningTabControl.TabFont;
            base.Dock           = DockStyle.Left;
            base.Text           = viewControl.Text.RemoveAcceleratorPrefix();
            Name = base.Text.Replace(" ", string.Empty) + "ViewTab";
            Text = "Set This Tab's Text";

            OwningTabGroup        = owningTabControl;
            _tabTextChangedAction = tabTextChangedAction;

            if (viewControl is ISayMoreView)
            {
                _image = ((ISayMoreView)viewControl).Image;
            }

            View      = viewControl;
            View.Dock = DockStyle.Fill;
            OwningTabGroup.Controls.Add(View);
            View.PerformLayout();
            View.BringToFront();
        }
Esempio n. 2
0
        /// ------------------------------------------------------------------------------------
        private void HandleViewDeactivated(ViewTabGroup sender, ViewTab deactivatedTab)
        {
            var view = deactivatedTab.View as ISayMoreView;

            if (view != null && view.MainMenuItem != null)
            {
                view.MainMenuItem.Enabled = false;
            }
        }
Esempio n. 3
0
        /// ------------------------------------------------------------------------------------
        private void HandleViewActivated(ViewTabGroup sender, ViewTab activatedTab)
        {
            var view = activatedTab.View as ISayMoreView;

            if (view == null)
            {
                return;
            }

            if (view.MainMenuItem != null)
            {
                view.MainMenuItem.Enabled = true;
            }

            Analytics.Track(view.NameForUsageReporting + "View Activated");
        }