Ejemplo n.º 1
0
        private Project CreateAplayProject(Services.Project srvProject)
        {
            Project aplayProject = new Project()
            {
                Id            = srvProject.Id,
                ProjectDetail = new ProjectDetail(srvProject.ProjectDetail.Name,
                                                  srvProject.ProjectDetail.CreatedBy, srvProject.ProjectDetail.CreationDate),
                SheetManager = new SheetManager()
            };

            var sheet = _sheetFactory.Create();

            sheet.Name = "Sheet 1 " + DateTime.Now.ToLongTimeString();
            aplayProject.SheetManager.Sheets.Add(sheet);


            var blockFrom = _blockSymbolFactory.Create(sheet);

            blockFrom.PositionX = 100.0;
            blockFrom.PositionY = 100.0;

            var outputConnectorFrom = _connectorFactory.Create(sheet);

            var blockTo = _blockSymbolFactory.Create(sheet);

            blockTo.PositionX = 400;
            blockTo.PositionY = 100;

            var inputConnectorTo = _connectorFactory.Create(sheet);


            var connection = _connectionFactory.Create(sheet);

            connection.From = outputConnectorFrom;
            connection.To   = inputConnectorTo;

            //inputConnectorTo.Connections.Add(connection);
            //outputConnectorFrom.Connections.Add(connection);

            blockTo.Connectors.Add(inputConnectorTo);
            blockFrom.Connectors.Add(outputConnectorFrom);

            //aplayProject.SheetManager.Sheets[0].Connections.Add(connection);

            aplayProject.SheetManager.Sheets[0].BlockSymbols.Add(blockFrom);
            aplayProject.SheetManager.Sheets[0].BlockSymbols.Add(blockTo);



            return(aplayProject);
        }
Ejemplo n.º 2
0
 public override Sheet onCreateSheet()
 {
     return(_sheetFactory.Create());
 }