/// <summary> /// Prepares the text adding marks at the end of each regular expression (Programming sentence) /// so they can be deleted easily after generating the report.- /// </summary> private void PreprocessText() { if (!_preprocessText) { return; } //Check to see if must work with RTF or plain text format. idFmt = TextFormat == ETextFormat.Text ? (IDocumentFormat) new TextFormat() : (IDocumentFormat) new RTFFormat(); //Get Matches for any possible placeholder Regex regex0 = CommonMethods.GetRegex(KeywordsRegExString); MatchCollection matchCollInit = regex0.Matches(_RTFText.ToString()); //Replaces every 'new line' sequence with '\DEL' sequence. foreach (Match m in matchCollInit) { int i = RTFInput.ToString().IndexOf(idFmt.NewLine, m.Index); if (i >= 0) { RTFInput = RTFInput.Remove(i, idFmt.NewLine.Length); RTFInput = RTFInput.Insert(i, "\\DEL"); } } RTFInput = RTFInput.Replace("\\DEL", ""); }
private void toolStripMenuItem1_Click(object sender, EventArgs e) { if (propertiesEditor != null) { if (saveMetadata.ShowDialog() == DialogResult.OK) { MetadataPropertyCollection changedProperties = propertiesEditor.GetProperties(); FormatBase format = GroupDocs.Metadata.Tools.FormatFactory.RecognizeFormat(openFileDialog.FileName); IDocumentFormat documentFormat = format as IDocumentFormat; documentFormat.SetProperties(changedProperties); format.Save(saveMetadata.FileName); } } }