//�ΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡι��캯��
 public ClassRelationsFinder(ClassInfoFinder obFinder)
 {
     m_obFinder = obFinder;
 }
예제 #2
0
 //�ΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡι��캯��
 public ClassNameFinder(string filePath, ClassFinder obFinder, ClassInfoFinder infoFinder)
 {
     m_stFilePath = filePath;
     m_obFinder = obFinder;
     m_obInfoFinder = infoFinder;
 }
예제 #3
0
 //�ΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡ��б��������
 public static string[] getIncludeList(ArrayList obList, ArrayList fileList, FileInfo obInfo, ClassFinder obFinder, ClassInfoFinder infoFinder)
 {
     if (File.Exists(obInfo.FullName))
     {
         XmlDocument xml = new XmlDocument();
         xml.Load(obInfo.FullName);
         XmlNodeReader reader = new XmlNodeReader(xml);
         while (reader.Read())
         {
             if (reader.NodeType == XmlNodeType.Element)
             {
                 if (reader.Name == "item")
                 {
                     string className = reader.GetAttribute("name");
                     string SkinClass_sign = reader.GetAttribute("skin");
                     if (SkinClass_sign == null)
                     {
                         string classPath = obFinder.getClassPath(className);
                         if (!File.Exists(classPath))
                             ErrorBox.Show(className + " cont find ", "ClassNameFinderError");
                         string infoPath = infoFinder.getClassPath(className);
                         if (File.Exists(infoPath))
                         {
                             if (fileList.IndexOf(infoPath) < 0)
                             {
                                 fileList.Add(infoPath);
                                 FileInfo subInfo = new FileInfo(infoPath);
                                 getIncludeList(obList, fileList, subInfo, obFinder, infoFinder);
                             }
                         }
                         else
                         {
                             ErrorBox.Show("className:" + className + "\r\nfileMissed:" + infoPath, "ClassNameFinderError");
                         }
                         ClassRelationsFinder ClassRelation = new ClassRelationsFinder(infoFinder);
                         for (int i = 0; i < obList.Count; i++)
                         {
                             if (obList.IndexOf(classPath) < 0)
                             {
                                 string testClass = obList[i] as string;
                                 FileInfo obTest = new FileInfo(testClass);
                                 FileInfo obFile = new FileInfo(classPath);
                                 if (ClassRelation.isSuper(obFile, obTest))
                                 {
                                     obList.Insert(i, classPath);
                                     break;
                                 }
                                 //else if (ClassRelation.isSuper(obTest, obFile))
                                 //{
                                 //    obList.Insert(i + 1, classPath);
                                 //    break;
                                 //}
                             }
                         }
                         if (obList.IndexOf(classPath) < 0)
                             obList.Add(classPath);
                     }
                     //�ΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡ���Դ�жϺ���
                 }
             }
             //�ΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡνڵ��жϺ���
         }
     }
     return obList.ToArray(typeof(string)) as string[];
 }
예제 #4
0
        //�ΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡ��ļ����뺯��
        public void compilerFile(FileInfo obFile, FileInfo obInfo, string targetFolder, string packageName,
            FileInfo obClass, ClassFinder obFinder, ClassInfoFinder infoFinder,
            bool blStrict, bool blOptimize, bool blWarnings, int width, int height, CheckState infoState)
        {
            m_obProcess = new Process();
            string stParameter = "";
            stParameter += m_stImport + m_stSpace + m_stAbc + "\\builtin.abc" + m_stSpace;
            stParameter += m_stImport + m_stSpace + m_stAbc + "\\playerglobal.abc" + m_stSpace;
            //stParameter += m_stImport + m_stSpace + m_stAbc + "\\toplevel.abc" + m_stSpace;
            string stInclude = "";
            string[] includeList = ClassNameFinder.getIncludeList(new ArrayList(), new ArrayList(), obInfo, obFinder, infoFinder);
            if (includeList.Length > 0)
            {
                string listInclude = m_stInclude + m_stSpace;
                stInclude += listInclude + string.Join(m_stSpace + m_stInclude + m_stSpace, includeList) + m_stSpace;
            }
            string className = obInfo.Name.Replace(".xml", "");
            if (obClass != null)
            {
                stInclude += m_stInclude + m_stSpace + obClass.FullName + m_stSpace;
                className = obFile.Name.Replace(".as", "");
            }
            if (packageName != null)
            {
                className = packageName + "." + className;
            }
            string options = "";
            if (blStrict)
                options = "-strict" + m_stSpace;
            if (blWarnings)
                options = "-warnings" + m_stSpace;
            if (blOptimize)
                options += "-optimize" + m_stSpace;
            options += "-swf" + m_stSpace;
            stParameter += stInclude + options + className + ",";
            stParameter += width.ToString() + ",";
            stParameter += height.ToString() + ",";
            stParameter += RootConfig.Template_fps.ToString() + m_stSpace + obFile.Name;
            if (infoState == CheckState.Checked)
                MessageBox.Show(stParameter);
            if (infoState == CheckState.Indeterminate)
                ListMessageBox.ShowForm(stParameter);

            stParameter = m_stCompiler + m_stSpace + stParameter;

            ProcessStartInfo psi = new ProcessStartInfo(m_stJavaName, stParameter);
            psi.WorkingDirectory = m_stWorkPath;
            psi.UseShellExecute = false;
            psi.CreateNoWindow = true;
            psi.RedirectStandardOutput = true;
            psi.RedirectStandardError = true;
            m_obProcess.StartInfo = psi;
            m_obProcess.EnableRaisingEvents = true;
            m_obProcess.Exited += new EventHandler(m_obProcess_Exited);
            try
            {
                m_obProcess.Start();
            }
            catch (Exception ex)
            {
                ErrorBox.Show(ex, "���ʧ��");
            }
        }