protected override void Initialize()
        {
            this.menuTreeWidth = this.GetPersistentValue <float>("menuTreeWidth", 380);
            this.columns       = new List <ResizableColumn>()
            {
                ResizableColumn.FlexibleColumn(this.menuTreeWidth.Value, 80), ResizableColumn.DynamicColumn(0, 200)
            };
            this.runner                = new ValidationRunner();
            this.overview              = new ValidationOverview();
            this.editor                = this.ValueEntry.SmartValue;
            this.profile               = this.editor.Profile;
            this.sourceProperty        = this.Property.Children["selectedSourceTarget"];
            this.validationProfileTree = new ValidationProfileTree();
            this.overviewToggle        = this.GetPersistentValue <bool>("overviewToggle", true);

            this.validationProfileTree.Selection.SelectionChanged += (x) =>
            {
                if (x == SelectionChangedType.ItemAdded)
                {
                    object value = this.validationProfileTree.Selection.SelectedValue;
                    ValidationProfileResult result = value as ValidationProfileResult;
                    if (result != null)
                    {
                        this.editor.SetTarget(result.GetSource());
                    }
                    else
                    {
                        this.editor.SetTarget(value);
                    }
                }
            };

            this.overview.OnProfileResultSelected += result =>
            {
                OdinMenuItem mi = this.validationProfileTree.GetMenuItemForObject(result);
                mi.Select();
                object source = result.GetSource();
                this.editor.SetTarget(source);
            };

            this.validationProfileTree.AddProfileRecursive(this.ValueEntry.SmartValue.Profile);

            OdinMenuTree.ActiveMenuTree = this.validationProfileTree;

            if (this.editor.ScanProfileImmediatelyWhenOpening)
            {
                this.editor.ScanProfileImmediatelyWhenOpening = false;
                this.ScanProfile(this.editor.Profile);
            }
        }
        private void DrawTopBarButtons()
        {
            string btnName = "Run " + this.profile.Name;
            float  width   = GUI.skin.button.CalcSize(GUIHelper.TempContent(btnName)).x + 10;
            Rect   rect    = GUIHelper.GetCurrentLayoutRect().AlignRight(width);

            rect.x     -= 5;
            rect.y     -= 26;
            rect.height = 18;

            GUIHelper.PushColor(Color.green);
            if (GUI.Button(rect, btnName))
            {
                this.ScanProfile(this.profile);
            }
            GUIHelper.PopColor();

            object selectedValue = this.validationProfileTree.Selection.SelectedValue;

            if (selectedValue is ValidationProfileResult)
            {
                ValidationProfileResult result = selectedValue as ValidationProfileResult;
                if (result != null)
                {
                    // Draw top bar buttons
                    Object source = result.GetSource() as UnityEngine.Object;
                    if (source != null)
                    {
                        rect.x    -= 100;
                        rect.width = 90;
                        if (GUI.Button(rect, "Select Object", SirenixGUIStyles.ButtonRight))
                        {
                            GUIHelper.SelectObject(source);
                            GUIHelper.PingObject(source);
                        }
                        rect.x    -= 80;
                        rect.width = 80;
                        if (GUI.Button(rect, "Ping Object", SirenixGUIStyles.ButtonLeft))
                        {
                            GUIHelper.PingObject(source);
                        }
                    }
                }
            }
        }
        public ValidationProfileTree()
        {
            this.Config.DrawSearchToolbar            = true;
            this.Config.AutoHandleKeyboardNavigation = true;
            this.Config.UseCachedExpandedStates      = false;

            this.DefaultMenuStyle    = OdinMenuStyle.TreeViewStyle;
            this.childMenuItemLookup = new Dictionary <object, OdinMenuItem>();

            this.Selection.SelectionConfirmed += (x) =>
            {
                OdinMenuItem sel = x.FirstOrDefault();
                if (sel != null && sel.Value is ValidationProfileResult)
                {
                    ValidationProfileResult result = sel.Value as ValidationProfileResult;
                    if (result != null)
                    {
                        UnityEngine.Object source = result.GetSource() as UnityEngine.Object;
                        GUIHelper.SelectObject(source);
                    }
                }
            };
        }