/// <summary> /// Process the submissions absolute path /// </summary> /// <returns>Was the submission able to be loaded?</returns> public override bool Process() { _loaded = false; try { WP6Document doc = new WP6Document(_target.AbsolutePath); // Build document content StringBuilder contentBuilder = new StringBuilder(); foreach (WPToken t in doc.documentArea.WPStream) { Type tokenType = t.GetType(); if (tokenType == typeof(Character)) { Character character = (Character)t; contentBuilder.Append(character.content); } } _target.Content = contentBuilder.ToString(); _target.ContentLength = _target.Content.Length; _target.ContentHash = Compare.Hash(_target.Content); _loaded = true; } catch (Exception e) { _target.Logging.Add("- " + Markdown.Bold("An exception occured when processing " + _target.AbsolutePath + ", " + e.Message)); } return(_loaded); }
private void button1_Click(object sender, EventArgs e) { string path = textBox1.Text; doc = new WP6Document(path); WP6Document doc2 = doc; this.Close(); }