Exemple #1
0
        /// <summary>
        /// 連番ファイルを設定する
        /// </summary>
        /// <param name="s"></param>
        /// <returns></returns>
        public bool SetSquenceFile(string s)
        {
            bool ret = false;

            if (s == "")
            {
                return(ret);
            }
            if (Directory.Exists(s) == true)
            {
                s = FileInFolder(s);
                if (s == "")
                {
                    return(ret);
                }
            }
            FileNameWithFrame fn = new FileNameWithFrame(s);

            IEnumerable <string> files = Directory.EnumerateFiles(fn.ParentDir, fn.Node + "*" + fn.Ext, SearchOption.TopDirectoryOnly);

            m_SequenceFile.Init();
            foreach (string file in files)
            {
                m_SequenceFile.Add(file);
            }
            if (m_SequenceFile.IsError == true)
            {
            }
            if (m_TextBox_Seq != null)
            {
                string sq = Src;
                if (m_TextBox_Seq.Text != sq)
                {
                    m_TextBox_Seq.Text = sq;
                }
            }

            if (m_ExportDir == "")
            {
                m_ExportDir = Path.GetDirectoryName(fn.ParentDir);
            }
            string nd = DeleteLastChar(m_SequenceFile.Node);

            if (m_ExportName != nd)
            {
                m_ExportName = nd;
            }
            if (m_TextBox_ExportName != null)
            {
                string nm = ExportName;
                if (m_TextBox_ExportName.Text != nm)
                {
                    m_TextBox_ExportName.Text = nm;
                }
            }
            return(ret);
        }
Exemple #2
0
        // *****************************************************************************************
        public bool Add(string n)
        {
            if (n == "")
            {
                return(false);
            }
            FileNameWithFrame fn = new FileNameWithFrame(n);

            if ((fn.FrameStr == "") || (fn.Node == ""))
            {
                return(false);
            }
            if (fn.IsPicture == false)
            {
                return(false);
            }
            if (FrameCount <= 0)
            {
                m_ParentDir = fn.ParentDir;
                m_Node      = fn.Node;
                m_Ext       = fn.Ext;
                m_Frames.Add(fn.FrameStr);
                m_StartFrame     = m_LastFrame = fn.Frame;
                m_FrameStrLength = fn.FrameStr.Length;

                return(true);
            }
            if ((m_ParentDir == fn.ParentDir) && (m_Node == fn.Node) && (m_Ext == fn.Ext))
            {
                int frm = fn.Frame;
                if (m_LastFrame < frm)
                {
                    int fl = fn.FrameStr.Length;
                    if (m_FrameStrLength == fl)
                    {
                        m_LastFrame = frm;
                        m_Frames.Add(fn.FrameStr);
                        if (fn.FileSize == 0)
                        {
                            m_Errers.Add(fn.FileName + ",filesize Zero");
                        }
                        return(true);
                    }
                }
            }
            return(false);
        }