Ejemplo n.º 1
0
        private void OnVertexImported(NDataSourceImporter importer, NShape shape, INDataRecord dataRecord)
        {
            // Create a shape to host in the group based on the value of the "Type" column
            NShape innerShape = null;

            switch (dataRecord.GetColumnValue("Type").ToString())
            {
            case "DB":
                innerShape = m_FilesAndFoldersFactory.CreateShape(FilesAndFoldersShapes.Binder);
                break;

            case "File":
                innerShape = m_FilesAndFoldersFactory.CreateShape(FilesAndFoldersShapes.SimpleFolder);
                break;

            case "Report":
                innerShape = m_FilesAndFoldersFactory.CreateShape(FilesAndFoldersShapes.BlankFile);
                break;
            }

            innerShape.Text = dataRecord.GetColumnValue("Id").ToString();

            // Host the created shape in the group
            NGroup group = (NGroup)shape;

            group.Shapes.AddChild(innerShape);
            group.UpdateModelBounds();
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Called when a vertex shape was created by the NGraphDataSourceImporter for the specified data record
        /// </summary>
        /// <param name="importer"></param>
        /// <param name="shape"></param>
        /// <param name="dataRecord"></param>
        private void OnVertexImported(NDataSourceImporter importer, NShape shape, INDataRecord dataRecord)
        {
            // display the page title in the shape
            object text = dataRecord.GetColumnValue("Title");

            if (text == null)
            {
                shape.Text = "Title not specified";
            }
            else
            {
                shape.Text = text.ToString();
            }

            shape.SizeToText(new NMarginsF(10));

            // make the URL a tooltip of the shape
            object url = dataRecord.GetColumnValue("URL");

            if (url == null || url.ToString().Length == 0)
            {
                shape.Style.InteractivityStyle = new NInteractivityStyle("URL not specified");
            }
            else
            {
                shape.Style.InteractivityStyle = new NInteractivityStyle(url.ToString());
            }
        }
Ejemplo n.º 3
0
        private void OnEdgeImported(NDataSourceImporter dataSourceImporter, NShape shape, INDataRecord dataRecord)
        {
            // Set the text of the edge
            shape.Text = dataRecord.GetColumnValue("Desc").ToString();

            // Get the symbol name if any
            object symbol = dataRecord.GetColumnValue("Symbol");

            if (symbol == null || Convert.IsDBNull(symbol))
            {
                return;
            }

            // Add a logical line port
            NLogicalLinePort linePort = new NLogicalLinePort(20);

            shape.CreateShapeElements(ShapeElementsMask.Ports);
            shape.Ports.AddChild(linePort);

            // Attach a custom shape based on the symbol name
            NShape customShape = null;

            switch (symbol.ToString())
            {
            case "Stop":
                customShape = m_BusinessProcessShapesFactory.CreateShape(BusinessProcessShapes.StopAccepted);
                break;

            case "Question":
                customShape = m_BusinessProcessShapesFactory.CreateShape(BusinessProcessShapes.Question);
                break;
            }

            ((NDrawingDocument)shape.Document).ActiveLayer.AddChild(customShape);

            // Protect the symbol from user interactions
            NAbilities protection = customShape.Protection;

            protection.All         = true;
            customShape.Protection = protection;

            // Add an outward port to the shape
            NRotatedBoundsPort outwardPort = new NRotatedBoundsPort(new NContentAlignment(ContentAlignment.MiddleCenter));

            outwardPort.Type = PortType.Outward;
            customShape.CreateShapeElements(ShapeElementsMask.Ports);
            customShape.Ports.AddChild(outwardPort);

            outwardPort.Connect(linePort);
        }
        /// <summary>
        /// Called when a vertex shape was created by the NTreeDataSourceImporter for the specified data record
        /// </summary>
        /// <param name="importer"></param>
        /// <param name="shape"></param>
        /// <param name="dataRecord"></param>
        private void OnVertexImported(NDataSourceImporter importer, NShape shape, INDataRecord dataRecord)
        {
            // display the page title in the shape
            object text = dataRecord.GetColumnValue("Title");

            if (text == null)
            {
                shape.Text = "Title not specified";
            }
            else
            {
                shape.Text = text.ToString();
            }

            shape.SizeToText(new NMarginsF(10));
        }
 protected void OnTreeImporterVertexImported(NDataSourceImporter dataSourceImporter, NShape shape, INDataRecord record)
 {
     InitTableShape((NTableShape)shape, new NEmployee(record));
 }
Ejemplo n.º 6
0
 private void treeImporter_VertexImported(NDataSourceImporter dataSourceImporter, NShape shape, INDataRecord record)
 {
     InitTableShape((NTableShape)shape, new NEmployee(record));
 }