<commit_before>/*
	Alphora Dataphor
	© Copyright 2000-2008 Alphora
	This file is licensed under a modified BSD-license which can be found here: http://dataphor.org/dataphor_license.txt

	Assumption: this designer assumes that its lifetime is for a single document.  It will 
	 currently not close any existing document before operations such a New(), Open().  This
	 behavior is okay for now because Dataphoria does not ask designers to change documents.
*/

using System;
using System.Collections;
using System.ComponentModel;
using System.Drawing;
using System.IO;
using System.Text;
using System.Windows.Forms;
using System.Xml;
using Alphora.Dataphor.DAE.Runtime.Data;
using Alphora.Dataphor.Dataphoria.Designers;
using Alphora.Dataphor.Dataphoria.FormDesigner.ToolBox;
using Alphora.Dataphor.Frontend.Client;
using Alphora.Dataphor.Frontend.Client.Windows;
using WeifenLuo.WinFormsUI.Docking;
using Cursors=System.Windows.Forms.Cursors;
using Image=System.Drawing.Image;
using Session=Alphora.Dataphor.Frontend.Client.Windows.Session;

namespace Alphora.Dataphor.Dataphoria.FormDesigner
{
    // Don't put any definitions above the FormDesiger class

    public partial class FormDesigner : BaseForm, ILiveDesigner, IErrorSource, IServiceProvider, IContainer, IChildFormWithToolBar
    {
        protected DockContent FDockContentFormPanel;
        protected DockContent FDockContentNodesTree;
        protected DockContent FDockContentPalettePanel;
        protected DockContent FDockContentPropertyGrid;
        private ToolBox.ToolBox FPalettePanel;

        public FormDesigner() // dummy constructor for SyncFusion's MDI menu merging
        {
            InitializeComponent();
            InitializeDocking();
        }

        public FormDesigner(IDataphoria ADataphoria, string ADesignerID)
        {
            InitializeComponent();


            InitializeDocking();


            FDesignerID = ADesignerID;

            FNodesTree.FormDesigner = this;

            InitializeService(ADataphoria);


            PrepareSession();
            ADataphoria.OnFormDesignerLibrariesChanged += FormDesignerLibrariesChanged;
        }

        protected override void Dispose(bool ADisposed)
        {
            if (!IsDisposed && (Dataphoria != null))
            {
                try
                {
                    SetDesignHost(null, true);
                }
                finally
                {
                    try
                    {
                        FPalettePanel.ClearPalette();
                    }
                    finally
                    {
                        try
                        {
                            if (FFrontendSession != null)
                            {
                                FFrontendSession.Dispose();
                                FFrontendSession = null;
                            }
                        }
                        finally
                        {
                            try
                            {
                                Dataphoria.OnFormDesignerLibrariesChanged -= new EventHandler(FormDesignerLibrariesChanged);
                            }
                            finally
                            {
                                try
                                {
                                    if (components != null)
                                        components.Dispose();
                                }
                                finally
                                {
                                    base.Dispose(ADisposed);
                                }
                            }
                        }
                    }
                }
            }
        }


        // Dataphoria

        [Browsable(false)]
        public IDataphoria Dataphoria
        {
            get { return (FService == null ? null : FService.Dataphoria); }
        }

        #region IChildFormWithToolBar Members

        public void MergeWith(ToolStrip AParentToolStrip)
        {
            ToolStripManager.Merge(FToolStrip, AParentToolStrip);
        }

        #endregion

        #region ILiveDesigner Members

        void IDisposable.Dispose()
        {
            // TODO:  Add FormDesigner.System.IDisposable.Dispose implementation
        }

        #endregion

        #region IServiceProvider Members

        public new virtual object GetService(Type AServiceType)
        {
            if (AServiceType == typeof (IDesignService))
                return Service;
            object LResult = base.GetService(AServiceType);
            if (LResult != null)
                return LResult;
            return Dataphoria.GetService(AServiceType);
        }

        #endregion

        #region Help

        protected override void OnHelpRequested(HelpEventArgs AArgs)
        {
            base.OnHelpRequested(AArgs);
            string LKeyword;
            if (SelectedPaletteItem != null)
                LKeyword = SelectedPaletteItem.ClassName;
            else
            {
                if (ActiveControl.Name == "FNodesTree")
                    LKeyword = FNodesTree.SelectedNode.Node.GetType().Name;
                else
                    LKeyword = FPropertyGrid.SelectedObject.GetType().Name;
            }
            NodeTypeEntry LEntry = FrontendSession.NodeTypeTable[LKeyword];
            if (LEntry != null)
                LKeyword = LEntry.Namespace + "." + LKeyword;
            Dataphoria.InvokeHelp(LKeyword);
        }

