Explore10.FileItem.IsLink C# (CSharp) Method

IsLink() public method

public IsLink ( ) : bool
return bool
        public bool IsLink()
        {
            return Path.GetExtension(Filepath) == ".lnk";
        }

Usage Example

Example #1
0
        private void openFile(object sender, RoutedEventArgs e)
        {
            FileItem item = (FileItem)sender;

            if (item.IsLink())
            {
                try
                {
                    WshShell     shell = new WshShell();
                    IWshShortcut link  =
                        (IWshShortcut)shell.CreateShortcut(item.Filepath);
                    FillView(link.TargetPath);
                }
                catch
                {
                    MessageBox.Show("That link seems broken, if it works in Explorer, please file a bug");
                }
            }
            else
            {
                Process.Start(item.Filepath);
            }
        }