コード例 #1
0
        public void CheckAS3(string filename)
        {
            if (flex2Shell == null)
            {
                UpdateSettings();
            }
            if (!sdkOk)
            {
                ErrorHandler.ShowInfo("Set the path to the Flex 2 SDK in the program settings.");
                return;
            }
            if (!File.Exists(filename))
            {
                return;
            }
            mainForm.CallCommand("Save", null);

            try
            {
                mainForm.DispatchEvent(new NotifyEvent(EventType.ProcessStart));

                if (ascRunner == null || !ascRunner.isRunning)
                {
                    StartAscRunner();
                }
                mainForm.AddTraceLogEntry("AscShell command: " + filename, -1);

                StringBuilder sb = new StringBuilder(filename.Length);
                GetShortPathName(filename, sb, (uint)filename.Length);
                string shortname = sb.ToString().Replace(".AS", ".as");

                WatchFile(shortname);                 //filename);

                ASContext.SetStatusText("Asc Running");
                notificationSent = false;
                ascRunner.process.StandardInput.WriteLine("clear");
                ascRunner.process.StandardInput.WriteLine("asc -p " + shortname);
            }
            catch (Exception ex)
            {
                ErrorHandler.ShowError("Error while running the AS3 syntax checking.", ex);
            }
        }