예제 #1
0
        //�ΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡ�Ŀ¼��������
        private int mixFolder(string folderName, string prefix, ArrayList exClude, MixerListWriter m_obMixerWriter)
        {
            DirectoryInfo folder = new DirectoryInfo(folderName);
            DirectoryInfo[] folderList = folder.GetDirectories();
            int folderCount = 0;
            for (int i = 0; i < folderList.Length; i++)
            {
                DirectoryInfo subFolder = folderList[i];
                if (exClude.IndexOf(subFolder.Name) < 0 || exClude.Count == 0)
                {
                    string mixedFolder = m_obMixerWriter.write(prefix + subFolder.Name, null);
                    if (mixedFolder != null)
                    {
                        string targetFolder = m_obMixText.Text;
                        if (Directory.Exists(targetFolder))
                        {
                            Directory.CreateDirectory(targetFolder + "\\" + mixedFolder);
                            folderCount++;
                        }
                        DirectoryInfo[] subFolderList = subFolder.GetDirectories();
                        if (subFolderList.Length > 0)
                        {
                            folderCount += mixFolder(folderName + "\\" + subFolder.Name, prefix + subFolder.Name + ".", new ArrayList(), m_obMixerWriter);
                        }
                    }
                }
                //�ΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡγ�ͻ���

            }
            m_obMixerWriter.save();
            return folderCount;
        }
예제 #2
0
        //�ΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡ�ͨ����ʾ����
        private MixerListWriter mixRequest(string fileName, string schemeFile)
        {
            schemeFile = m_obSchemeText.Text + "\\" + schemeFile;

            MixerListWriter m_obMixerWriter = null;

            if (File.Exists(schemeFile))
            {
                m_obMixerWriter = new MixerListWriter(fileName, schemeFile);
                if (MessageBox.Show(m_obMixerWriter.info, "ȷ��ʹ�û���?", MessageBoxButtons.OKCancel) != DialogResult.OK)
                {
                    m_obMixerWriter = null;
                }
            }
            else
            {
                ErrorBox.Show("�Ҳ������·����ļ�! \r\n" + schemeFile, "classMixer");
            }
            return m_obMixerWriter;
        }
예제 #3
0
        //�ΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡ��ļ���������
        private int mixFile(string folderName, string prefix, MixerSchemeDescribe tempWriter, ArrayList exClude, MixerListWriter m_obMixerWriter)
        {
            DirectoryInfo folder = new DirectoryInfo(folderName);
            FileInfo[] fileList = folder.GetFiles();
            int fileCount = 0;
            for (int i = 0; i < fileList.Length; i++)
            {
                string sourceFile = fileList[i].Name;
                string targetFolderName = tempWriter.getMixedName(prefix);
                if (targetFolderName != null)
                {
                    string targetFolder = m_obMixText.Text + "\\" + targetFolderName;

                    if (Directory.Exists(targetFolder))
                    {
                        if (sourceFile != "ģ��.as")
                        {
                            string info = "from :" + folderName + "\\" + sourceFile + "\r\n to : " + targetFolder;
                            if (MessageBox.Show(info, "ȷ������?", MessageBoxButtons.OKCancel) == DialogResult.OK)
                            {
                                string prefixTemp = "";
                                if (prefix != "")
                                {
                                    prefixTemp = prefix + ".";
                                }
                                string[] nameSeg = sourceFile.Split(new string[] { "." }, StringSplitOptions.RemoveEmptyEntries);
                                string mixedName = m_obMixerWriter.write(prefixTemp + nameSeg[0] as string, targetFolderName);
                                if (mixedName != null)
                                {
                                    string targetFile = targetFolder + "\\" + mixedName + ".as";

                                    File.Copy(folderName + "\\" + sourceFile, targetFile);
                                    fileCount++;
                                }
                            }
                            //�ΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡο���ȷ��
                        }
                        else
                        {
                            ErrorBox.Show("find tempfile ! ", "ClassMixer");
                        }
                        //�ΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡ�ģ���ų�
                    }
                }
                //�ΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡ�Ŀ¼ȷ��
            }
            //�ΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡ��Ӽ���������
            if (prefix != "")
            {
                prefix += ".";
            }
            DirectoryInfo[] folderList = folder.GetDirectories();
            for (int i = 0; i < folderList.Length; i++)
            {
                string subFolder = folderList[i].Name;
                int index = exClude.IndexOf(subFolder);
                if (index < 0)
                {
                    fileCount += mixFile(folderName + "\\" + subFolder, prefix + subFolder, tempWriter, new ArrayList(), m_obMixerWriter);
                }
                else if (index > -1)
                {
                    ErrorBox.Show("findedExclude Item : " + subFolder, "ClassMixer");
                }
            }
            m_obMixerWriter.save();
            return fileCount;
        }