Jorge Martins

Jorge Martins

  • NA
  • 6
  • 3.2k

Online Excel file in use by ... How to hook to callback notification?

Nov 5 2011 11:18 AM
Hi guys
 
I have a Silverlight 4 (c#) app where I need to do some simple file mangement (list files and folders, open files, navigate on folder tree, etc.).
Right now I'm gathering the necessary partial solutions and pieces of reusable code to build the full thing.
 
These files and folders are online resources and will be MS Word, MS Excel, MS Powerpoint and PDF documents.
 
So far I've been able to read the folder tree, each folder content and dispay it.
I've also been able to open each file using the correct application and to find out if, at a given moment, a file is opened by someone.
 
Now comes the problem!
 
Let's supose that a user A opens a file (let's say, an excel workbook) for editing.
When a user B tries to open that same file he gets a "file in use" message box with the user A identification and an option for notification wher User A releases the file.
 
When that notificaton callback reaches user B he gets the "File now available" message box and an option to reopen the file with read/write previleges.
 
I'm able to find out if the file is still opened and can create a timer event to check on the avalability of that file from time to time (for instance, every 15 seconds).
 
But what I realy wanted to do is to hook on that callback event that user B got and notify also the silverlight app so I can do some processing on that same file.
 
Does anyone have a solution, or even a clue, on how to catch that event after a user has closed the file?
 

Answers (2)