Ejemplo n.º 1
0
    private void LoadGraphFromStream(TextReader reader)
    {
        this.Nodes.Clear();
        reader.ReadLine();
        string str;

        while ((str = reader.ReadLine()) != null)
        {
            string[] strArray1 = str.Split('\t');
            if (strArray1.Length >= 4 && !string.IsNullOrEmpty(strArray1[0]))
            {
                DependencyGraph.NodeFlags nodeFlags = (DependencyGraph.NodeFlags) int.Parse(strArray1[6]);
                DependencyGraph.Node      node1     = this.GetNode(strArray1[0]);
                node1.Path     = strArray1[2];
                node1.Name     = strArray1[1];
                node1.NameHash = node1.Name.GetHashCode();
                node1.Size     = int.Parse(strArray1[4]);
                node1.Hash     = DependencyGraph.DeserializeHash(strArray1[5]);
                node1.Flags    = nodeFlags;
                string[] strArray2 = strArray1[3].Split('/');
                for (int index = 0; index < strArray2.Length; ++index)
                {
                    if (!string.IsNullOrEmpty(strArray2[index]))
                    {
                        DependencyGraph.Node node2 = this.GetNode(strArray2[index]);
                        node1.Dependencies.Add(node2);
                    }
                }
            }
        }
    }