Ejemplo n.º 1
0
        /// <summary>
        /// Closes all the satellite tabs for the specified unique_id.
        /// </summary>
        internal static void CloseAllSatelliteTabs(string unique_id)
        {
            if (unique_id == null)
            {
                throw new ArgumentNullException("unique_id");
            }

            // if the unique_id contains a forward-slash, it means that the ID is from a satellite page.
            if (unique_id.Contains("/"))
            {
                return; //throw new ArgumentException("The unique_id cannot contain the '/' character.");
            }
            foreach (FrameData frame in _shell_data.Frames)
            {
                for (int i = frame.Tabs.Count - 1; i >= 0; i--)
                {
                    TabData tabdata = frame.Tabs[i];

                    if (tabdata.IsSatellite && tabdata.MasterTabID == unique_id)
                    {
                        tabdata.CloseAllPagesAtOnce(); // This includes closing the tab with InternalCloseTab().
                        //InternalCloseTab(tabdata);
                    }
                }
            }
        }
Ejemplo n.º 2
0
        public static void CloseTab(SmartPage page)
        {
            if (_shell_data.ManagesSmartPage(page) == false)
            {
                throw new InvalidOperationException("This Page object is not managed by the Ventura Navigator.");
            }

            // Since the page is managed, we are 100% sure the FrameData and TabData will also be found.

            TabData tabdata = _shell_data.FindTabData(page);

            CloseAllSatelliteTabs(tabdata.UniqueID);

            tabdata.CloseAllPagesAtOnce();
        }