<img>MonImage.jpg</img>
private DocumentEvents2_XMLAfterInsertEventHandler xmlafterinsertEvent;
protected void ThisDocument_XMLAfterInsert(XMLNode node, bool b) { }
/// <summary> /// Required procedure. Do not modify. /// </summary> /// <param name="application">Application object.</param> /// <param name="document">Document object.</param> public void _Startup(object application, object document) { this.thisApplication = application as Application; this.thisDocument = document as Document; xmlafterinsertEvent = new DocumentEvents2_XMLAfterInsertEventHandler(ThisDocument_XMLAfterInsert); ((DocumentEvents2_Event) thisDocument).XMLAfterInsert += xmlafterinsertEvent; ...
protected void ThisDocument_XMLAfterInsert(XMLNode node, bool b) { if (node.BaseName == "img") { ... } }
protected void ThisDocument_XMLAfterInsert(XMLNode node, bool b) { IDictionary settings = ((IDictionary) AssemblySettings.GetConfig("FileExtensions")); if (node.BaseName == "img") { FileDialog filedlg = ThisApplication.get_FileDialog(MsoFileDialogType.msoFileDialogFilePicker); filedlg.InitialView = MsoFileDialogView.msoFileDialogViewPreview; filedlg.AllowMultiSelect = false; filedlg.Title = "Choose an image file"; filedlg.ButtonName = "OK"; filedlg.Filters.Clear(); filedlg.Filters.Add("Images Files", (string) settings["image"], oMissing); //"*.jpg, *.png, *.gif" int ret = filedlg.Show(); if (ret == -1) node.Text = Path.GetFileName(filedlg.SelectedItems.Item(1)); } }