Beispiel #1
0
            private void ThreadProc()
            {
                while ((Environment.TickCount - lastFileUpdateTime) < 500)
                {
                    Thread.Sleep(500);
                }

                Thread.Sleep(500);

                if (IsProjectChanged())
                {
                    VS71IDE ide = new VS71IDE();
                    ide.ComposeProject(scriptFile);
                }
            }
            private void ThreadProc()
            {
                while ((Environment.TickCount - lastFileUpdateTime) < 500)
                    Thread.Sleep(500);

                Thread.Sleep(500);

                if (IsProjectChanged())
                {
                    VS71IDE ide = new VS71IDE();
                    ide.ComposeProject(scriptFile);
                }
            }
        public static void Main(string[] args)
        {
            if (args.Length == 0 || (args.Length == 1 && (args[0] == "?" || args[0] == "/?" || args[0] == "-?" || args[0].ToLower() == "help")))
            {
                Console.WriteLine(usage);
            }
            else
            {
                if (args[0].Trim().ToLower() == "/prj")
                {
                    scriptFile = ResolveScriptFile(args[1]);

                    try
                    {
                        VS71IDE ide = new VS71IDE();
                        ide.IsolateProject(scriptFile, Path.Combine(Path.GetDirectoryName(scriptFile), Path.GetFileNameWithoutExtension(scriptFile)));
                    }
                    catch (Exception e)
                    {
                        MessageBox.Show("Specified file could not be linked to the temp project:\n" + e.Message);
                    }
                }
                else
                {
                    scriptFile =  ResolveScriptFile(args[0]);

                    try
                    {
                        VS71IDE ide = new VS71IDE();
                        ide.ComposeProject(scriptFile);

                        ScriptMonitor monitor = new ScriptMonitor(scriptFile);

                        Environment.CurrentDirectory = Path.GetDirectoryName(scriptFile);

                        //open project

                        Process myProcess = new Process();
                        myProcess.StartInfo.FileName = VS71IDE.IDEFile;
                        myProcess.StartInfo.Arguments = VS71IDE.GenerateCmdArgs(scriptFile);
                        myProcess.Start();
                        myProcess.WaitForExit();

                        //do clean up
                        foreach (string file in VS71IDE.filesToClean.Keys) //clean imported files
                        {
                            if (File.Exists(file))
                            {
                                File.SetAttributes(file, FileAttributes.Normal);
                                File.Delete(file);
                            }
                        }
                        if (File.Exists(Path.ChangeExtension(scriptFile, ".resx"))) //clean auto-generated files
                            File.Delete(Path.ChangeExtension(scriptFile, ".resx"));
                        Directory.Delete(VS71IDE.projectDir, true);  //clean whole project directory
                    }
                    catch (Exception e)
                    {
                        MessageBox.Show("Specified file could not be linked to the temp project:\n" + e.Message);
                    }
                }
            }
        }
Beispiel #4
0
        static public void Main(string[] args)
        {
            if (args.Length == 0 || (args.Length == 1 && (args[0] == "?" || args[0] == "/?" || args[0] == "-?" || args[0].ToLower() == "help")))
            {
                Console.WriteLine(usage);
            }
            else
            {
                if (args[0].Trim().ToLower() == "/prj")
                {
                    scriptFile = ResolveScriptFile(args[1]);

                    try
                    {
                        VS71IDE ide = new VS71IDE();
                        ide.IsolateProject(scriptFile, Path.Combine(Path.GetDirectoryName(scriptFile), Path.GetFileNameWithoutExtension(scriptFile)));
                    }
                    catch (Exception e)
                    {
                        MessageBox.Show("Specified file could not be linked to the temp project:\n" + e.Message);
                    }
                }
                else
                {
                    scriptFile = ResolveScriptFile(args[0]);

                    try
                    {
                        VS71IDE ide = new VS71IDE();
                        ide.ComposeProject(scriptFile);

                        ScriptMonitor monitor = new ScriptMonitor(scriptFile);

                        Environment.CurrentDirectory = Path.GetDirectoryName(scriptFile);

                        //open project

                        Process myProcess = new Process();
                        myProcess.StartInfo.FileName  = VS71IDE.IDEFile;
                        myProcess.StartInfo.Arguments = VS71IDE.GenerateCmdArgs(scriptFile);
                        myProcess.Start();
                        myProcess.WaitForExit();

                        //do clean up
                        foreach (string file in VS71IDE.filesToClean.Keys)                         //clean imported files
                        {
                            if (File.Exists(file))
                            {
                                File.SetAttributes(file, FileAttributes.Normal);
                                File.Delete(file);
                            }
                        }
                        if (File.Exists(Path.ChangeExtension(scriptFile, ".resx")))                         //clean auto-generated files
                        {
                            File.Delete(Path.ChangeExtension(scriptFile, ".resx"));
                        }
                        Directory.Delete(VS71IDE.projectDir, true);                          //clean whole project directory
                    }
                    catch (Exception e)
                    {
                        MessageBox.Show("Specified file could not be linked to the temp project:\n" + e.Message);
                    }
                }
            }
        }