Hi All,

Just a bug I've noticed...

Steps to reproduce:

  1. Derive/implement an AbstractDocument and override CreateDocument() to return a new instance, given a memento string.
  2. Also override OnOpened() to perform some custom behaviour for when your document is shown.
  3. Show your document, using a memento string.

layoutManager.Value.ShowDocument(_myImportedDocument.Value as IDocument, "myMemento");

Observed behaviour:

In LayoutManager.ShowDocument(IDocument document, string memento, bool makeActive), the overriden CreateDocument is called to give a new instance ('doc'). However, OnOpened() is then called on 'document', the factory instance.

document.OnOpened(content, new EventArgs());

Expected Behaviour:

The OnOpened() override of the new memento-based instance should be called...

doc.OnOpened(content, new EventArgs());

This is the only change required to fix it.

asked 06 Feb '11, 13:53

Lee's gravatar image

accept rate: 0%

edited 06 Feb '11, 16:57

Scott%20Whitlock's gravatar image

Scott Whitlock ♦♦

Good catch!

(06 Feb '11, 16:56) Scott Whitlock ♦♦
Be the first one to answer this question!
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported



Asked: 06 Feb '11, 13:53

Seen: 1,752 times

Last updated: 06 Feb '11, 16:57

powered by OSQA