Exemple #1
0
        /// <summary>
        /// Execute a project.
        /// </summary>
        /// <param name="uid">Id for project.</param>
        /// <param name="fileDM">File domain model.</param>
        public static void Execute(Guid uid, PythonFileDM fileDM)
        {
            PyProject project = projects[uid];

            project.Create(SERVER_LOCATION, "fiddle" + uid);
            var location = PyTools.CreatePath(SERVER_LOCATION, "fiddle" + uid);
            var file     = new PyFile(fileDM.ID, location, fileDM.Name, fileDM.SourceCode);

            project.AddFile(file);
            project.StartUpFileID = file.ID;
            project.Run();
        }
Exemple #2
0
        /// <summary>
        /// Execute a project.
        /// </summary>
        /// <param name="uid">Id for project.</param>
        /// <param name="fileDM">File domain model.</param>
        public static void Execute(Guid uid, PythonProjectDM projectDM)
        {
            PyProject project = projects[uid];

            project.Create(SERVER_LOCATION, projectDM.ID.ToString());
            var location = PyTools.CreatePath(SERVER_LOCATION, projectDM.ID.ToString());

            projectDM.Files.ForEach((fileDM) =>
            {
                var file = new PyFile(fileDM.ID, location, fileDM.Name, fileDM.SourceCode);
                project.AddFile(file);
                if (projectDM.StartFileName == fileDM.Name)
                {
                    project.StartUpFileID = fileDM.ID;
                }
            });
            project.Run();
        }
Exemple #3
0
 /// <summary>
 /// Register handler with a project.
 /// </summary>
 /// <param name="uid">Id for project.</param>
 /// <param name="handler">Handler for project.</param>
 public static void Register(Guid uid, EventHandler <StreamNotificationEvent> handler)
 {
     projects[uid] = new PyProject(handler);
 }