public PathBrowserCloseWatcher(object owner, Guid dialogHandleId, PathChoosenHandlerDlgt pathChoosenHandler, DialogCancelledHandlerDlgt cancelledHandler)
 {
   _watcher = new MessageWatcher(owner, PathBrowserMessaging.CHANNEL, message =>
     {
       if (message.ChannelName == PathBrowserMessaging.CHANNEL)
       {
         PathBrowserMessaging.MessageType messageType = (PathBrowserMessaging.MessageType) message.MessageType;
         if (messageType == PathBrowserMessaging.MessageType.PathChoosen)
         {
           Guid closedDialogHandle = (Guid) message.MessageData[PathBrowserMessaging.DIALOG_HANDLE];
           ResourcePath choosenPath = (ResourcePath) message.MessageData[PathBrowserMessaging.CHOOSEN_PATH];
           if (closedDialogHandle == dialogHandleId)
           {
             if (pathChoosenHandler != null)
               pathChoosenHandler(choosenPath);
             return true;
           }
         }
         else if (messageType == PathBrowserMessaging.MessageType.DialogCancelled)
         {
           if (cancelledHandler != null)
             cancelledHandler();
           return true;
         }
       }
       return false;
     }, true);
   _watcher.Start();
 }
 public PathBrowserCloseWatcher(object owner, Guid dialogHandleId, PathChoosenHandlerDlgt pathChoosenHandler, DialogCancelledHandlerDlgt cancelledHandler)
 {
     _watcher = new MessageWatcher(owner, PathBrowserMessaging.CHANNEL, message =>
     {
         if (message.ChannelName == PathBrowserMessaging.CHANNEL)
         {
             PathBrowserMessaging.MessageType messageType = (PathBrowserMessaging.MessageType)message.MessageType;
             if (messageType == PathBrowserMessaging.MessageType.PathChoosen)
             {
                 Guid closedDialogHandle  = (Guid)message.MessageData[PathBrowserMessaging.DIALOG_HANDLE];
                 ResourcePath choosenPath = (ResourcePath)message.MessageData[PathBrowserMessaging.CHOOSEN_PATH];
                 if (closedDialogHandle == dialogHandleId)
                 {
                     if (pathChoosenHandler != null)
                     {
                         pathChoosenHandler(choosenPath);
                     }
                     return(true);
                 }
             }
             else if (messageType == PathBrowserMessaging.MessageType.DialogCancelled)
             {
                 if (cancelledHandler != null)
                 {
                     cancelledHandler();
                 }
                 return(true);
             }
         }
         return(false);
     }, true);
     _watcher.Start();
 }