        #endregion

        #region IContainer

        // IContainer is implemented because Sites are required to have containers

        public ComponentCollection Components
        {
            get { return new ComponentCollection(new IComponent[] {}); }
        }

        public void Remove(IComponent AComponent)
        {
            // nadda
        }

        public void Add(IComponent AComponent, string AName)
        {
            // nadda
        }

        void IContainer.Add(IComponent AComponent)
        {
            // nadda
        }

        #endregion

        private void InitializeDocking()
        {
            // 
            // FPaletteGroupBar
            // 
            /*FPaletteGroupBar = new GroupBar();
            FPaletteGroupBar.AllowDrop = true;
            FPaletteGroupBar.BackColor = SystemColors.Control;
            FPaletteGroupBar.BorderStyle = BorderStyle.FixedSingle;
            FPaletteGroupBar.Dock = DockStyle.Fill;
            FPaletteGroupBar.Location = new Point(0, 24);
            FPaletteGroupBar.Name = "FPaletteGroupBar";
            FPaletteGroupBar.SelectedItem = 0;
            FPaletteGroupBar.Size = new Size(163, 163);
            FPaletteGroupBar.TabIndex = 1;*/
            // 
            // FPointerGroupView
            // 
            /*FPointerGroupView = new GroupView
                                    {
                                        BorderStyle = BorderStyle.None,
                                        ButtonView = true,
                                        Dock = DockStyle.Top
                                    };
            FPointerGroupView.GroupViewItems.AddRange(new[]
                                                          {
                                                              new GroupViewItem("Pointer", 0)
                                                          });
            FPointerGroupView.IntegratedScrolling = true;
            FPointerGroupView.ItemYSpacing = 2;
            FPointerGroupView.LargeImageList = null;
            FPointerGroupView.Location = new Point(0, 0);
            FPointerGroupView.Name = "FPointerGroupView";
            FPointerGroupView.SelectedItem = 0;
            FPointerGroupView.Size = new Size(163, 24);
            FPointerGroupView.SmallImageList = FPointerImageList;
            FPointerGroupView.SmallImageView = true;
            FPointerGroupView.TabIndex = 0;
            FPointerGroupView.Text = "groupView2";
            FPointerGroupView.GroupViewItemSelected += FPointerGroupView_GroupViewItemSelected;
            */
            // 
            // FPalettePanel
            // 
            FPalettePanel = new ToolBox.ToolBox();
            //FPalettePanel.Controls.Add(FPaletteGroupBar);
            //FPalettePanel.Controls.Add(FPointerGroupView);
            //this.FDockingManager.SetEnableDocking(this.FPalettePanel, true);
            FPalettePanel.Location = new Point(1, 21);
            FPalettePanel.Name = "FPalettePanel";
            FPalettePanel.Size = new Size(163, 187);
            FPalettePanel.TabIndex = 1;
            FPalettePanel.Dock = DockStyle.Fill;
            FPalettePanel.StatusChanged += FPalettePanel_StatusChanged;

            FDockContentPalettePanel = new DockContent();
            FDockContentPalettePanel.Controls.Add(FPalettePanel);
            FDockContentPalettePanel.TabText = "Forms Palette";
            FDockContentPalettePanel.Text = "Palette";
            FDockContentPalettePanel.ShowHint = DockState.DockLeft;
            FDockContentPalettePanel.Show(FDockPanel);

            // 
            // FFormPanel
            // 
            FFormPanel = new FormPanel();
            FFormPanel.BackColor = SystemColors.ControlDark;
            //this.FDockingManager.SetEnableDocking(this.FFormPanel, true);
            FFormPanel.Location = new Point(1, 21);
            FFormPanel.Name = "FFormPanel";
            FFormPanel.Size = new Size(685, 283);
            FFormPanel.TabIndex = 3;
            FFormPanel.Dock = DockStyle.Fill;

            FDockContentFormPanel = new DockContent();
            FDockContentFormPanel.Controls.Add(FFormPanel);
            FDockContentFormPanel.ShowHint = DockState.Document;
            FDockContentFormPanel.Show(FDockPanel);

            // 
            // FNodesTree
            // 
            FNodesTree = new DesignerTree();
            FNodesTree.AllowDrop = true;
            FNodesTree.BorderStyle = BorderStyle.None;
            FNodesTree.CausesValidation = false;
            FNodesTree.Dock = DockStyle.Fill;
            FNodesTree.HideSelection = false;
            FNodesTree.ImageList = FNodesImageList;
            FNodesTree.Location = new Point(0, 0);
            FNodesTree.Name = "FNodesTree";
            FNodesTree.ShowRootLines = false;
            FNodesTree.Size = new Size(283, 209);
            FNodesTree.TabIndex = 0;
            FNodesTree.AfterSelect += FNodesTree_AfterSelect;
            FNodesTree.Dock = DockStyle.Fill;


            FDockContentNodesTree = new DockContent();
            FDockContentNodesTree.Controls.Add(FNodesTree);
            FDockContentNodesTree.TabText = "Forms Nodes Tree";
            FDockContentNodesTree.Text = "Nodes Tree";
            FDockContentNodesTree.ShowHint = DockState.DockRight;
            FDockContentNodesTree.Show(FDockPanel);


            FPropertyGrid = new PropertyGrid();
            // 
            // FPropertyGrid
            // 
            FPropertyGrid.BackColor = SystemColors.Control;
            FPropertyGrid.CausesValidation = false;
            FPropertyGrid.CommandsVisibleIfAvailable = true;
            FPropertyGrid.Cursor = Cursors.HSplit;
            //this.FDockingManager.SetEnableDocking(this.FPropertyGrid, true);
            FPropertyGrid.LargeButtons = false;
            FPropertyGrid.LineColor = SystemColors.ScrollBar;
            FPropertyGrid.Location = new Point(1, 21);
            FPropertyGrid.Name = "FPropertyGrid";
            FPropertyGrid.PropertySort = PropertySort.Alphabetical;
            FPropertyGrid.Size = new Size(229, 187);
            FPropertyGrid.TabIndex = 2;
            FPropertyGrid.Text = "Properties of the Currently Selected Node";
            FPropertyGrid.ToolbarVisible = false;
            FPropertyGrid.ViewBackColor = SystemColors.Window;
            FPropertyGrid.ViewForeColor = SystemColors.WindowText;
            FPropertyGrid.PropertyValueChanged +=NodePropertyGrid_PropertyValueChanged;
            FPropertyGrid.Dock = DockStyle.Fill;

            FDockContentPropertyGrid = new DockContent();
            FDockContentPropertyGrid.Controls.Add(FPropertyGrid);
            FDockContentPropertyGrid.TabText = "Forms Properties Grid";
            FDockContentPropertyGrid.Text = "Properties Grid";
            FDockContentPropertyGrid.ShowHint = DockState.DockRight;
            FDockContentPropertyGrid.Show(FDockPanel);
        }

