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

Lee
1413311
accept rate: 0%

edited 06 Feb '11, 16:57

Scott%20Whitlock's gravatar image

Scott Whitlock ♦♦
696262833

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

By RSS:

Answers

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

Tags:

×17
×7
×5
×2

Asked: 06 Feb '11, 13:53

Seen: 1,532 times

Last updated: 06 Feb '11, 16:57

powered by OSQA