Document Manager

Ribbon for WPF Forum

Posted 16 years ago by Bryan Livingston
Avatar
Thanks for implementing the new doc manager. I'm switching to it and have a few conserns.

First, the numbering is great, but the keystrokes don't work for them. You should be able to hit Alt-F, 1 and it open the first file. Doesn't look like the keyboard shortcuts are being hooked up.

Second, a document can be added twice and will be listed twice. I was expecting the doc manager would be smart enough to handle this case. Was thinking if a doc with a duplicate uri tried to get added to the list, it would not add it twice and just update the last opened timestamp on the existing record. Is this some functionality that can be added or am I going to have to manage that myself?

Bryan

Comments (6)

Posted 16 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Bryan,

Thanks for the comments. The numbering is something that is on our TODO list already.

For the other item, we're currently just exposing an ObservableCollection as the Documents property.

A side note is that nothing in RecentDocumentManager updates the last opened date/time. The only time we update it is when the DocumentReference is first created. From that point on, you just update it yourself by setting DocumentReference.LastOpenedDateTime = DateTime.Now.

That being said, what do you think the best way to do this is... there are several ways duplicates can be added: Add, Insert, Set on the collection, along with simply taking an existing document reference and changing its Uri location.


Actipro Software Support

Posted 16 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Could you also explain in a little more detail the scenario you have where you are getting multiple document references to the same document? Thanks!


Actipro Software Support

Posted 16 years ago by Bryan Livingston
Avatar
It happens if someone opens a document twice without using the Recent Docs or if someone does a save as and overwrites an old doc.

As it is I think I'd have to check for an existing DocumentReference in the list every time I create a new DocumentReference object.

I just started to try to get it to serialize as well and XmlSerializer chokes on the interface, so I'm not sure what to do there and it's not going to be straight forward. I was hoping that the manager would help out with serializing/deserializing as well since everyone who uses it will be needing to do that. Maybe a Load/Save on IDocumentReference.

I'm probably not going to be using a custom DocumentReference class as I can transform my online file system references into a Uri. Perhaps we can dispense with the extension point altogether and expose a simple API for the manager.

Something like this:

class DocumentManager
{
public void DocumentOpened(string name, Uri location, string tag);

public string Serialize();
public void Deserialize(string);
}

Tag would be an arbitrary extension point. Ideally would be an object reference, but a string or byte array would be easy to serialize.
Posted 16 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Actually we have a serialize/deserialize set of methods all ready to go for the next maintenance release on RecentDocumentManager. It serializes the data to a XAML string, and has the same method signatures as what you described.

I've added a Tag property to IDocumentReference and DocumentReference for you just now.

RecentDocumentManager also has a couple new methods:

1) GetDocumentReference: Accepts a Uri and returns an existing IDocumentReference that has the same Uri if any. This can be used to find existing references easily.

2) NotifyDocumentOpened: A helper method for quickly notifying an existing document reference (based on Uri) to update its last-opened date/time, and will create a simple DocumentReference if there is no existing document reference. This method has 3 overloads:
Uri location
Uri location, string name
Uri location, string name, object tag

And it returns the updated/created IDocumentReference.

So between all these things I think we have all bases covered now, right?


Actipro Software Support

Posted 16 years ago by Bryan Livingston
Avatar
That should work great. Thank you so much.
Posted 14 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
The keystrokes to access the recent items are implemented for the next maintenance release.


Actipro Software Support

The latest build of this product (v24.1.1) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.