        private void FPalettePanel_StatusChanged(object ASender, StatusEventArgs AArgs)
        {
            this.SetStatus(AArgs.Description);
        }

        protected override void OnClosing(CancelEventArgs AArgs)
        {
            base.OnClosing(AArgs);
            try
            {
                FService.CheckModified();
                if (FIsDesignHostOwner && (!FrontendSession.CloseAllForms(FDesignHost, CloseBehavior.AcceptOrClose)))
                    // if we are hosting, close the child forms
                    throw new AbortException();
            }
            catch
            {
                AArgs.Cancel = true;
                throw;
            }
        }

        #region FrontendSession

        private Session FFrontendSession;

        [Browsable(false)]
        public Session FrontendSession
        {
            get { return FFrontendSession; }
        }

        /// <summary> Prepares (or re-prepares) the frontend session and the component palette </summary>
        private void PrepareSession()
        {
            if (FFrontendSession == null)
                FFrontendSession = Dataphoria.GetLiveDesignableFrontendSession();
            FFrontendSession.SetFormDesigner();
            FPalettePanel.ClearPalette();
            FPalettePanel.LoadPalette();
        }

        private void FormDesignerLibrariesChanged(object ASender, EventArgs AArgs)<commit_msg>set FPalettePanel.FrontendSession with FFrontendSession at PrepareSession() method<commit_after>/*
	Alphora Dataphor
	© Copyright 2000-2008 Alphora
	This file is licensed under a modified BSD-license which can be found here: http://dataphor.org/dataphor_license.txt

	Assumption: this designer assumes that its lifetime is for a single document.  It will 
	 currently not close any existing document before operations such a New(), Open().  This
	 behavior is okay for now because Dataphoria does not ask designers to change documents.
*/

using System;
using System.Collections;
using System.ComponentModel;
using System.Drawing;
using System.IO;
using System.Text;
using System.Windows.Forms;
using System.Xml;
using Alphora.Dataphor.DAE.Runtime.Data;
using Alphora.Dataphor.Dataphoria.Designers;
using Alphora.Dataphor.Dataphoria.FormDesigner.ToolBox;
using Alphora.Dataphor.Frontend.Client;
using Alphora.Dataphor.Frontend.Client.Windows;
using WeifenLuo.WinFormsUI.Docking;
using Cursors=System.Windows.Forms.Cursors;
using Image=System.Drawing.Image;
using Session=Alphora.Dataphor.Frontend.Client.Windows.Session;

namespace Alphora.Dataphor.Dataphoria.FormDesigner
{
    // Don't put any definitions above the FormDesiger class

