Ejemplo n.º 1
0
        public override string ToString()
        {
            string node_str = "Node ";

            node_str += this.NodeName + "[";
            node_str += (this.SyncByName) ? Node.NODE_SYNCED + " " : Node.NODE_NOT_SYNCED + " ";
            node_str += NodePropertyValues.NodeManagerTypeToString(this.NodeManager) + " ";
            node_str += "[";
            if (this.ContainedNodes.Count > 0)
            {
                foreach (Node sN in this.ContainedNodes)
                {
                    node_str += sN.NodeName;
                    node_str += (sN.SyncByName) ? Node.NODE_SYNCED : Node.NODE_NOT_SYNCED;
                    node_str += " ";
                }
            }
            node_str += "]]";

            return(node_str);
        }
        private static List <string> GetNodeRecordSimple(Node _node)
        {
            List <string> node_record = new List <string>();

            if (_node == null)
            {
                return(node_record);
            }

            node_record.Add(_node.NodeName);
            string sync_by_name = (_node.SyncByName) ? "1" : "0";

            node_record.Add(sync_by_name);
            node_record.Add(_node.NodeDescr);
            node_record.Add(_node.NodeUnit);
            node_record.Add(_node.NodeDefaultVal);
            node_record.Add(_node.NodeSource);
            node_record.Add(NodePropertyValues.NodeManagerTypeToString(_node.NodeManager));

            string has_geom = (_node.HasGeometry) ? "1" : "0";

            node_record.Add(has_geom);

            string contained = "";

            if (_node.ContainedNodes.Count > 0)
            {
                foreach (Node subN in _node.ContainedNodes)
                {
                    contained += subN.NodeName + NODE_SEPARATORS[0] + " ";
                }
                contained = contained.Substring(0, contained.Length - 2);
            }
            node_record.Add(contained);

            return(node_record);
        }