예제 #1
0
        /// <summary>
        /// Validates an area, creates the node and assigns node ids to all children.
        /// </summary>
        public bool ValidateArea(ISystemContext context, NodeState node)
        {
            // only need to validate once.
            node.OnValidate = null;

            DirectoryInfo directory = AreaState.GetDirectory(context, node.NodeId);

            if (directory == null || !directory.Exists)
            {
                return(false);
            }

            // initialize the area from the type model.
            node.Create(context, node.NodeId, node.BrowseName, null, false);

            // assign the child node ids.
            AssignChildNodeIds(context, node);

            return(true);
        }
예제 #2
0
        /// <summary>
        /// Validates a controller, creates the node and assigns node ids to all children.
        /// </summary>
        public bool ValidateController(ISystemContext context, NodeState node)
        {
            // only need to validate once.
            node.OnValidate = null;

            FileInfo file = ControllerState.GetFile(context, node.NodeId);

            if (file == null || !file.Exists)
            {
                return(false);
            }

            // initialize the controller from the type model.
            NodeId originalId = node.NodeId;

            node.Create(context, node.NodeId, node.BrowseName, null, false);

            node.NodeId = originalId;

            // assign the child node ids.
            AssignChildNodeIds(context, node);

            return(true);
        }
예제 #3
0
        /// <summary>
        /// Validates a controller, creates the node and assigns node ids to all children.
        /// </summary>
        public bool ValidateController(ISystemContext context, NodeState node)
        {
            // only need to validate once.
            node.OnValidate = null;

            FileInfo file = ControllerState.GetFile(context, node.NodeId);

            if (file == null || !file.Exists)
            {
                return false;
            }

            // initialize the controller from the type model.
            NodeId originalId = node.NodeId;

            node.Create(context, node.NodeId, node.BrowseName, null, false);

            node.NodeId = originalId;

            // assign the child node ids.
            AssignChildNodeIds(context, node);

            return true;
        }
예제 #4
0
        /// <summary>
        /// Validates an area, creates the node and assigns node ids to all children.
        /// </summary>
        public bool ValidateArea(ISystemContext context, NodeState node)
        {
            // only need to validate once.
            node.OnValidate = null;
                       
            DirectoryInfo directory = AreaState.GetDirectory(context, node.NodeId);

            if (directory == null || !directory.Exists)
            {
                return false;
            }
            
            // initialize the area from the type model.
            node.Create(context, node.NodeId, node.BrowseName, null, false);

            // assign the child node ids.
            AssignChildNodeIds(context, node);
                        
            return true;
        }