    public partial class FormDesigner : BaseForm, ILiveDesigner, IErrorSource, IServiceProvider, IContainer, IChildFormWithToolBar
    {
        protected DockContent FDockContentFormPanel;
        protected DockContent FDockContentNodesTree;
        protected DockContent FDockContentPalettePanel;
        protected DockContent FDockContentPropertyGrid;
        private ToolBox.ToolBox FPalettePanel;

        public FormDesigner() // dummy constructor for SyncFusion's MDI menu merging
        {
            InitializeComponent();
            InitializeDocking();
        }

        public FormDesigner(IDataphoria ADataphoria, string ADesignerID)
        {
            InitializeComponent();


            InitializeDocking();


            FDesignerID = ADesignerID;

            FNodesTree.FormDesigner = this;

            InitializeService(ADataphoria);


            PrepareSession();
            ADataphoria.OnFormDesignerLibrariesChanged += FormDesignerLibrariesChanged;
        }

        protected override void Dispose(bool ADisposed)
        {
            if (!IsDisposed && (Dataphoria != null))
            {
                try
                {
                    SetDesignHost(null, true);
                }
                finally
                {
                    try
                    {
                        FPalettePanel.ClearPalette();
                    }
                    finally
                    {
                        try
                        {
                            if (FFrontendSession != null)
                            {
                                FFrontendSession.Dispose();
                                FFrontendSession = null;
                            }
                        }
                        finally
                        {
                            try
                            {
                                Dataphoria.OnFormDesignerLibrariesChanged -= new EventHandler(FormDesignerLibrariesChanged);
                            }
                            finally
                            {
                                try
                                {
                                    if (components != null)
                                        components.Dispose();
                                }
                                finally
                                {
                                    base.Dispose(ADisposed);
                                }
                            }
                        }
                    }
                }
            }
        }


        // Dataphoria

        [Browsable(false)]
        public IDataphoria Dataphoria
        {
            get { return (FService == null ? null : FService.Dataphoria); }
        }

        #region IChildFormWithToolBar Members

        public void MergeWith(ToolStrip AParentToolStrip)
        {
            ToolStripManager.Merge(FToolStrip, AParentToolStrip);
        }

        #endregion

        #region ILiveDesigner Members

        void IDisposable.Dispose()
        {
            // TODO:  Add FormDesigner.System.IDisposable.Dispose implementation
        }

        #endregion

        #region IServiceProvider Members

        public new virtual object GetService(Type AServiceType)
        {
            if (AServiceType == typeof (IDesignService))
                return Service;
            object LResult = base.GetService(AServiceType);
            if (LResult != null)
                return LResult;
            return Dataphoria.GetService(AServiceType);
        }

        #endregion

        #region Help

        protected override void OnHelpRequested(HelpEventArgs AArgs)
        {
            base.OnHelpRequested(AArgs);
            string LKeyword;
            if (SelectedPaletteItem != null)
                LKeyword = SelectedPaletteItem.ClassName;
            else
            {
                if (ActiveControl.Name == "FNodesTree")
                    LKeyword = FNodesTree.SelectedNode.Node.GetType().Name;
                else
                    LKeyword = FPropertyGrid.SelectedObject.GetType().Name;
            }
            NodeTypeEntry LEntry = FrontendSession.NodeTypeTable[LKeyword];
            if (LEntry != null)
                LKeyword = LEntry.Namespace + "." + LKeyword;
            Dataphoria.InvokeHelp(LKeyword);
        }

