Exemplo n.º 1
0
        private SynchronizeData CreateSynchronizeDataForGuidList(Dictionary <uint, string> modfiedGuidList)
        {
            Dictionary <uint, SnapshotNode> modifiedGuids = new Dictionary <uint, SnapshotNode>();
            SynchronizeData syncDataReturn = new SynchronizeData();

            if (modfiedGuidList != null)
            {
                //foreach (uint guid in modfiedGuidList)
                foreach (var kvp in modfiedGuidList)
                {
                    // Get the uid recognized by the graphIDE
                    uint         guid  = kvp.Key;
                    string       name  = kvp.Value;
                    SnapshotNode sNode = new SnapshotNode(this.graphCompiler.GetRealUID(guid), SnapshotNodeType.Identifier, name);
                    if (!modifiedGuids.ContainsKey(sNode.Id))
                    {
                        modifiedGuids.Add(sNode.Id, sNode);
                    }
                }

                foreach (KeyValuePair <uint, SnapshotNode> kvp in modifiedGuids)
                {
                    syncDataReturn.ModifiedNodes.Add(kvp.Value);
                }
            }

            return(syncDataReturn);
        }
Exemplo n.º 2
0
        internal override string ToCode(out SnapshotNodeType type)
        {
            string replicationGuideString = string.Empty;
            int    i = 0;

            foreach (uint slot in inputSlots)
            {
                List <int> tmp = new List <int>();
                int        j   = 0;

                foreach (int value in replicationGuides[i])
                {
                    tmp.Add(value);
                    j++;
                }
                replicationGuideString += SnapshotNode.CreateReplicationGuideText(tmp);

                // The delimiter for a group of replication guides is'%'
                // Put all these characters in a definition structure or file
                replicationGuideString += GraphToDSCompiler.Constants.ReplicationGuideDelimiter;
                i++;
            }
            string assemblyPath = graphController.MapAssemblyPath(this.Assembly);

            // only external library need to convert the assembly path
            if (this.Assembly != assemblyPath)
            {
                assemblyPath = GraphUtilities.ConvertAbsoluteToRelative(assemblyPath);
            }

            if (this.MemberType == LibraryItem.MemberType.InstanceMethod || this.MemberType == LibraryItem.MemberType.InstanceProperty)
            {
                type = SnapshotNodeType.Method;
                string tempArgumentTypes = this.ArgumentTypes;
                // there is additional slot[0] with name "this" and type "this"
                // the "this" type need to be converted to proper class name(first part of the qualifiedName)
                //
                if (this.QualifiedName.Contains('.'))
                {
                    string className = this.QualifiedName.Substring(0, this.QualifiedName.IndexOf('.'));
                    tempArgumentTypes = tempArgumentTypes.Replace("this", className);
                }

                return(string.Format("{0};{1};{2};{3};{4}", assemblyPath, this.Caption, tempArgumentTypes, this.Text, replicationGuideString));
            }
            else
            {
                type = SnapshotNodeType.Function;
                return(string.Format("{0};{1};{2};{3};{4}", assemblyPath, this.QualifiedName, this.ArgumentTypes, this.Text, replicationGuideString));
            }
        }
Exemplo n.º 3
0
        public void Initialize()
        {
            List <SeekableLogFileReader.Block> eventBlocks = new List <SeekableLogFileReader.Block> ();
            AllocationsNode previousAllocationsNode        = null;

            Reset();
            foreach (SeekableLogFileReader.Block block in reader.Blocks)
            {
                if (block.Code == BlockCode.HEAP_DATA)
                {
                    previousAllocationsNode = CreateAllocationsNode(eventBlocks, previousAllocationsNode);
                    SnapshotNode node = new SnapshotNode(this, block, previousAllocationsNode);
                    rootNodes.Add(node);
                }
                else if (block.Code == BlockCode.EVENTS)
                {
                    eventBlocks.Add(block);
                }
                else if (block.Code == BlockCode.DIRECTIVES)
                {
                    reader.ReadBlock(block).Decode(heapEventProcessor, reader);
                }
                else if ((block.Code == BlockCode.MAPPING) || (block.Code == BlockCode.LOADED))
                {
                    reader.ReadBlock(block).Decode(heapEventProcessor, reader);
                }
                else if (block.Code == BlockCode.INTRO)
                {
                    reader.ReadBlock(block).Decode(heapEventProcessor, reader);
                }
                else if (block.Code == BlockCode.END)
                {
                    reader.ReadBlock(block).Decode(heapEventProcessor, reader);
                }
            }
            CreateAllocationsNode(eventBlocks, previousAllocationsNode);
        }
Exemplo n.º 4
0
            private SynchronizeData CreateSynchronizeDataForGuidList(Dictionary<uint, string> modfiedGuidList)
            {
                Dictionary<uint, SnapshotNode> modifiedGuids = new Dictionary<uint, SnapshotNode>();
                SynchronizeData syncDataReturn = new SynchronizeData();

                if (modfiedGuidList != null)
                {
                    //foreach (uint guid in modfiedGuidList)
                    foreach (var kvp in modfiedGuidList)
                    {
                        // Get the uid recognized by the graphIDE
                        uint guid = kvp.Key;
                        string name = kvp.Value;
                        SnapshotNode sNode = new SnapshotNode(this.graphCompiler.GetRealUID(guid), SnapshotNodeType.Identifier, name);
                        if (!modifiedGuids.ContainsKey(sNode.Id))
                        {
                            modifiedGuids.Add(sNode.Id, sNode);
                        }
                    }

                    foreach (KeyValuePair<uint, SnapshotNode> kvp in modifiedGuids)
                        syncDataReturn.ModifiedNodes.Add(kvp.Value);
                }

                return syncDataReturn;
            }