Ejemplo n.º 1
0
        private void addLibraryNodeWithoutSaving(Node node)
        {
            if (node == null)
            {
                return;
            }

            foreach (UcNodeViewer libraryNode in libraryNodeViewerList)
            {
                if (node.Name.Equals(libraryNode.Node.Name))
                {
                    return;
                }
            }
            Transformation nodeAsTransformation;
            DataSource     nodeAsDataSource;
            OutputNode     nodeAsOutputNode;
            CombinedNode   nodeAsCombinedNode;

            UcNodeViewer nodeViewer = null;

            if ((nodeAsTransformation = node as Transformation) != null)
            {
                nodeViewer = new UcTransformationViewer();
            }
            else if ((nodeAsDataSource = node as DataSource) != null)
            {
                nodeViewer = new UcDataSourceViewer();
            }
            else if ((nodeAsOutputNode = node as OutputNode) != null)
            {
                nodeViewer = new UcOutputViewer();
            }
            else if ((nodeAsCombinedNode = node as CombinedNode) != null)
            {
                if (node.Class.InputTypes.Count() > 0)
                {
                    nodeViewer = new UcTransformationViewer();
                }
                else
                {
                    nodeViewer = new UcDataSourceViewer();
                }
            }

            LibraryNodeViewerList.Add(nodeViewer);
            nodeViewer.DataContext = node;
            nodeViewer.IsLibrary   = true;
        }
        public UcNodeViewer generateTempNodeViewer()
        {
            UcNodeViewer tempNodeViewer = null;

            if (SelectedClass != null)
            {
                Node tempNode = SelectedClass.GenerateTempClass().GenerateNode();
                if (tempNode.Class.InputTypes.Length > 0)
                {
                    tempNodeViewer = new UcTransformationViewer();
                }
                else
                {
                    tempNodeViewer = new UcDataSourceViewer();
                }
                tempNodeViewer.DataContext = tempNode;
                tempNodeViewer.IsPreview   = true;
            }
            return(tempNodeViewer);
        }