        #endregion

        #region IContainer

        // IContainer is implemented because Sites are required to have containers

        public ComponentCollection Components
        {
            get { return new ComponentCollection(new IComponent[] {}); }
        }

        public void Remove(IComponent AComponent)
        {
            // nadda
        }

        public void Add(IComponent AComponent, string AName)
        {
            // nadda
        }

        void IContainer.Add(IComponent AComponent)
        {
            // nadda
        }

        #endregion

        private void InitializeDocking()
        {
            // 
            // FPaletteGroupBar
            // 
            /*FPaletteGroupBar = new GroupBar();
            FPaletteGroupBar.AllowDrop = true;
            FPaletteGroupBar.BackColor = SystemColors.Control;
            FPaletteGroupBar.BorderStyle = BorderStyle.FixedSingle;
            FPaletteGroupBar.Dock = DockStyle.Fill;
            FPaletteGroupBar.Location = new Point(0, 24);
            FPaletteGroupBar.Name = "FPaletteGroupBar";
            FPaletteGroupBar.SelectedItem = 0;
            FPaletteGroupBar.Size = new Size(163, 163);
            FPaletteGroupBar.TabIndex = 1;*/
            // 
            // FPointerGroupView
            // 
            /*FPointerGroupView = new GroupView
                                    {
                                        BorderStyle = BorderStyle.None,
                                        ButtonView = true,
                                        Dock = DockStyle.Top
                                    };
            FPointerGroupView.GroupViewItems.AddRange(new[]
                                                          {
                                                              new GroupViewItem("Pointer", 0)
                                                          });
            FPointerGroupView.IntegratedScrolling = true;
            FPointerGroupView.ItemYSpacing = 2;
            FPointerGroupView.LargeImageList = null;
            FPointerGroupView.Location = new Point(0, 0);
            FPointerGroupView.Name = "FPointerGroupView";
            FPointerGroupView.SelectedItem = 0;
            FPointerGroupView.Size = new Size(163, 24);
            FPointerGroupView.SmallImageList = FPointerImageList;
            FPointerGroupView.SmallImageView = true;
            FPointerGroupView.TabIndex = 0;
            FPointerGroupView.Text = "groupView2";
            FPointerGroupView.GroupViewItemSelected += FPointerGroupView_GroupViewItemSelected;
            */
            // 
            // FPalettePanel
            // 
            FPalettePanel = new ToolBox.ToolBox();
            //FPalettePanel.Controls.Add(FPaletteGroupBar);
            //FPalettePanel.Controls.Add(FPointerGroupView);
            //this.FDockingManager.SetEnableDocking(this.FPalettePanel, true);
            FPalettePanel.Location = new Point(1, 21);
            FPalettePanel.Name = "FPalettePanel";
            FPalettePanel.Size = new Size(163, 187);
            FPalettePanel.TabIndex = 1;
            FPalettePanel.Dock = DockStyle.Fill;
            FPalettePanel.StatusChanged += FPalettePanel_StatusChanged;

            FDockContentPalettePanel = new DockContent();
            FDockContentPalettePanel.Controls.Add(FPalettePanel);
            FDockContentPalettePanel.TabText = "Forms Palette";
            FDockContentPalettePanel.Text = "Palette";
            FDockContentPalettePanel.ShowHint = DockState.DockLeft;
            FDockContentPalettePanel.Show(FDockPanel);

            // 
            // FFormPanel
            // 
            FFormPanel = new FormPanel();
            FFormPanel.BackColor = SystemColors.ControlDark;
            //this.FDockingManager.SetEnableDocking(this.FFormPanel, true);
            FFormPanel.Location = new Point(1, 21);
            FFormPanel.Name = "FFormPanel";
            FFormPanel.Size = new Size(685, 283);
            FFormPanel.TabIndex = 3;
            FFormPanel.Dock = DockStyle.Fill;

            FDockContentFormPanel = new DockContent();
            FDockContentFormPanel.Controls.Add(FFormPanel);
            FDockContentFormPanel.ShowHint = DockState.Document;
            FDockContentFormPanel.Show(FDockPanel);

            // 
            // FNodesTree
            // 
            FNodesTree = new DesignerTree();
            FNodesTree.AllowDrop = true;
            FNodesTree.BorderStyle = BorderStyle.None;
            FNodesTree.CausesValidation = false;
            FNodesTree.Dock = DockStyle.Fill;
            FNodesTree.HideSelection = false;
            FNodesTree.ImageList = FNodesImageList;
            FNodesTree.Location = new Point(0, 0);
            FNodesTree.Name = "FNodesTree";
            FNodesTree.ShowRootLines = false;
            FNodesTree.Size = new Size(283, 209);
            FNodesTree.TabIndex = 0;
            FNodesTree.AfterSelect += FNodesTree_AfterSelect;
            FNodesTree.Dock = DockStyle.Fill;


            FDockContentNodesTree = new DockContent();
            FDockContentNodesTree.Controls.Add(FNodesTree);
            FDockContentNodesTree.TabText = "Forms Nodes Tree";
            FDockContentNodesTree.Text = "Nodes Tree";
            FDockContentNodesTree.ShowHint = DockState.DockRight;
            FDockContentNodesTree.Show(FDockPanel);


            FPropertyGrid = new PropertyGrid();
            // 
            // FPropertyGrid
            // 
            FPropertyGrid.BackColor = SystemColors.Control;
            FPropertyGrid.CausesValidation = false;
            FPropertyGrid.CommandsVisibleIfAvailable = true;
            FPropertyGrid.Cursor = Cursors.HSplit;
            //this.FDockingManager.SetEnableDocking(this.FPropertyGrid, true);
            FPropertyGrid.LargeButtons = false;
            FPropertyGrid.LineColor = SystemColors.ScrollBar;
            FPropertyGrid.Location = new Point(1, 21);
            FPropertyGrid.Name = "FPropertyGrid";
            FPropertyGrid.PropertySort = PropertySort.Alphabetical;
            FPropertyGrid.Size = new Size(229, 187);
            FPropertyGrid.TabIndex = 2;
            FPropertyGrid.Text = "Properties of the Currently Selected Node";
            FPropertyGrid.ToolbarVisible = false;
            FPropertyGrid.ViewBackColor = SystemColors.Window;
            FPropertyGrid.ViewForeColor = SystemColors.WindowText;
            FPropertyGrid.PropertyValueChanged +=NodePropertyGrid_PropertyValueChanged;
            FPropertyGrid.Dock = DockStyle.Fill;

            FDockContentPropertyGrid = new DockContent();
            FDockContentPropertyGrid.Controls.Add(FPropertyGrid);
            FDockContentPropertyGrid.TabText = "Forms Properties Grid";
            FDockContentPropertyGrid.Text = "Properties Grid";
            FDockContentPropertyGrid.ShowHint = DockState.DockRight;
            FDockContentPropertyGrid.Show(FDockPanel);
        }

