Esempio n. 1
0
        public static void InsertAudio(HTMLDesignerContrl htmlDesigner)
        {
            string htmlCode = htmlDesigner.OpenAudioDialog();

            InsertElementHelper.AddToSelection(htmlDesigner.DesignWebBrowser.idoc2, htmlCode, "");

            /*InsertAudioCodeForm insertAudio = new InsertAudioCodeForm(htmlDesigner);
             * if (insertAudio.ShowDialog() == DialogResult.OK)
             * {
             *  if (insertAudio.MediaPath != string.Empty)
             *  {
             *      //不管如何,只要存在此文件则加入到HTML编辑器中
             *      string path = insertAudio.MediaPath;// FileFullPath;// Path.GetFileName(Path.GetDirectoryName(FileFullPath)) + "/" + Path.GetFileName(FileFullPath);
             *      string mwidth = insertAudio.MediaWidth.ToString() + insertAudio.MediaWidUint;
             *      string mheight = insertAudio.MediaHeight.ToString() + insertAudio.MediaHeigUint;
             *      string mvspace = insertAudio.MediaVspace.ToString();
             *      string mhspace = insertAudio.MediaHspace.ToString();
             *      string mtitle = insertAudio.MediaTitle;
             *      string maccesskey = insertAudio.MediaAccessKey;
             *      string mtabindex = insertAudio.MediaTab;
             *      string mscale = insertAudio.MediaScale;
             *      Align malign = insertAudio.AudioAlign;
             *      Quality mquality = insertAudio.AudioQuality;
             *      bool misloopplay = insertAudio.MediaLoop;
             *      bool misautopaly = insertAudio.MediaAutoPlay;
             *      string mediaID = insertAudio.MediaID;
             *      Audio insAudio = new Audio();
             *      string insAudioHtml = insAudio.AudioHtml(htmlDesigner.InsertUseMode,path, mwidth, mheight, mvspace, mhspace, mtitle, maccesskey, mtabindex, malign, mquality, misloopplay, misautopaly, mscale, mediaID);
             *      AddToSelection(htmlDesigner.DesignWebBrowser.idoc2, insAudioHtml, "");
             *      string s = htmlDesigner.DesignWebBrowser.idoc2.body.outerHTML;
             *  }
             * }*/
        }
Esempio n. 2
0
        public void SetFormedioPathChange(MediaFileType mediaType)
        {
            string filepath = "";
            string mediaId  = _htmldesigner.OpenAudioDialog();//.OpenFlashDialog();

            if (File.Exists(mediaId))
            {
                filepath = mediaId;
            }
            else
            {
                filepath = _htmldesigner.GetResourceAbsolutePath(mediaId);
            }
            if (mediaType == MediaFileType.Flash)
            {
                flashInfo             = new FlashInfo(filepath);
                widthNumUpDown.Value  = flashInfo.Width;
                heightNumUpDown.Value = flashInfo.Height;
                ratio = widthNumUpDown.Value / heightNumUpDown.Value;
                limitScaleCheckBox.Visible = true;
                limitScaleCheckBox.Enabled = true;
            }
            else
            {
                widthNumUpDown.Value       = 100;
                heightNumUpDown.Value      = 100;
                limitScaleCheckBox.Visible = false;
            }
            widthUintComboBox.SelectedIndex = heightUintComboBox.SelectedIndex = 0;

            //设置窗体的一些默认值
            this.widthCheckBox.Checked    = true;
            this.heightCheckBox.Checked   = true;
            this.loopCheckBox.Checked     = true;
            this.autoPlayCheckBox.Checked = true;

            MediaPath = filepath;
        }