Exemplo n.º 1
0
        private void OnEnable()
        {
            if (_groups == null)
            {
                try
                {
                    Context.Init();

                    _groups = Context.Groups
                              .Distinct()
                              .ToArray();
                }
                catch (Exception e)
                {
                    LogUtils.Verbose(e);

                    _groups = null;
                }
            }

            if (_groups == null)
            {
                return;
            }

            _treeViewState = new TreeViewState();
            _treeView      = new GroupsTreeView(_groups, serializedObject);
            _treeView.Reload();

            _searchField = new SearchField();
        }
Exemplo n.º 2
0
        private void OnEnable()
        {
            if (_roots == null)
            {
                try
                {
                    _roots = new ProxyCodeGenerator {
                        TargetAssemblies = AppDomain.CurrentDomain.GetAssemblies()
                    }
                    .GetRootDefinitions()
                    .ToArray();
                    _groups = _roots
                              .SelectMany(r => r.Attributes)
                              .Select(a => a.Group)
                              .Distinct()
                              .ToArray();
                }
                catch (Exception e)
                {
                    if (YamlySettings.Instance.VerboseLogs)
                    {
                        Debug.LogException(e);
                    }

                    _roots = null;
                }
            }

            if (_roots == null)
            {
                return;
            }

            _treeViewState = new TreeViewState();
            _treeView      = new GroupsTreeView(_groups, serializedObject);
            _treeView.Reload();

            _searchField = new SearchField();
        }