private void InitializeProjectsObjects()
        {
            RaiseDocumentationGenerationStepDoneEvent(1, "Creating projects' objects...");

            foreach (Project proj in m_SolutionProjects)
            {
                if (File.Exists(proj.ProjectAbsolutePath))
                {
                    ProjectReader currProjReader = ReaderFactory.BuildReader(proj);
                    currProjReader.ProjectReadEvent += currProjReader_ProjectReadEvent;

                    if (currProjReader != null)
                    {
                        if (!currProjReader.ReadProject())
                        {
                        }

                        //if (currProjReader.GetType() == typeof(CPPProjectReader))
                        //{
                        //   ((CPPProjectReader)currProjReader).ProjectReadEvent += currProjReader_ProjectReadEvent;
                        //}
                        //else if (currProjReader.GetType() == typeof(CSProjectReader))
                        //{
                        //   ((CSProjectReader)currProjReader).ProjectReadEvent += currProjReader_ProjectReadEvent;
                        //}
                        //else if (currProjReader.GetType() == typeof(VBProjectReader))
                        //{
                        //   ((VBProjectReader)currProjReader).ProjectReadEvent += currProjReader_ProjectReadEvent;
                        //}
                    }
                }
            }

            RaiseDocumentationGenerationStepDoneEvent(1, "Done creating projects' objects.");
        }
Esempio n. 2
0
        static void Main(string[] args)
        {
            var filename = "k3.gmk";
            var reader   = new ProjectReader(filename);

            Console.WriteLine("Reading project...");
            var project = reader.ReadProject();

            Console.WriteLine("Removing DND...");
            foreach (var obj in project.Objects)
            {
                foreach (var ev in obj.Events)
                {
                    foreach (var ev2 in ev)
                    {
                        DNDRemover.RemoveDNDForEvent(project, ev2);
                        //foreach (var action in ev2.Actions)
                        //{
                        //    //foreach (var a in action.Arguments)
                        //    //{
                        //    //    Console.WriteLine(a.Value);
                        //    //}
                        //    //Console.WriteLine(action.LibraryId);
                        //}
                    }
                }
            }

            Console.WriteLine("Writing project...");
            var writer = new ProjectWriter("RemovedDND.gmk", project);

            writer.WriteProject();
        }
Esempio n. 3
0
 /// <summary>
 ///
 /// </summary>
 private bool CheckCurrent()
 {
     try
     {
         IProject project = PluginBase.CurrentProject;
         if (project == null || !project.EnableInteractiveDebugger)
         {
             return(false);
         }
         ProjectReader reader = new ProjectReader(project.ProjectPath, new AS3Project(project.ProjectPath));
         currentProject = reader.ReadProject();
         // Give a console warning for non external player...
         if (currentProject.TestMovieBehavior == TestMovieBehavior.NewTab || currentProject.TestMovieBehavior == TestMovieBehavior.NewWindow)
         {
             TraceManager.Add(TextHelper.GetString("Info.CannotDebugActiveXPlayer"));
             return(false);
         }
     }
     catch (Exception e)
     {
         ErrorManager.ShowError(e);
         return(false);
     }
     return(true);
 }
Esempio n. 4
0
        private void InitializeProjectsObjects()
        {
            RaiseDocumentationGenerationStepDoneEvent(1, "Creating projects' objects...");

            foreach (Project proj in m_SolutionProjects)
            {
                if (File.Exists(proj.ProjectAbsolutePath))
                {
                    ProjectReader currProjReader;
                    switch (proj.UsedLangage)
                    {
                    case Project.LangageType.CPP:
                        currProjReader = new CPPProjectReader(proj);
                        ((CPPProjectReader)currProjReader).ProjectReadEvent += currProjReader_ProjectReadEvent;
                        break;

                    case Project.LangageType.CS:
                        currProjReader = new CSProjectReader(proj);
                        ((CSProjectReader)currProjReader).ProjectReadEvent += currProjReader_ProjectReadEvent;
                        break;

                    case Project.LangageType.VB:
                        currProjReader = new VBProjectReader(proj);
                        ((VBProjectReader)currProjReader).ProjectReadEvent += currProjReader_ProjectReadEvent;
                        break;

                    default:
                        currProjReader = new ProjectReader(proj);
                        break;
                    }

                    if (currProjReader != null)
                    {
                        if (!currProjReader.ReadProject())
                        {
                        }

                        if (currProjReader.GetType() == typeof(CPPProjectReader))
                        {
                            ((CPPProjectReader)currProjReader).ProjectReadEvent += currProjReader_ProjectReadEvent;
                        }
                        else if (currProjReader.GetType() == typeof(CSProjectReader))
                        {
                            ((CSProjectReader)currProjReader).ProjectReadEvent += currProjReader_ProjectReadEvent;
                        }
                        else if (currProjReader.GetType() == typeof(VBProjectReader))
                        {
                            ((VBProjectReader)currProjReader).ProjectReadEvent += currProjReader_ProjectReadEvent;
                        }
                    }
                }
            }

            RaiseDocumentationGenerationStepDoneEvent(1, "Done creating projects' objects.");
        }
        public Project GetProject(JObject json, ProjectReaderSettings settings = null)
        {
            using (var stream = new MemoryStream())
            {
                using (var sw = new StreamWriter(stream, Encoding.UTF8, 256, true))
                {
                    using (var writer = new JsonTextWriter(sw))
                    {
                        writer.Formatting = Formatting.Indented;
                        json.WriteTo(writer);
                    }

                    stream.Position = 0;
                    var projectReader = new ProjectReader();
                    return(projectReader.ReadProject(
                               stream,
                               ProjectName,
                               ProjectFilePath,
                               settings));
                }
            }
        }
        private Project GetProject(JObject json, ProjectReaderSettings settings = null)
        {
            using (var stream = new MemoryStream())
            {
                using (var sw = new StreamWriter(stream, Encoding.UTF8, 256, true))
                {
                    using (var writer = new JsonTextWriter(sw))
                    {
                        writer.Formatting = Formatting.Indented;
                        json.WriteTo(writer);
                    }

                    stream.Position = 0;
                    var projectReader = new ProjectReader();
                    return projectReader.ReadProject(
                        stream,
                        ProjectName,
                        ProjectFilePath,
                        settings);
                }
            }
        }