示例#1
0
        private void DisplyChildObjects(string rootNodeHader, TreeViewItem currentObjectTreeViewItem,
                                        TSqlObject currentObject, Dictionary <string, TreeViewItem> childObjectTypes)
        {
            var children = currentObject.GetChildren();

            foreach (var child in children.OrderBy(p => p, new SqlObjectComparer()))
            {
                var type = child.ObjectType.Name;
                var typeContainerHeader = GetContainerHeader(type);

                if (!childObjectTypes.ContainsKey(typeContainerHeader))
                {
                    var item = AddTreeItem(typeContainerHeader, currentObjectTreeViewItem, _defaultForeground);
                    childObjectTypes.Add(typeContainerHeader, item);
                }

                var childTreeViewItem = AddTreeItem(child.Name.ToString(), childObjectTypes[typeContainerHeader],
                                                    _defaultForeground);

                DisplayObject(rootNodeHader, child, childTreeViewItem);
            }
            var repository = ModelRepository.GetRepository();

            if (repository.LoadScriptDom())
            {
                TSqlFragment fragment;

                TSqlModelUtils.TryGetFragmentForAnalysis(currentObject, out fragment);
                var frgPrc = new TSqlFragmentProcess.TSqlFragmentProcess(this);
                frgPrc.ProcessTSQLFragment(fragment, currentObjectTreeViewItem);
            }
        }
示例#2
0
        private void DisplyChildObjects(string rootNodeHader, TreeViewItem currentObjectTreeViewItem,
            TSqlObject currentObject, Dictionary<string, TreeViewItem> childObjectTypes)
        {
            var children = currentObject.GetChildren();

            foreach (var child in children.OrderBy(p => p, new SqlObjectComparer()))
            {
                
                var type = child.ObjectType.Name;
                var typeContainerHeader = GetContainerHeader(type);

                if (!childObjectTypes.ContainsKey(typeContainerHeader))
                {
                    var item = AddTreeItem(typeContainerHeader, currentObjectTreeViewItem, _defaultForeground);
                    childObjectTypes.Add(typeContainerHeader, item);
                }

                var childTreeViewItem = AddTreeItem(child.Name.ToString(), childObjectTypes[typeContainerHeader],
                    _defaultForeground);

                DisplayObject(rootNodeHader, child, childTreeViewItem);
            }
            var repository = ModelRepository.GetRepository();

            if (repository.LoadScriptDom())
            {
                TSqlFragment fragment;

                TSqlModelUtils.TryGetFragmentForAnalysis(currentObject, out fragment);
                var frgPrc = new TSqlFragmentProcess.TSqlFragmentProcess(this);
                frgPrc.ProcessTSQLFragment(fragment, currentObjectTreeViewItem);
            }
        }