        private void FPalettePanel_StatusChanged(object ASender, StatusEventArgs AArgs)
        {
            this.SetStatus(AArgs.Description);
        }

        protected override void OnClosing(CancelEventArgs AArgs)
        {
            base.OnClosing(AArgs);
            try
            {
                FService.CheckModified();
                if (FIsDesignHostOwner && (!FrontendSession.CloseAllForms(FDesignHost, CloseBehavior.AcceptOrClose)))
                    // if we are hosting, close the child forms
                    throw new AbortException();
            }
            catch
            {
                AArgs.Cancel = true;
                throw;
            }
        }

        #region FrontendSession

        private Session FFrontendSession;

        [Browsable(false)]
        public Session FrontendSession
        {
            get { return FFrontendSession; }
        }

        /// <summary> Prepares (or re-prepares) the frontend session and the component palette </summary>
        private void PrepareSession()
        {
            if (FFrontendSession == null)
            {
                FFrontendSession = Dataphoria.GetLiveDesignableFrontendSession();
                FPalettePanel.FrontendSession = this.FFrontendSession;
            }
            FFrontendSession.SetFormDesigner();
            FPalettePanel.ClearPalette();
            FPalettePanel.LoadPalette();
        }

        private void FormDesignerLibrariesChanged(object ASender, EventArgs AArgs)
{'fraction_non_alphanumeric': 0.06986946287181682, 'fraction_numerical': 0.00499322348241672, 'mean_word_length': 1.5576028459363314, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 30, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3863341', 'n_tokens_mistral': 7110, 'n_tokens_neox': 6812, 'n_words': 1295}