Esempio n. 1
0
        private static bool Filter(string searchString, Services.Project project)
        {
            if (!string.IsNullOrEmpty(searchString))
            {
                return(project.ProjectDetail.Name.StartsWith(searchString, StringComparison.CurrentCultureIgnoreCase));
            }

            return(true);
        }
Esempio n. 2
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);
        }
Esempio n. 3
0
        private Project GetAplayProject(Services.Project srvProject)
        {
            Project loadedProject;

            if (_aplayProjectsCache.TryGetProject(srvProject.Id, out loadedProject))
            {
                return(loadedProject);
            }

            var aplayProject = CreateAplayProject(srvProject);

            _aplayProjectsCache.AddProject(aplayProject);

            return(aplayProject);
        }
Esempio n. 4
0
        public override void onCreateProject(Client dataClient, String name__)
        {
            // Autogenerated log message for call
            APlay.Common.Logging.Logger.LogDesigned(2, "ProjectManager.onCreateProject called", "APlayTest.Server.ProjectManager");

            if (dataClient.CurrentUser != null)
            {
                Services.Project newProject = _projectManagerService.CreateProject(name__, dataClient.CurrentUser.Name);

                var newAplayProject = GetAplayProject(newProject);

                SelectedProject = newAplayProject;

                UpdateStates();
            }
        }