예제 #1
0
        private void btnOk_Click(object sender, RoutedEventArgs e)
        {
            if (txtHtmlDis.Text != "" && txtHtmlFile.Text != "" && txtHtmlImg.Text != "")
            {
                _htmlModel.ActionHtmlDis  = txtHtmlDis.Text;
                _htmlModel.ActionHtmlfile = txtHtmlFile.Text;
                _htmlModel.ImgFileName    = txtHtmlImg.Text;

                //移动启动文件(复制)
                int htmlNameImgIdex = _htmlModel.ImgFileName.LastIndexOf('\\');
                //获取HTML5文件名字
                if (htmlNameImgIdex > 0)
                {
                    string Img       = _htmlModel.ImgFileName.Substring(htmlNameImgIdex + 1);
                    string assetpath = Globals.appStartupPath + "\\" + Globals.assetFolder + "\\" + Img;
                    FileSecurity.StreamToFileInfo(assetpath, _htmlModel.ImgFileName);
                    _htmlModel.ImgFileName = assetpath;
                }
                //移动启动文件(复制)
                int htmlNameIdex = _htmlModel.ActionHtmlfile.LastIndexOf('\\');
                //获取HTML5文件名字
                if (htmlNameIdex > 0)
                {
                    _htmlModel.FileName = _htmlModel.ActionHtmlfile.Substring(htmlNameIdex + 1);
                    string assetpath = Globals.appStartupPath + "\\" + Globals.assetFolder + "\\" + _htmlModel.FileName;
                    FileSecurity.StreamToFileInfo(assetpath, _htmlModel.ActionHtmlfile);

                    _htmlModel.ActionHtmlfile = assetpath;
                }

                //移动源目录(复制)
                int htmlDisNameIdex = _htmlModel.ActionHtmlDis.LastIndexOf('\\');
                if (htmlDisNameIdex > 0)
                {
                    string DisName = _htmlModel.ActionHtmlDis.Substring(htmlDisNameIdex + 1);
                    FileSecurity.CopyFolderTo(_htmlModel.ActionHtmlDis, Globals.appStartupPath + "\\" + Globals.assetFolder + "\\" + DisName);
                    _htmlModel.ActionHtmlDis = Globals.appStartupPath + "\\" + Globals.assetFolder + "\\" + DisName;
                }


                if (eventsetSteageBrower != null)
                {
                    eventsetSteageBrower(_htmlModel);
                    this.DialogResult = true;
                    this.Close();
                }
            }
            else
            {
                MessageBox.Show("请检查您的源文件夹和启动文件、源缩略图是否都获取了");
            }
        }