protected override void OnPreviewKeyDown(PreviewKeyDownEventArgs e)
        {
            if (FocusedClass != null)
            {
                BaseTemplate template = FocusedClass;
                if (FocusedClass.FocusedItem != null)
                {
                    template = FocusedClass.FocusedItem;

                    if (template is FunctionBody)
                    {
                        ProcessKeyDownOnCodeEditor(e, (FunctionBody)template);
                        return;
                    }
                }

                if (e.KeyCode == Keys.Delete)
                {
                    if (e.Shift)
                    {
                        // #TODO# - Remove Selected Row
                    }
                    else
                    {
                        template.Name = "";
                    }

                    Refresh();
                }
                else if (e.KeyCode == Keys.Up || e.KeyCode == Keys.Down || e.KeyCode == Keys.Enter)
                {
                    if (template is Field)
                    {
                        var index = FocusedClass.Fields.IndexOf((Field)template);
                        if (index >= 0)
                        {
                            if (index == FocusedClass.Fields.Count - 1 && e.KeyCode != Keys.Up)
                            {
                                // last one move to functions
                            }
                            else if (index == 0 && e.KeyCode == Keys.Up)
                            {
                            }
                            else
                            {
                                FocusedClass.FocusedItem = FocusedClass.Fields[e.KeyCode == Keys.Up ? index - 1 : index + 1];
                                Refresh();
                            }
                        }
                    }
                }
            }
            base.OnPreviewKeyDown(e);
        }
        private bool CalculateHover(MouseEventArgs e)
        {
            if (Current != null && Current.Classes != null)
            {
                BaseTemplate shouldIsHovered = null;

                float mouseX = e.X;
                float mouseY = e.Y;

                var bounds = GetFloatButtonLocation();

                if (bounds.Contains(mouseX, mouseY) && bounds.CircleContains(mouseX, mouseY))
                {
                    shouldIsHovered = FloatingMenu;
                }
                else
                {
                    if (!IsMenuVisible)
                    {
                        mouseX -= Current.X;
                        mouseY -= Current.Y;

                        var cls = GetClassFromLocation(mouseX, mouseY);
                        shouldIsHovered = cls;

                        if (cls != null)
                        {
                            var item = GetClassItem(cls, mouseY, mouseX);
                            if (item != null)
                            {
                                shouldIsHovered = item;
                            }
                        }
                    }
                    else
                    {
                        shouldIsHovered = GetButtonFromLocation(mouseX, mouseY);
                    }
                }

                if (_lastHovered != shouldIsHovered)
                {
                    if (_lastHovered != null)
                    {
                        _lastHovered.IsHovered = false;
                    }

                    _lastHovered = shouldIsHovered;

                    if (_lastHovered != null)
                    {
                        _lastHovered.IsHovered = true;
                    }

                    Refresh();
                    return(true);
                }
            }

            return(false);
        }
        protected override void OnKeyPress(KeyPressEventArgs e)
        {
            if (FocusedClass != null)
            {
                BaseTemplate template = FocusedClass;
                if (FocusedClass.FocusedItem != null)
                {
                    template = FocusedClass.FocusedItem;

                    if (template is FunctionBody)
                    {
                        // Process the key press for the code editor.
                        ProcessKeyPressOnCodeEditor(e, (FunctionBody)template);
                        return;
                    }
                }

                if (e.KeyChar == '\b')
                {
                    if (template.Name.Length > 0)
                    {
                        template.Name = template.Name.Remove(template.Name.Length - 1, 1);
                    }
                }
                else
                {
                    if (e.KeyChar == '=' && template is Field)
                    {
                        var field = (Field)template;
                        if (field.InitalValue == null)
                        {
                            field.InitalValue = new Value(field);
                        }
                        FocusedClass.FocusedItem = field.InitalValue;
                        return;
                    }

                    if (template is Value)
                    {
                        var vl = (Value)template;
                        if (vl.AllSelected)
                        {
                            vl.AllSelected = false;
                            vl.Name        = "";
                        }
                        template.Name += e.KeyChar;
                    }
                    else
                    {
                        if (char.IsLetterOrDigit(e.KeyChar) || e.KeyChar == ' ' || e.KeyChar == '_' || e.KeyChar == '-')
                        {
                            template.Name += e.KeyChar == ' ' ? '_' : e.KeyChar == '-' ? '_' : e.KeyChar;
                        }
                        string name = (template.Name + "").Trim();
                        if (template is Class)
                        {
                            name = name.ToTitleCase();
                        }
                        template.Name = name;
                    }
                }

                Refresh();
            }


            base.OnKeyPress(e);
        }