static string SelectResource(MediaFileType type, Form ownerForm) { //SelectFileForm dlg = new SelectFileForm(type); //dlg.BringToFront(); //if (dlg.ShowDialog(ownerForm) == DialogResult.OK) //{ // return dlg.FileId; //} ResourcesManagerForm dlg = new ResourcesManagerForm(); dlg.BringToFront(); dlg.ShowDialog(ownerForm); return(null); }
public override string OpenPicDialog() { XmlDocument xmlDoc = new XmlDocument(); XmlElement ele = xmlDoc.CreateElement("img"); ResourcesManagerForm res = new ResourcesManagerForm(ele, false); if (res.ShowDialog() == DialogResult.OK) { return(ele.OuterXml); } else { return(""); } }
/// <summary> /// 插入资源链接或者本地页面链接 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void openLinkResButton_Click(object sender, EventArgs e) { XmlDocument xmlDoc = new XmlDocument(); XmlElement xmlElement = xmlDoc.CreateElement("Name"); ResourcesManagerForm resForm = new ResourcesManagerForm(xmlElement, true); if (((Button)sender).Name.Equals("openLinkResButton")) { resForm.CurrentPageIndex = 1; } else if (((Button)sender).Name.Equals("openLinkPageButton")) { resForm.CurrentPageIndex = 2; } if (resForm.ShowDialog() == DialogResult.OK) { if (xmlElement.HasAttribute("src")) { linkAddressTextBox.Text = xmlElement.Attributes["src"].Value; } } }
public static void InsertImage(IHTMLDocument2 m_pDoc2) { //frmInsertPicCode insertpic = new frmInsertPicCode(); //if (insertpic.ShowDialog() == DialogResult.OK) //{ // //不管如何,只要存在此文件则加入到HTML编辑器中 // string picwidth = insertpic.PicWidth.ToString(); // string picheight = insertpic.PicHeight.ToString(); // string picpath = insertpic.PicPath; // string pic2path = insertpic.Pic2Path; // string widthunit = insertpic.WidthUnit; // string heightunit = insertpic.HeightUnit; // image.ImageAlign picalign = insertpic.PicAlign; // string borderwidth = insertpic.PicBorder.ToString(); // string vspace = insertpic.PicVspace.ToString(); // string hspace = insertpic.PicHspace.ToString(); // string linkurl = insertpic.Link; // string linkTitle = insertpic.LinkTipValue; // string linkAccess=insertpic.LinkAccessKeyValue; // string linkTarget = insertpic.LinkTargetValue; // string mediaID = insertpic.MediaID; // image img = new image(); // string insertimghtml = img.ImageHtml("pic", picpath, picwidth, widthunit, picheight.ToString(), heightunit, // picalign, borderwidth, vspace, hspace, "", linkurl, pic2path, linkTarget, linkTitle, linkAccess, mediaID); // InsertElementHelper.AddToSelection(m_pDoc2, insertimghtml, ""); //} XmlDocument xmlDoc = new XmlDocument(); XmlElement ele = xmlDoc.CreateElement("im1g"); ResourcesManagerForm dlg = new ResourcesManagerForm(ele, false); dlg.BringToFront(); if (dlg.ShowDialog() == DialogResult.OK) { } }