示例#1
0
        public void insertNodeIfNotExist(dbNode input_node)
        {
            var node_existing = nodes.FindOne(Query.EQ("name", input_node.name));

            if (node_existing == null)
            {
                nodes.Insert(input_node);
            }
        }
示例#2
0
 public serverNode(dbNode n)
 {
     Id                 = n.Id;
     name               = n.name;
     identifier         = n.identifier;
     internalIndex      = n.internalIndex;
     classType          = n.classType;
     systemType         = n.systemType;
     references         = n.references;
     currentServerIndex = -1;
     serverIdentifier   = "none";
 }
示例#3
0
        /// <summary>
        /// Initialization of the variable value in DB, this is used if the variable does not exist yet,
        /// then one looks into the nodelist.
        /// </summary>
        /// <param name="name">name of the variable value to initialize</param>
        /// <returns></returns>
        private dbVariableValue _initVarValue(string name)
        {
            dbNode var_idx = nodes.FindOne(Query.EQ("name", name));

            if (var_idx == null)
            {
                throw new Exception("variable does not exist: " + name);
            }
            else
            {
                dbVariableValue new_var = new dbVariableValue
                {
                    Id         = var_idx.Id,
                    name       = var_idx.name,
                    systemType = var_idx.systemType,
                };
                return(new_var);
            }
        }