using DevExpress.XtraBars.Docking2010.Views;
using DevExpress.XtraBars.Docking2010;
using DevExpress.XtraBars.Docking2010.Views.Tabbed;
using DevExpress.XtraEditors;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ExtensionsDev
{
    public static class TabbedViewExtension
    {
        public static void UseDefault(this TabbedView tabbedView1)
        {
            tabbedView1.DocumentProperties.AllowFloat = false;
            tabbedView1.DocumentProperties.AllowFloatOnDoubleClick = false;
            tabbedView1.DocumentProperties.AllowDock = false;
            tabbedView1.DocumentProperties.AllowDockFill = false;
            tabbedView1.DocumentProperties.AllowTabReordering = false;
            tabbedView1.DocumentProperties.ShowPinButton = false;
            //tabbedView1.DocumentGroupProperties.ShowTabHeader = false;
            tabbedView1.DocumentClosed += TabbedView1_DocumentClosed;
            tabbedView1.PopupMenuShowing += TabbedView1_PopupMenuShowing;
        }

        private static void TabbedView1_PopupMenuShowing(object sender, PopupMenuShowingEventArgs e)
        {
            e.Cancel = true;
        }

        private static void TabbedView1_DocumentClosed(object sender, DocumentEventArgs e)
        {
            e.Document.Dispose();
            (sender as TabbedView).Manager.View.Documents.Remove(e.Document);
        }
    }
}
