示例#1
0
 public void CreateShortcut(ShortcutInfo info) {
     var sanitizedLinkFile = info.DestinationPath.GetChildFileWithName(MakeValidShortcutFileName(info.Name));
     var shortcut = new ShellLink {
         Target = info.Target.ToString(),
         Arguments = info.Arguments,
         WorkingDirectory = info.WorkingDirectory == null ? null : info.WorkingDirectory.ToString(),
         Description = info.Description,
         IconPath = info.Icon == null ? null : info.Icon.ToString()
     };
     shortcut.Save(sanitizedLinkFile.ToString());
 }
示例#2
0
 public Task CreateShortcutAsync(ShortcutInfo info) {
     return Task.Run(() => CreateShortcut(info));
 }