Пример #1
0
            private void CreateNodeCaches()
            {
                _typeSymbols = new NodeCache<TypeDesc, GenericLookupResult>(type =>
                {
                    return new TypeHandleGenericLookupResult(type);
                });

                _methodDictionaries = new NodeCache<MethodDesc, GenericLookupResult>(method =>
                {
                    return new MethodDictionaryGenericLookupResult(method);
                });

                _methodEntrypoints = new NodeCache<MethodDesc, GenericLookupResult>(method =>
                {
                    return new MethodEntryGenericLookupResult(method);
                });

                _virtualCallHelpers = new NodeCache<MethodDesc, GenericLookupResult>(method =>
                {
                    return new VirtualDispatchGenericLookupResult(method);
                });

                _typeGCStaticBaseSymbols = new NodeCache<TypeDesc, GenericLookupResult>(type =>
                {
                    return new TypeGCStaticBaseGenericLookupResult(type);
                });

                _typeNonGCStaticBaseSymbols = new NodeCache<TypeDesc, GenericLookupResult>(type =>
                {
                    return new TypeNonGCStaticBaseGenericLookupResult(type);
                });
            }
Пример #2
0
            public TreeNode LogEventAttributeToNode(string attributeValue, TreeNode rootNode, char separatorChar)
            {
                if (attributeValue == null)
                    return null;

                NodeCache nc = _objectValue2TreeNodeCache[attributeValue] as NodeCache;
                if (nc != null)
                {
                    //nc.Node.Text = nc.BaseText; // +" (" + nc.Count++ + ")";
                    return nc.Node;
                }

                TreeNode parentNode;

                string baseName;
                int rightmostDot = -1;
                if (separatorChar != 0)
                    rightmostDot = attributeValue.LastIndexOf(separatorChar);
                if (rightmostDot < 0)
                {
                    parentNode = rootNode;
                    baseName = attributeValue;
                }
                else
                {
                    string parentLoggerName = attributeValue.Substring(0, rightmostDot);
                    baseName = attributeValue.Substring(rightmostDot + 1);
                    parentNode = LogEventAttributeToNode(parentLoggerName, rootNode, separatorChar);
                }

                TreeNode newNode = new TreeNode(baseName);
                nc = new NodeCache();
                nc.BaseText = baseName;
                nc.Node = newNode;
                nc.Count = 1;
                _objectValue2TreeNodeCache[attributeValue] = nc;
                parentNode.Nodes.Add(newNode);
                return newNode;
            }
Пример #3
0
 private void InsertBefore(NodeCache nodeCache)
 {
     Check(true);
     if (nodeCache != null)
     {
         Updates.Do(new Insert(null, nodeCache.value(), false, false, true, false, DbNode));
     }
 }
Пример #4
0
 // Used by ReadInnerXml(), ReadInnerText(), and set_Value()
 // Deletes all the child nodes and adds the nodeCache nodes, does nothing if nodeCache is null
 private void ReplaceChildren(NodeCache nodeCache)
 {
     if (nodeCache != null)
     {
         ANode[] nodes = EnumerateANodes(ANode.children()).ToArray();
         using (new Updates())
         {
             Updates.Do(new Delete(null, Seq.get(nodes, nodes.Length)));
             Updates.Do(new Insert(null, nodeCache.value(), false, true, false, false, DbNode));
         }
     }
 }
Пример #5
0
 public PeersHub(NodeCache nodeCache)
 {
     this.nodeCache = nodeCache;
 }