private void fileClicked(object sender, MouseButtonEventArgs e)
        {
            //Check for double click
            if (e.ClickCount > 1)
            {
                if (this.file is MyDirectory)
                {
                    //Invoking an event
                    if (DirectoryOpenedEvent != null)
                    {
                        DirectoryOpenedEvent.Invoke(this.file as MyDirectory);
                    }
                }

                if (this.file is MyFile)
                {
                    if (FileOpenedEvent != null)
                    {
                        FileOpenedEvent.Invoke(this.file as MyFile);
                    }
                }
            }
            else if (e.ClickCount == 1)
            {
                if (this.file is MyFile)
                {
                    if (FilePreviewedEvent != null)
                    {
                        FilePreviewedEvent.Invoke(this.file as MyFile);
                    }
                }
                else
                {
                    if (FilePreviewedEvent != null)
                    {
                        FilePreviewedEvent.Invoke(null);
                    }
                }
            }
        }
Beispiel #2
0
 public void Handle(FileOpenedEvent message)
 {
     AddToRecentFiles(message.FileName);
 }