public void UnsavedLinkTest() { using var lnk = new ShellLink(TestCaseSources.WordDoc, "/p", TestCaseSources.TempDir, "Test description"); lnk.Properties.ReadOnly = false; lnk.Title = "Test title"; lnk.HotKey = MakeHotKey(VK.VK_T, HOTKEYF.HOTKEYF_CONTROL); lnk.RunAsAdministrator = false; lnk.IconLocation = new IconLocation(TestCaseSources.ResourceFile, -107); lnk.ShowState = WindowStateToSW(System.Windows.Forms.FormWindowState.Minimized); using var fn = new TempFile("lnk", null); lnk.SaveAs(fn.FullName); Assert.IsTrue(File.Exists(fn.FullName)); lnk.ViewInExplorer(); }
public void UnsavedLinkTest() { using var lnk = new ShellLink(TestCaseSources.WordDoc, "/p", TestCaseSources.TempDir, "Test description"); lnk.Title = "Test title"; lnk.HotKey = Keys.Control | Keys.T; lnk.RunAsAdministrator = false; lnk.IconLocation = new IconLocation(TestCaseSources.ResourceFile, -107); lnk.ShowState = FormWindowState.Minimized; var fn = System.IO.Path.GetTempFileName() + ".lnk"; lnk.SaveAs(fn); Assert.That(System.IO.File.Exists(fn), Is.True); lnk.ViewInExplorer(); System.IO.File.Delete(fn); }