Exemplo n.º 1
0
        public static void LoadFromSystemDB(MieSystemDB systemDB, MieChatterNodeInfo chatterNodeInfo)
        {
            SQLiteCommand command = systemDB.Connection.CreateCommand();

            command.CommandText = @"SELECT * FROM ChatterNodeEntries ORDER BY FileCode;";
            using (SQLiteDataReader reader = command.ExecuteReader())
            {
                while (reader.Read() == true)
                {
                    var fileCode    = (long)reader["FileCode"];
                    var nodeID      = (int)(long)reader["NodeID"];
                    var xNodeType   = (long)reader["NodeType"];
                    var xIsRootNode = (long)reader["IsRootNode"];

                    MieChatterNodeEntry.NNodeType nodeType =
                        (MieChatterNodeEntry.NNodeType)Enum.ToObject(typeof(MieChatterNodeEntry.NNodeType), xNodeType);
                    bool isRootNode = xIsRootNode == 0 ? false : true;

                    MieChatterNodeEntry nodeEntry = new MieChatterNodeEntry(
                        nodeType,
                        nodeID,
                        isRootNode);

                    var nodeFile = chatterNodeInfo.GetNodeFile(fileCode);
                    var rc       = nodeFile.AddFlatNodeEntry(nodeEntry);
                }
            }

            foreach (var nodeFile in chatterNodeInfo.Files.Values)
            {
                nodeFile.BuildLink();
                nodeFile.UpdateDepth();
            }
        }
Exemplo n.º 2
0
        public static void LoadFromSystemDB(MieSystemDB systemDB, MieChatterNodeInfo convNodeInfo)
        {
            SQLiteCommand command = systemDB.Connection.CreateCommand();

            command.CommandText = @"SELECT FileCode,FromNodeID,ToNodeID FROM ChatterNodeLinks ORDER BY FileCode;";
            using (SQLiteDataReader reader = command.ExecuteReader())
            {
                while (reader.Read() == true)
                {
                    var fileCode   = (long)reader["FileCode"];
                    var fromNodeID = (int)(long)reader["FromNodeID"];
                    var toNodeID   = (int)(long)reader["ToNodeID"];

                    var            nodeFile = convNodeInfo.GetNodeFile(fileCode);
                    MieChatterLink nodeLink = new MieChatterLink(fromNodeID, toNodeID);
                    nodeFile.AddLinkEntry(nodeLink);
                }
            }
        }